Hi guys,
I have a sensor which pulls a time from another sensor as follows:
elm_isha:
friendly_name: 'Isha'
value_template: '{{ state_attr("sensor.prayer_times","isha") }}'
icon_template: mdi:clock
The sensor value appears, for example, as: “17:54” i.e. as an HH:MM.
I need to use this sensor as a time trigger for an automation, however Home Assistant requires the sensor to be formatted as a device_class: timestamp before it can be used as a time trigger.
I therefore need to format the HH:MM it currently appears as to the ISO 8601 format (meaning it has the “T” separator between the date and time portion).
It should therefore format as: [today’s date as YYYY-MM-DD]T[HH:MM from the “sensor.prayer_times”,“isha” sensor].
Example: 2023-11-20T17:54:03:49.253717+00:00`
I would be really grateful if someone could kindly help code the value_template to convert it.
Many thanks