Is it possible to have a template (binary) sensor update based on a change of attribute rather than a state?
Specifically, I have a binary sensor that I want to change to ‘on’ if a certain event happens today.
Currently I am using
binary_sensor:
- platform: template
sensors:
arsenal_game_reminder:
entity_id: sensor.date
value_template: >
{{ state_attr('calendar.arsenal_fc','start_time').split(' ')[0] == now().date() | string }}
which has worked happily for many months but recently I am now getting situations where the calendar is not updating before the date sensor sees a new date.
I can’t use the state of the calendar itself because it is off
until the event actually starts but I want to know if the event is scheduled for any time today. I could use entity_id: sensor.time
of course but that seems like a hell of an overkill to check every minute for an event that happens at most twice a week. Is there a more economical way to do this?
Can the sensor be made recognise a change of an attribute of the calendar rather than the state?
This feels like it should be simple…