After more than a decade of using node-red for automations, I’m changing to using automations.
One of the automations that works flawlessly in Node-Red but not in the HA Automations, is detecting if anybody is at home or not
In pseudo code:
If zone.home.persons >0 (or becomes >0) #Then apparently someone is at home
Then Do some stuff
If zone.home.persons =0 (or becomes 0) #apperently nobody is home
Then do some other stuff
In the automation the trigger just doesn’t trigger. Both the state as the numeric state trigger (with or without quotes)
The state (in developer tools) actually changes to the number of people at home.
For these kind of things it is always good to see the yaml of your automation, properly formatted using </> so we can change it to work. For this however, we can probably do without.
The persons attribute is a list of names of persons in the zone. The state itself is the count. So do not test for an attribute, do not supply any. Test the zone itself for the number.
just a comment on that, my automation recently stopped working that was checking exactly for this zone.home entity. Has there been an update that requires to change anything here? Thanks in advance
Edit: nevermind, i pasted the wrong automation, heres the correct one:
looking at it again it seems i was checking for the attribute persons, this was working fine before though. Probably a recent update removed that support. Anyway, i have corrected my yaml as follows now and will check it asap:
Thanks for the remark!
Again this error did not strike my eyes since it was working perfectly until a few days ago when i updated to the latest version.