according to [Time & Date - Home Assistant], the customize date and time command should be as below
template:
- sensor:
- name: "Date and time test"
state: "{{ as_timestamp(states('sensor.date_time')) | timestamp_custom('%d-%b-%Y, %I:%M:%S %p') }}"
icon: "mdi:calendar-clock"
but somehow when I paste it to configuration.yaml. The date and time sensor show unavailable.
is that something wrong with my command?
The actual date & time format that I need is “DD-MMM-YYYY, h:mm:ss AM/PM”
2 posts - 2 participants