OH3: gcal-persistence for presence simulation

I was using the gcal-persistence for presence simulation.
In OH3 there is no need for gcal as persistence layer anymore. But is there a template for setting up a similar presence simulation - 1 switch to have the presence simulation, 1 offset parameter: 14 days(?) 1 group to attach the relevant elements to, and a script to read the data from the persistence layer.


1 Like

There was no need to use gcal in 2.5 either. The following has worked since OH 1.x.

Set up persistence on the Items you want to simulate presence with.
Create a rule that runs every minute, or every five minutes, or how ever often you want it to run. If using MainUI, add a “but only if…” to only run the rule when your simulation Item is ON.

In the rule, loop through the simulation Items and getHistoricState on the Item seven days ago and if it’s different from the current state, command the Item with that historic state.

1 Like