What's a rule
A rule is a string that has the format: "if this then that". The this part will be called the condition of the rule and the that part the actions of the rule.
- if its 10pm then turn the tv off
- if its friday and its 8am then turn the light on
- if (music is playing or the light is on) and somebody is present then turn the speaker on
- if temperature of living room is less than 15°C for 5 minutes then log "its getting cold"
The condition of a rule consists of one or more predicates. The predicates can be combined with "and", "or" and can be grouped by parentheses.
A predicate can have a "for" as a suffix like in "music is playing for 5 seconds" or "tv is on for 2 hours". If the predicate has a for-suffix then the rule action is only triggered, when the predicate stays true the given time. Predicates that represent one time events like "10pm" can't have a for-suffix because the condition can never hold.
Predicate for devices that have a state like switches
- device is on|off
- device is switched on|off
- device is turned on|off
Predicates for presence sensors like a motion detector
- device is present
- device is not present
- device is absent
- device is opened
- device is closed
- _expression [==|<|>|<=|>=] expression
- $tempsetting < 42
- $device.attribute >= $someVar + 10
General Device attributes
Predicates for comparing device attributes like sensor value or other states.
- attribute of device is equal to value
- attribute of device equals value
- attribute of device is not value
- attribute of device is less than value
- attribute of device is lower than value
- attribute of device is greater than value
- attribute of device is higher than value
- temperature of temperature sensor 1 is lower than 15°C
- humidity of temperature sensor 1 is greater than 60%
Device attribute watchdog
Becomes true if an attribute was not update for a certain time.
- attribute of device was not updated for time
- temperature of temperature sensor 1 was not updated for 5 minutes
Provided by the cron-plugin
- its time
- its day time
- its day
- its 8am
- its 8:00
- its friday 10pm
- button text is pressed
- button button text is pressed
- watch tv button is pressed
- its suntime
- its suntime
- its time period before|after suntime
- its before|after suntime
where suntime is "sunrise", "sunset" or any other supported suntime event.
- its sunrise
- its sunset
- its before sunrise
- its after sunset
- its 30 minutes after sunrise
- its 2h before sunset
Actions for devices that can be turned on or off:
- switch [the] device on|off
- turn [the] device on|off
- switch on|off [the] device
- turn on|off [the] device
These actions support a for-Suffix to switch the device back to the state before after a certain time.
- turn tv on
- switch the light off
- switch the light on for 5 minutes
Actions dimmer devices.
- dim [the] device to value[%]
Actions for shutter/screen devices:
- lower [the] device [down]
- raise [the] device [up]
- move [the] device up|down
- stop [the] device
These actions support a for-Suffix to stop the shutter/screen from moving after a certain time.
- raise kitchen-screen
- lower kitchen-screen
- lower kitchen-screen for 5 seconds
- stop kitchen-screen
- set $varname to expression
- set $tempsetting to $tempsetting + 0.5
- send mail to: "address" subject:"subject" text:"text"
- push title:"title" message:"message" priority:1
Take a look at the developer documentation for how it works and how to implement your own predicates and actions.