|
1 | 1 | # homebridge-trigger |
| 2 | + |
2 | 3 | Homeridge Plugin for Automations Triggering |
3 | 4 |
|
4 | | -# Why? |
| 5 | +## Why |
| 6 | + |
5 | 7 | Devices within HomeKit newtwork can trigger actions - switches, motion and security sensors, thermostats. |
6 | 8 | These are value triggers including: power, brightness, contact, temperature, humidity, heating mode, battery level and so on. |
7 | 9 |
|
8 | | -Unfortunately custom values can not be used as triggers - "Turn the lights off then power consumption exceeds 100w". |
9 | | -But they can be used as trigger conditions! So you can make a rule like "Turn the lights off when temperature changes its value and power consumption exceeds 100w". |
| 10 | +Unfortunately custom values can not be used as triggers - "Turn the lights off when power consumption exceeds 100w". |
| 11 | +But they can be used as trigger conditions! So you can make a rule like "Turn the lights off when the temperature changes its value and power consumption exceeds 100w". |
10 | 12 |
|
11 | | -It lookes quite trashy and inreliable - if the temperature value does not change - the rule is not executed. |
| 13 | +It looks quite trashy and inreliable - if the temperature value does not change - the rule is not executed. |
| 14 | + |
| 15 | +## How |
12 | 16 |
|
13 | | -# How? |
14 | 17 | This is more like a hack to overcome the limitation of HomeKit not able to trigger actions on custom values. It works like that: |
| 18 | + |
15 | 19 | * Add a fake contact sensor that automatically triggers every n-seconds |
16 | 20 | * Make a rule "Turn the lights off when FakeTrigger changes state and power consumption exceeds 100w" |
17 | 21 |
|
18 | 22 | Lets set n to 60 seconds and HomeKit will run your rule every minute. |
19 | | -Now the cons. Need to check the impact on the iPhone's battery as it's the place where HomeKit lives (if you don't have an Apple TV). |
| 23 | + |
| 24 | +Now the cons. Need to check the impact on the iPhone's battery as it's where HomeKit lives (if you don't have an Apple TV). |
20 | 25 | Even with Apple TV not sure if it doesn't make you phone process the trigger every single time (hope it doesn't) |
| 26 | +Upd: after 3 months of usage I did not notice any battery lifetime change. |
| 27 | + |
| 28 | +## Configuration |
21 | 29 |
|
22 | | -# Configuration |
23 | 30 | Install homebridge-trigger plugin and add accessories to your config.json `accessories` section. Example: |
24 | | -``` |
25 | | -"accessories": [ |
| 31 | + |
| 32 | +```json |
| 33 | +"accessories": [ |
26 | 34 | { |
27 | 35 | "accessory": "FakeTrigger", |
28 | 36 | "name": "Trigger every 60 sec", |
|
0 commit comments