Im totally frustrated. I spend 8h for the easiest job and can’t find a solution.
how to set a automation to do something when PIR is absent for 5 minutes.
in my old home automation software I just have to type if PIR xy is absent for 5m; then do.. and it resets automatically after every presents/absents.
i have tried a lot and but nothing works 100%. sometimes it works and trigger for 3-4 times and then nothing happens and the light doesn’t turn off. the most curious thing is, if it doest trigger, there is no log inside the trace function.
there is no difference between device or state trigger. is this a home assistant bug? can’t belive. I think everyone turn lights off in rooms like corridors by absents of PIR.
BTW. could it be that automations doest work correct if I write other automations and save frequently?
trigger:
- platform: state
entity_id: binary_sensor.kitchen_motion_sensor_on_off
from: "on"
to: "off"
for: " {{ (states ('input_number.helper_kitchen_light')|int)|multiply(60)|timestamp_custom('%H:%M:%S', false) }}"
As you can see, I use a helper to set the time. This will make it easier for you to change the value for eg. debuging.
It is recommended to check if a light is ON before turn it off? or do just fire OFF ?
Just turn it off.
Does editing/saving automation affects the execution of other automation?
Depends on what version of HA you are on. Pre 2022.11 will reload all automations.
Does the recorder has any effect on the “for: time” function?
No
i have an eye on HA since years. now I decide to migrate and run into a shitty behavior which is resolved with the version come out two week after I start. I hate murphy law. and really everything that can happen happens here. but at least i learn in the process.
yes, at now ha reloads all automations if you save one in the ui, so the for does not work if you reload.
This will be better in 2022.11, you can see the release notes here
great. thank you! I have to ask again because I don’t want to run into a similar problem and spent hours of time.
does deactivating/activating a automation via another automation reload all automations?
I decide to use this a lot. I have to set less conditions and maybe I save some processing power