Skip to content

Latest commit

 

History

History
178 lines (131 loc) · 5.83 KB

rule_examples.rst

File metadata and controls

178 lines (131 loc) · 5.83 KB

Additional rule examples

Using the scheduler

../run/conf/rules/time_rule.py

Mirror openHAB events to a MQTT Broker

../run/conf/rules/openhab_to_mqtt_rule.py

Trigger an event when an item is constant

Get an even when the item is constant for 5 and for 10 seconds.

Turn something off after movement

Turn a device off 30 seconds after one of the movement sensors in a room signals movement.

Process Errors in Rules

This example shows how to create a rule with a function which will be called when any rule throws an error. The rule function then can push the error message to an openHAB item, use a notification service to send the error message to the mobile device or send an email with the error message. See Advanced Usage <advanced_usage> for more information about the available internal topics. It also uses the built in rate limiter <RATE_LIMITER> to limit the amount of notifications.