added time
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
- platform: time_date
|
||||||
|
display_options:
|
||||||
|
- 'time'
|
||||||
|
- 'date'
|
||||||
|
|
||||||
|
- platform: template
|
||||||
|
sensors:
|
||||||
|
dato:
|
||||||
|
friendly_name: "Dagens dato"
|
||||||
|
value_template: >-
|
||||||
|
{% set timestamp = strptime(states('sensor.date'), '%Y-%m-%d').timestamp() %}
|
||||||
|
{% set weekdays_DK = ['Man', 'Tirs', 'Ons', 'Tors', 'Fre', 'Lør', 'Søn'] %}
|
||||||
|
{% set months_DK = ['Januar', 'Februar', 'Marts', 'April', 'Maj', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'December'] %}
|
||||||
|
{{ weekdays_DK[timestamp | timestamp_custom('%w') | int - 1] }}dag den {{ timestamp | timestamp_custom('%-d.') }} {{ months_DK[timestamp | timestamp_custom('%-m') | int - 1] }} {{ timestamp | timestamp_custom('%Y') }}
|
||||||
Reference in New Issue
Block a user