Skip to content
Snippets Groups Projects
Verified Commit fa5bea05 authored by Erick Hitter's avatar Erick Hitter
Browse files

Update README for latest configuration changes

parent 4425ae5c
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,7 @@ Yes. See https://ethtiter.com/ for a `systemd` service file. ...@@ -32,7 +32,7 @@ Yes. See https://ethtiter.com/ for a `systemd` service file.
**How is the `buttons` property of `config.json` structured?** **How is the `buttons` property of `config.json` structured?**
Each object within the `buttons` property is structured according to how the button should respond to the entity's current state. For example, if the light is off, what should a button press do. Each object within the `buttons` property is structured according what effect the click should have on an entity in its current state. For example, if the light is off, what should a single-click do.
"mac": { "mac": {
"mac": "mac", "mac": "mac",
...@@ -40,15 +40,17 @@ Each object within the `buttons` property is structured according to how the but ...@@ -40,15 +40,17 @@ Each object within the `buttons` property is structured according to how the but
"status": { "status": {
"entity_id": "switch.lamp" "entity_id": "switch.lamp"
}, },
"off": { "single": {
"entity": "switch", "on": {
"entity_id": "switch.lamp", "entity": "switch",
"entity_action": "turn_on" "entity_id": "switch.lamp",
}, "entity_action": "turn_off"
"on": { },
"entity": "switch", "off": {
"entity_id": "switch.lamp", "entity": "switch",
"entity_action": "turn_off" "entity_id": "switch.lamp",
"entity_action": "turn_on"
}
} }
} }
...@@ -60,21 +62,71 @@ The above example simply switches a light on and off, depending on its current s ...@@ -60,21 +62,71 @@ The above example simply switches a light on and off, depending on its current s
"status": { "status": {
"entity_id": "alarm_control_panel.shm" "entity_id": "alarm_control_panel.shm"
}, },
"disarmed": { "single": {
"entity": "alarm_control_panel", "disarmed": {
"entity_id": "alarm_control_panel.shm", "entity": "alarm_control_panel",
"entity_action": "alarm_arm_home" "entity_id": "alarm_control_panel.shm",
"entity_action": "alarm_arm_home"
},
"armed_home": {
"entity": "alarm_control_panel",
"entity_id": "alarm_control_panel.shm",
"entity_action": "alarm_disarm"
},
"armed_away": {
"entity": "switch",
"entity_id": "switch.lamp",
"entity_action": "turn_on"
}
}
}
In this example, if the alarm isn't active, or is set to the "armed home" state, its Flic button will toggle between those states. If, however, one tried to use the button to disable the alarm when no one is home (motion sensors are active, among other changes), the button will simply turn on a light; it won't disarm the alarm, as that's something I only allow for those who have access to Home Assistant or SmartThings directly.
As three click types--`single`, `double`, and `hold`--are supported, adding responses to the new click types is a matter of updating `config.json` to define how those clicks are handled.
"mac": {
"mac": "mac",
"label": "Lamp",
"status": {
"entity_id": "switch.lamp"
},
"single": {
"on": {
"entity": "switch",
"entity_id": "switch.lamp",
"entity_action": "turn_off"
},
"off": {
"entity": "switch",
"entity_id": "switch.lamp",
"entity_action": "turn_on"
}
}, },
"armed_home": { "double": {
"entity": "alarm_control_panel", "on": {
"entity_id": "alarm_control_panel.shm", "entity": "switch",
"entity_action": "alarm_disarm" "entity_id": "switch.lamp",
"entity_action": "turn_off"
},
"off": {
"entity": "switch",
"entity_id": "switch.lamp",
"entity_action": "turn_on"
}
}, },
"armed_away": { "hold": {
"entity": "switch", "on": {
"entity_id": "switch.lamp", "entity": "switch",
"entity_action": "turn_on" "entity_id": "switch.lamp",
"entity_action": "turn_off"
},
"off": {
"entity": "switch",
"entity_id": "switch.lamp",
"entity_action": "turn_on"
}
} }
} }
In this example, if the alarm isn't active, or is set to the "armed home" state, its Flic button will toggle between those states. If, however, one tried to use the button to disable the alarm when no one is home (motion sensors are active, among other changes), the button will simply turn on a light; it won't disarm the alarm, as that's something I only allow for those who have access to Home Assistant or SmartThings directly. This isn't a particularly interesting example, as all three click types perform the same action, but it demonstrates what's possible.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment