Simulates presence by playing back Item states from the default persistence from a number of days ago commanding the devices so they behave the same way, simulating presence.
Debug logging is available at the “Presence Sim” logger.
Switch Item which, when OFF, will trigger the simulator rule to run. OFF was chosen to make it easier to tie the rule to an Item that tracks presence.
Simulation Items Group
Group whose members are those Items that should be included in the presence simulation. All these Items must support commands (e.g. no Contact Items) and their states must be saved by the default persistence (e.g. no String Items if using rrd4j).
The number of days in the past to simulate the behavior from. It’s best to choose a multiple of 7 to correctly capture different behaviors between work days and weekends.
How many minutes between runs of the rule.
Language: Rules DSL
Persistence is installed and configured and the default persistence saves the states of the Items that are to be simulated.
adjusted for breaking change, will no longer work for versions of OH prior to December 15th
My occupation switch is sOccupied - it is a Switch Item. It is OFF when no-one is around.
Configuring this template and saving as a rule forces the comparison of sOccupied to true, for some reason, not ON. Is that intended? Screenshot below taken just after saving the rule for the first time, after having added the relevant Items during configuration.
It’s a rule template. Who cares what language it’s written in if you never have to even look at the code?
Anyway, I am usually pretty lax when it comes to somewhat highjacking a thread except in the Marketplace categories.
This thread is the Marketplace publication. The original post in this category is how the template appears in MainUI under Settings → Automation. It makes no sense to come along and post an alternative raw chunk of code in this type of thread because:
Very few users will ever see it. For most users all they will ever see is the first post in the thread because that’s all that’s shown in MainUI.
The replies in this thread should be strictly related to the Marketplace entry itself: requests for help and stuff like that. Adding alternative implementations and side topics makes it very difficult for users of the rule template to ask for and get the help they need. This become especially true when people come along and need help with your code, and not the code in the original post.
So not only is it bad for you because almost no one will find your post. It’s also bad for the original post because it makes it harder to support their offering.
So please either create a separate Marketplace entry for this or, if you don’t want to turn it into a rule template, please create a new thread in the Tutorials and Solutions category. It’s better for you and it’s better for the Marketplace.