Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #################################################################
- # Sections below should be added to config.yaml file
- #################################################################
- #----------------------------------------------------------
- # Local Date and time
- #----------------------------------------------------------
- sensor:
- - platform: time_date
- display_options:
- - "time"
- - "date"
- - "date_time"
- - "time_date"
- - "time_utc"
- scan_interval: 55 #once every 55 second
- - platform: template
- sensors:
- #Format time in local format
- local_time:
- value_template: "{{states('sensor.time') and as_timestamp(now()) | timestamp_custom('%H:%M')}}"
- #Format date in local format
- local_date:
- value_template: "{{ states('sensor.date') and as_timestamp(now()) | timestamp_custom('%a %d.%m.%y') | replace('Mon','Man') | replace('Tue','Tir') | replace('Wed','Ons') | replace('Thu','Tor') | replace('Fri','Fre') | replace('Sat','Lør') | replace('Sun','Søn') }}"
- #----------------------------------------------------------
- # Limit log entries
- # (e.g do not store history for date/time sensors)
- #----------------------------------------------------------
- recorder:
- exclude:
- entities:
- - sensor.date
- - sensor.time
- - sensor.local_time
- - sensor.date_time
- - sensor.time
- - sensor.time_date
- - sensor.time_utc
- #################################################################
- # Below must be added to your Lovelace file
- #################################################################
- #---------------------------------------------------------------
- # Date and time
- #---------------------------------------------------------------
- - type: picture-elements
- state_filter:
- - null
- image: /local/assets/blank.png
- aspect_ratio: 14%
- elements:
- - type: state-label
- entity: sensor.local_time
- style:
- top: 50%
- left: 20%
- #height: 100px
- #width: 2.5%
- font-size: 2.8em
- color: rgba(202,217,235,1)
- - type: state-label
- entity: sensor.local_date
- style:
- top: 50%
- left: 70%
- #width: 300px
- text-align: right
- font-size: 1.5em
- text-transform: uppercase
- color: rgba(202,217,235,.75)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement