Occupancy Blueprint

Hi @alexbabel, I have a Philips hue motion sensor. What is the recommended time delay for that? Because I’m still having the lights turning off while I’m still in the room with the default setting.

It looks like this for me.

I use an Aqara Door & Window sensor and a Philips hue sensor

It looks like you have a newer version of the blueprint. You have an extra input field named “motion sensor delay”. I have used the version from your GitHub. Can you share the updated blueprint?

Of course. I forgot that. Now the new version is on GitHub

1 Like

Thanks. I will try that one later today.

The problem is fixed with the latest version. Thanks mate!

1 Like

I’m going crazy, I finally got this. Thank you Alex.

2 Likes

This blueprint works so well in my bathroom and study, thanks for building it! :slightly_smiling_face:

Could the turn off delay be changed to accept an input number helper, to dynamically change the delay during the day?

Does the blueprint itself trigger the light to turn on or do I need a separate automation to turn them on?

Thanks! I’m absolutely brand new to HA and I managed to get this working using a Shelly Blu door sensor and Shelly motion sensor for my bathroom light.

I just set it up so we’ll see how it goes over the next few days!

Maybe you already sorted this out, but I set up another automation to based on the Occupancy Helper state.

For the trigger I selected Entity and then State. Then you can search for Occupancy Helper, and select “To:” ON.

Then you can continue with the rest of the automation you want for when the light is on.

Then set another automation to turn it off when the state changes to OFF. Maybe there is a way to do it with one automation, but I’m not smart.

Wow! This is among one of nicest occupancy automations I’ve seen.

But maybe it would be helpful to implement it more as a finite state machine to avoid any bugs?

Or perhaps even set this up as a Bayesian belief with

  • P(Wasp Inside | Wasp Detected): The probability that the wasp is inside given that it is detected. Likely to be high.
  • P(Wasp Inside | Box Closed, Prior Wasp Inside): The probability that the wasp is still inside given that the box was closed while the wasp was inside. Also high.
  • P(Wasp Inside | Wasp Not Moving, Box Closed): The probability that the wasp is inside given that it has stopped moving and the box is closed. The probability will decay exponentially as time since last movement increases.

Perhaps you can even incorporate a network of interconnected boxes with known distances and a prior number of wasps known, using movement in nearby rooms as evidence of the wasp’s escape… Kind-of like a Markov process…

1 Like

Hi, thanks a lot for the blueprint. I tried it and it works perfectly except for one situation. If I enter the room and leave the door open, it will turn off the light if I stop moving for some time or get out of sensor’s range.

I would like to always keep the light on if the door is opened. Only turn off the light, if the door is closed a no moevemnt inside is detected. How can I do that?

Working perfectly for me, thanks Alex. I knew what I wanted but couldn’t figure out the logic. I may need to upgrade to a sensor with a shorter timeout though as my IKEA one takes 20 seconds to clear and it’s easily possible to close the door and sit still within that time which makes the lights turn off.