Use state History to Simulate movement while away

Just had a thought. Is it possible to use the history of lights, tv etc. turning on and off. To replicate movement in the house via an automation while on holiday for example.

We are habitual creatures, so could be a good way to look like your home when you are not!

Or better yet. Randomise these action to fit in with regular patterns identified in entity history.

I like this idea… Watching.

You might be watching for a while! :rofl:

2 Likes

I guess one way you’d be able to do this is by doing a lot of history related sensors, and then automations to run some things based on those sensors.

For example, you can set up a history_stats sensor to count how long your living room light is on for, and then use that data to do a simple automation to switch the light on say at sunset and keep it on for the average duration based on your sensor data. Just repeat this for all other lights/whatever in your house and you’d be able to make it work.

In my house I have a sensor set up to count how many times the garage door has been opened and how long it’s been opened for each day (midnight to midnight).

- platform: history_stats
  name: Garage Door Open Count
  entity_id: binary_sensor.garage_door
  state: 'on'
  type: count
  start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
  end: '{{ now() }}'

This gives me a sensor with the following data:


Then I’ve also got a value template to give me the total time the garage door has been opened, and placed alongside the history sensor, I have this in my front end:

With enough history_stats sensors, and automations, you can do exactly what you want, but it will take a few automations.

1 Like