time_date update template sensor example (#20021)

This commit is contained in:
SNoof85 2021-10-28 09:00:41 +02:00 committed by GitHub
parent 0cfc528a5b
commit 5856c967e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,12 +62,11 @@ sensor:
display_options:
- 'date_time_iso'
# Build on the standard sensor to produce one that can be customized
- platform: template
sensors:
time_formatted:
friendly_name: "Date and time"
value_template: "{{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%A %B %-d, %I:%M %p') }}"
icon_template: mdi:calendar-clock
template:
- sensor:
- name: "Date and time"
state: "{{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%A %B %-d, %I:%M %p') }}"
icon: "mdi:calendar-clock"
```
{% endraw %}