#human presence detection - automation
1 messages · Page 1 of 1 (latest)
And “human” is a misnomer. It’s more like “living thing”. My dogs can set off my sensors.
I haz no dog, I'll settle for movement 😄
I run the other automations on sun as trigger if it is dark or not, somewhat works
You could do that. Basically the Presence entity is just a binary_sensor. On if there’s “something” there, off otherwise.
Just trying to wrap my head around how to use it when its not numbers
if Presence == on AND sun has set
it does not show me on/off but loads of diff states
What does the Presence entity show when you look at its details?
It should be just a binary_sensor.
Yup. It’s a binary sensor. You’re fine. Just use that as your trigger (with an entity state trigger) and then add a condition using the sun is below horizon.
Or is it smarter todo_it with the built in luxthingy
Im old so low light comes early 😄
Eh, not really because when the lights are on, the lux will likely be above your threshold.
right!
So, you run the risk of the lights not coming on/staying on because the lux sensor is reporting what it sees.
Not sure what you mean?
Yeah. It takes the variables and then determines if there is presence.
those are the sensors
Yeah, they all basically wrap up into the Presence entity. if this > x and that > x then on etc.
So again your asumption was correct; just use the binary
You can enable them (and should) to fine tune the detection. Otherwise it’ll be too excessive and triggering on pretty much anything.
So then I'll make an automation for turning on, and one that turns off after 5min of inactivity; or can it be done in the same ?
You could do that in a single automation with multiple triggers and use ids. But, that is a bit more complex. It’s how I do all mine though.
Right, I'm a complex simple person 🙂
lol then just do 2 automations. No harm in that at all.
Noooo, one was said!
Hahahaha. Do whatever works for you.
If it works, I'm happy
I’m 10+ years into HA… so complex is my life. lol
Aotch
Thinking if that binary is from just being detected in the house from unifi
Nope, now I'm thinking out loud
It shouldn’t be.
Yeah. You could go into the entity settings and change it to a device class of Motion and it’ll report clear and detected in the frontend.
Home seams to be equal to on
It’s all on/off under the covers. The device class determines what you “see”.
Or if I spare me the trouble and push buttons 😄
this just got very complex in my head
Kinda the turnoff sequence that throws me off
its the and/if-part I dont get
Dont think I get it in the same automation, I prolly need 2 cause I dont get how to
Well I'm gonna try this, not as clean but I cant find the "else" option
nope. that failed
I just find and or not
HAHAH I found it 😄
damn I'm the man!
doh
think that will work ?
Else I just test it 😉
You probably don't want the same condition in the conditions area ("And if") and in the if/else.
Oh well, didnt work 😄
Everything part of "and if" is the conditions section of the automation. If any of those fail none of the actions ("Then do") will run.
The if/else is an action
So if you want to do different things based on the trigger, don't put anything in the conditions area, and just put all your conditions in the if/else block
Well I dont get where I did wrong
nvm I just make 2 automations with helper
did work previously
So I revisited this automation; actually genious to have on/off in same automation, however I get it to turn on, but never turns off. Never does else efter 5mins
you might have to use the state "not_home" rather than "away" depending on your presence sensor
Is your work a zone? If so, the to would probably be the zone name. Not sure what presence1 is though.
isn't that just the entity name?
Oh sorry, was AFK
nope it didnt work
What shows in history is the translated state. For a binary sensor, it should be on/off (unless you changed the Show As for it).
this is what it reports
Yeah, that’s the translated state.
Still if I put in on/off in boxes; it changes to home/away
And this is just a regular binary sensor? Can you show the entity info screen? Something seems off.
Well its one of them
you might have to use the state "not_home" rather than "away" depending on your presence sensor
Not home is the state for a device_tracker, not a presence-class binary sensor.
This just looks like a regular presence-class binary sensor. What is the problem with it?
But basicly the binary is a sum of all imput if there is action or not
Yeah, it’s set to “presence” instead of “occupancy”.
Or vice-versa. Can’t remember off the top of my head.
Well, how do I fix it 😄
Can you restate what the problem is
I can get it to turn on the desired lamp, but never turns off
Can you share the current yaml of the automation
Well I dont edit in yaml, see if I can find it
Top right corner
"Edit in Yaml"
Even if you didn't create it in yaml, that's the easiest way to share its exact details to someone else.
Well then I have to do that for all sections
not for each individual item
up near the TRACES button
it will show the entire automation in yaml format
Might be this: ```id: '1729790449035'
alias: Office Lights Motion
description: ''
triggers:
- trigger: state
entity_id:- binary_sensor.presence1_presence
id: officeON
to: 'on'
- binary_sensor.presence1_presence
- trigger: state
entity_id:- binary_sensor.presence1_presence
for:
hours: 0
minutes: 5
seconds: 0
id: officeOFF
to: 'off'
conditions:
- binary_sensor.presence1_presence
- condition: trigger
id:- officeON
actions:
- officeON
- if:
- condition: trigger
id:- officeON
- condition: numeric_state
entity_id: sun.sun
attribute: elevation
below: -2
then: - type: turn_on
device_id: 8529c194724b0208717998e53adb7d1e
entity_id: 656b4eef6748cae4fbd932afab817da1
domain: light - type: turn_on
device_id: ae68870e0ec58c134fc0f71055ded800
entity_id: b3e61971702270e8dde42e35d0ec9ba8
domain: light
else: - type: turn_off
device_id: 8529c194724b0208717998e53adb7d1e
entity_id: 656b4eef6748cae4fbd932afab817da1
domain: light - type: turn_off
device_id: ae68870e0ec58c134fc0f71055ded800
entity_id: b3e61971702270e8dde42e35d0ec9ba8
domain: light
mode: single ```
- condition: trigger
conditions:
- condition: trigger
id:
- officeON
Get rid of this
you're stopping the automation from running when the trigger is not officeON
you don't want to duplicate the condition in conditions if you have it as part of an if statement
Well I dont understand what I did wrong, otherwise I would have fixed it 🙂
Do you understand now?
Oh well, never mind 🙂
I still dont see the problem @code-in-progress said to put it like that
I should not stop, it should pass to else and I would get my 5min timeout, but aparently not
Mine are set to "occupancy" and not "presence".
As @magic jetty said, you have a condition in there that prevents it. Remove the condition.
Right, oh well I give it 5mins 🙂
YAY
😍
It works great, but side note; I prolly should remake all my automations then
cuase I haz one -On/-Off for everything
Probably. 🙂
Great, feel inspired I will work on that
for example got some old 443 remotes, got one automation for each btn 😄
Feels like it could pass as or
amazing, have one of them 433 controllers with 8 buttons, had one automation for each now combined in 1 😄