7.0 release has the new Rules in HomeHabit Labs (enable in Settings).
This is an early release for Rules feature, so it is currently only configurable with Remote Admin and it isn’t possible to configure in the app UI yet.
What is Rules feature?
Rules feature allow to perform some UI actions based on certain conditions.
For example: turn on device screen when motion sensor is triggered, or change screen brightness using external dimmer device.
Available actions
- Turn screen on/off (
turn-on-screen
,turn-off-screen
)- screen turn off is based on the Android display timeout. For example, if display timeout is set to “after 1 minute of inactivity”, screen will turn off 1 minute after the rule condition is triggered.
- Stay Awake needs to be enabled in Settings for these rules to work
- Start/stop screensaver (
start-screensaver
,stop-screensaver
) - Set screen brightness (
set-screen-brightness
) - Set device volume (
set-volume
) - Show/hide camera (
show-camera
,hide-camera
) - Select dashboard (
select-dashboard
) - Speak a text message (
speak-text
) - Launch an app (
launch-app
) - Open URL in browser (
launch-browser
)
How to enable Rules?
- Go to Settings > HomeHabit Labs
- Enable Rules feature
- Restart the application
How to configure Rules
To configure Rule you need to have Remote Admin enabled in Settings and use any browser to open provided editor URL. The configuration is not streamlined yet, and requires editing JSON config.
Example configuration
{
...
"rules": {
"rule-id": {
"name": "Turn Screen ON",
"condition": {
"item": "y6e5q5u6vl921gamz284yt1gq.DemoSwitch#switch.state",
"operator": "eq",
"value": "on"
},
"action": {
"type": "turn-on-screen",
"binding": null,
"value": null
},
"enabled": true
}
},
...
}
Properties
-
id
- each rule should have an id key, any string value works -
name
- rule name -
condition
-
item
- reference to item attribute to use as a condition. Format is the same as for widget bindings, so it best to copy it from an existing widget if possible -
operator
- possible valueseq
(equals),changed
(any change) -
value
- comparison value for equals operator
-
-
action
-
type
- possible values listed above -
binding
- can be used as dynamic value for set brightness/volume actions -
value
- used as a value for launch app/browser actions
-
-
enabled
- flag to enable/disable this rule
Notes
- condition value for switches and binary sensors is currently
on/off
string