I have a momentary switch to boost the heating, I would like to know the time lapsed since the last boost to prevent a boost again in a certain amount of time, say 30 minutes.
The switch works well but when trying to get the last_update or last_changed attribute its not been updated.
Ive since found out that the state doesn’t appear to changed to ‘on’ and stays ‘off’ in developer tools when activating the switch.
I thought of doing this through an input boolean setting it in the switch turn_on and unsetting in the switch turn_off section of the code but wasn’t sure how to incorporate that in the code and whether it would work.
There must be a way around this which is why i’m asking for help here.
Thanks guys, I tried them both but: @francisp your idea worked but stopped the momentary action of the switch making it a toggle. @jazzyisj your idea still didn’t update the last_update or last_changed attribute.