Presence Simulation [5.2.0.0;5.9.9.9]

image

WARNING: Users who have this template already installed for versions of OH 5.1 and before, after removing the old template and installing this new one, open your rule(s), click on the code tab, and change the ruleTemplate property to ohrt-presenceSim before regenerating the rule.

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.

Parameter Type Purpose
Enable Simulation Switch Item 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 Item 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).
Num Days integer 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.
Minutes integer How many minutes between runs of the rule.

This rule template requires the openhab_rules_tools library to be installed. See openHAB Rules Tools Announcements for details. You can install it from openhabian-config and there is a rule template which may work for you to install it. See the announcements for all the ways to install this library.

Language: JS Scripting Scripting with openhab-js 5.18.2

Dependencies:

  • Persistence is installed and configured and the default persistence saves the states of the Items that are to be simulated.
  • openhab-js 5.18.2 or later
  • openhab_rules_tools 2.1.0 or later

Changelog

Version 1.1

  • Migrated to the YAML file format for OH 5.2
  • use wrapper
  • standardize logger names

Version 1.0

  • Updates to work with breaking changes in openhab-js 5.0.0. The template remains backwards compatible with openhab-js 4.1.0 forward.

Version 0.2

  • throws an exception if openhab-js or openhab_rules_tools is too old

Version 0.1

  • initial release

Sponsorship

If you want to send a tip my way or sponsor my work you can through Sponsor @rkoshak on GitHub or PayPal. It won’t change what I contribute to OH but it might keep me in coffee or let me buy hardware to test out new things.

Resources

https://github.com/rkoshak/openhab-rules-tools/raw/refs/heads/main/marketplace-templates/ohrt-presenseSim.yaml

A post was merged into an existing topic: Marketplace Versioning Issues

19 posts were split to a new topic: Marketplace Versioning Issues

A post was merged into an existing topic: Marketplace Versioning Issues