Occupancy simulation

I’ve done some searched but can’t really find anything about this;

A feature I now use a lot (on another platform) is occupancy simulation. So when no one at home my lights simulate presence/occupancy. This includes a patern when I go to ‘sleep’ like killig the lights downstairs then light on stairs goes on, light bathroom on, light bathroom off, master bedroom on etc. It includes a certain amount of randomness (so not all happens at fact the same time when you are on holiday)

Has anyone build something like this in HASS?

1 Like

I second this, it would be really nice to be able to put some randomness to light control. I already have automations that trigger window lights before sunset and automatically turns them of a certain time. But it would be nice to have some ± minutes to the rule as to make it harder for burglars to spot when I’m not at home.

This will shortly be possible in AppDamon. I am just finishing testing of code that allows randomized events - and I plan to write a generic App for occupancy simulation to go with it.

2 Likes

That sounds good! Let me know if I need to test anything.

I’ll be happy for you to test the App when I have it done :slight_smile:

In fact now is your chance to influence the design - what would you want from it?

My current plan would be the following:

  1. Downstairs lights on in the morning around usual wakeup time +/- some randomness, avoiding if it is already light
  2. Downstairs lights off when it gets light (light levels or sunrise offset)
  3. Downstairs lights on in the evening when it gets dark (light levels or sunrise offset)
  4. At a random “bedtime” lights off downstairs, bedroom lights on
  5. At a random “sleep” time bedroom lights off
1 Like

As the concept of apps is quite fresh I have some difficlties in visualizing how this app would work.

In an ideal scenario I would be able to set unlimited number of lights/devices with:

  • Device name (or groupname)
  • Start time
  • Randomness start time
  • End time
  • Randomness endtime
  • Sunrise offset
    optional;
  • Number of on/off in that time
  • max on time (example toilet could go on of 3 times in a night with max on time of 5 min each)

Ideally you could do this with unlimeted # of lights/switched but you could also max it to eg 10 (but not much less then 10 please , I have 3 floors with about 15 rooms in total)

The App would only run when vacation is on

Does it make sense?

Sounds like your needs are different to mine :wink: My life very structured and we tend to turn the same lights on at similar times every day then leave them on. Sounds like you want utter randomness in your life :slight_smile:

Should be easy enough though - maybe I write one App to do my structured thing then another to do the more random thing. I would probably use both anyway.

I will build it so it is open ended so you can have as many lights as you want and I’ll also make it work with individual devices, groups and scenes (I use scenes for everything).

I will try and get something done over the weekend.

Structure is gone with 3 kids in da house!

I figured that might be it :slight_smile:

Making progress on the simulator but its not ready for prime time yet - watch this space!

1 Like

@aimc not in any way want to rush you but curious how/if you are progressing on this one

I have a beta that I am testing - looking quite good so far! At the moment it does the fairly structured stuff I wanted but the next steps will be to tidy it up a little and add in a way of doing more random stuff. I’ll probably take a look at it tomorrow - today I was concentrating on getting a new release of AppDaemon out.

Another update - I have implemented the random functions and need to test for a day or two. Assuming that goes well I will need to write some docs then I should be able to release it. Should be available soon, look out for an announcement in the 3rd Party Apps forum.

2 Likes

@Tyfoon - It is done! Check out the announcement here.

@aimc wow! very impressive and great work! Its the first app i’m going to use so will have to figure out some stuff but this is a very good reason to do so!

Let me know if you need any help.

@aimc Still strugling a bit with basic Appdaemon setup but posted this in Q&A as this is a better place.

On this APP; How would you control if the App is actually active or is this obvious when it loads?

Depends what you mean by active. You should see a message saying that it has been loaded, then you can set whether or not it is actualldoing anything using an input_boolean per the readme file.

Sorry to reopen an old post, but I found this example to be really great and more detailed:
Presence simulation

2 Likes