Presence Simulation

Ah, that is something else entirely.

There is nothing built in to openHAB to let you do that. However, I can think of a few ways to implement it.

The first way that comes to mind is to set up persistence so all your state changes are saved to the database. Also, put your Lights into a group (lets call it gLights for this example). Then have a rule that runs on a cron trigger, lets say every five minutes, that only does something if you are away. This rule will loop through all of the members of gLights and set its state to whatever it was set to 24 hours ago.

You can customize as desired.

rule "Simulate lights"
when
    Time cron "0 0/5 * * * ?"
then
    if(Presence.state != ON){
        gLights.members.forEach[light | light.sendCommand(light.historicState(now.minusHours(24)).state)]
    }
end

NOTE: I just typed this in. You might need to monkey around with the call to historicState to get the right value out of it. There are also surely some typos.

8 Likes