#human presence detection - automation

1 messages · Page 1 of 1 (latest)

flint loom
#

You’d want to trigger on the Presense entity and then you could use the Illuminance for if it’s dark or not.

#

And “human” is a misnomer. It’s more like “living thing”. My dogs can set off my sensors.

dusky totem
#

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

flint loom
#

You could do that. Basically the Presence entity is just a binary_sensor. On if there’s “something” there, off otherwise.

dusky totem
#

Just trying to wrap my head around how to use it when its not numbers

flint loom
#

if Presence == on AND sun has set

dusky totem
#

it does not show me on/off but loads of diff states

flint loom
#

What does the Presence entity show when you look at its details?

dusky totem
#

And now the horror, I do click-point-automations

#

😄

flint loom
#

That’s fine.

#

That was just pseudo logic.

dusky totem
#

But it might be as you say

#

Prolly is

flint loom
#

It should be just a binary_sensor.

dusky totem
flint loom
#

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.

dusky totem
#

Or is it smarter todo_it with the built in luxthingy

#

Im old so low light comes early 😄

flint loom
#

Eh, not really because when the lights are on, the lux will likely be above your threshold.

dusky totem
#

right!

flint loom
#

So, you run the risk of the lights not coming on/staying on because the lux sensor is reporting what it sees.

dusky totem
#

I'll try and coble something togather, hang on

#

So no use with them breaththingys ?

flint loom
dusky totem
#

So the binary sensor is a sum of all the adjustments that can be made ?

flint loom
#

Yeah. It takes the variables and then determines if there is presence.

dusky totem
#

those are the sensors

flint loom
#

Yeah, they all basically wrap up into the Presence entity. if this > x and that > x then on etc.

dusky totem
#

So again your asumption was correct; just use the binary

flint loom
#

You can enable them (and should) to fine tune the detection. Otherwise it’ll be too excessive and triggering on pretty much anything.

dusky totem
#

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 ?

flint loom
#

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.

dusky totem
#

Right, I'm a complex simple person 🙂

flint loom
#

lol then just do 2 automations. No harm in that at all.

dusky totem
#

Noooo, one was said!

flint loom
#

Hahahaha. Do whatever works for you.

dusky totem
#

If it works, I'm happy

flint loom
#

I’m 10+ years into HA… so complex is my life. lol

dusky totem
#

Aotch

#

Thinking if that binary is from just being detected in the house from unifi

#

Nope, now I'm thinking out loud

flint loom
#

It shouldn’t be.

dusky totem
#

so that is basicly on ?

flint loom
#

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.

dusky totem
#

Home seams to be equal to on

flint loom
#

It’s all on/off under the covers. The device class determines what you “see”.

dusky totem
#

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

flint loom
#

You can. Did you add trigger ids to your triggers?

#

You use them in your if block.

dusky totem
#

Meh cant find the else 😄

#

Or its not available though clicking ?

dusky totem
#

Well I'm gonna try this, not as clean but I cant find the "else" option

#

nope. that failed

flint loom
#

You have to enable the Else.

#

There's a button for it in the IF block

dusky totem
#

I just find and or not

flint loom
dusky totem
#

HAHAH I found it 😄

#

damn I'm the man!

#

doh

#

think that will work ?

#

Else I just test it 😉

magic jetty
#

You probably don't want the same condition in the conditions area ("And if") and in the if/else.

dusky totem
#

Oh well, didnt work 😄

magic jetty
#

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

dusky totem
#

Well I dont get where I did wrong

#

nvm I just make 2 automations with helper

#

did work previously

dusky totem
#

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

fossil lodge
#

you might have to use the state "not_home" rather than "away" depending on your presence sensor

dusky totem
#

Oki!

#

thnx

#

those are the options given

fossil lodge
#

hmm then it should be fine

#

could you pull up the history of presence1 presence?

flint loom
#

Is your work a zone? If so, the to would probably be the zone name. Not sure what presence1 is though.

fossil lodge
#

isn't that just the entity name?

dusky totem
#

Oh sorry, was AFK

dusky totem
#

that is binary_sensor

#

it shows in history as away, I'll try set it as away

dusky totem
#

nope it didnt work

flint loom
#

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).

dusky totem
#

this is what it reports

flint loom
#

Yeah, that’s the translated state.

dusky totem
#

Still if I put in on/off in boxes; it changes to home/away

flint loom
#

And this is just a regular binary sensor? Can you show the entity info screen? Something seems off.

dusky totem
#

Well its one of them

magic jetty
#

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?

dusky totem
#

But basicly the binary is a sum of all imput if there is action or not

flint loom
#

Yeah, it’s set to “presence” instead of “occupancy”.

#

Or vice-versa. Can’t remember off the top of my head.

dusky totem
#

Well, how do I fix it 😄

magic jetty
#

Can you restate what the problem is

dusky totem
#

I can get it to turn on the desired lamp, but never turns off

magic jetty
#

Can you share the current yaml of the automation

dusky totem
#

Well I dont edit in yaml, see if I can find it

magic jetty
#

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.

dusky totem
#

Well then I have to do that for all sections

magic jetty
#

not for each individual item

#

up near the TRACES button

#

it will show the entire automation in yaml format

dusky totem
#

Might be this: ```id: '1729790449035'
alias: Office Lights Motion
description: ''
triggers:

  • trigger: state
    entity_id:
    • binary_sensor.presence1_presence
      id: officeON
      to: 'on'
  • trigger: state
    entity_id:
    • binary_sensor.presence1_presence
      for:
      hours: 0
      minutes: 5
      seconds: 0
      id: officeOFF
      to: 'off'
      conditions:
  • condition: trigger
    id:
    • officeON
      actions:
  • 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 ```
magic jetty
#
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

dusky totem
#

Well I dont understand what I did wrong, otherwise I would have fixed it 🙂

magic jetty
#

Do you understand now?

dusky totem
#

Oh well, never mind 🙂

#

I still dont see the problem @code-in-progress said to put it like that

flint loom
#

Oh, it's not a "problem". It's strictly frontend translation.

dusky totem
#

I should not stop, it should pass to else and I would get my 5min timeout, but aparently not

flint loom
#

Mine are set to "occupancy" and not "presence".

#

As @magic jetty said, you have a condition in there that prevents it. Remove the condition.

dusky totem
#

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

flint loom
#

Probably. 🙂

dusky totem
#

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

dusky totem
#

amazing, have one of them 433 controllers with 8 buttons, had one automation for each now combined in 1 😄