Trying to read AM/PM form NOW()
so after some reading
- platform: template
sensors:
am_pm:
value_template: >
{{ now().strftime('%p') }}
but in the PM
why does sensor.am_pm not say PM
what did I miss
Trying to read AM/PM form NOW()
so after some reading
- platform: template
sensors:
am_pm:
value_template: >
{{ now().strftime('%p') }}
but in the PM
why does sensor.am_pm not say PM
what did I miss
Your template wont ever update. ( Templates without entities using now()
)
You will need to define a time sensor and add that as an entity to your sensor. This will update every minute:
- platform: template
sensors:
am_pm:
entity_id: sensor.time # required to update now()
value_template: >
{{ now().strftime('%p') }}
time sensor:
Thanks
must of miss that bit in the readings