Hello,
I'm trying to get the time that an entities has had one of it's attributes last changed to basically use it as a condition for turning off lights. I.E it's 10:30 and if the lights haven't been messed with in the past 10 minutes then go ahead and shut them off.
Right now I have it as an automation with this as the template.
condition: template
value_template: " {{ (as_timestamp(now()) - as_timestamp(states.light.living_room_short_lamp.last_updated)) < 600 }}"
-
- What is this string even called just for reference later?
-
- Is there a way to see what the value of the equation equals? Like if it's true or false, or if I get rid of the "<" could I see the value of the math?
-
- I got this from chatgpt, but how can I find the different options that go AFTER the states.light.living_room_short_lamp? I know there's a lot of info that exists within the states and entities.
-
- This info is helps because I want to be able to do things like this in other automations. LIke I want a trigger that says one hour after sunrise turn all the lights off mon-friday