Hue Labs - control scenes from Domoticz / homebridge
Posted: Tuesday 25 February 2020 19:38
Just in case any of you out there want to control Hue Labs scenes via Domoticz / homebridge-edomoticz, here’s a brill way to get all the info via Apple Shortcuts (hence this is posted in the iOS section)...
Install this Shortcut on your iOS device: https://routinehub.co/shortcut/4310
There’s also a link in there for a second shortcut to generate and retrieve your Hue API Key.
Once you’ve got the shortcut running, it should show you all the Hue Labs scenes on your Hue Bridge. Pick one, and from the submenu, hit up the CURL ON and CURL OFF buttons, which will give you the curl scripts you need to call.
Knock up a pair of bash scripts with the contents of each curl call...
scene ON will be along lines of:
and scene OFF will be along lines of:
(The JSON payload is all that changes... status: 1 or 0)
Save and chmod +x the pair of them, then use script:///home/pi/scene_on.sh for the On action of a Domoticz switch and script:///home/pi/scene_off.sh for the Off action.
homebridge should pick up the changes within 10 minutes of you adding the switch in Domoticz, and add the new switch to your HomeKit home’s default room automatically (if you’re running homebridge-edomoticz)
Install this Shortcut on your iOS device: https://routinehub.co/shortcut/4310
There’s also a link in there for a second shortcut to generate and retrieve your Hue API Key.
Once you’ve got the shortcut running, it should show you all the Hue Labs scenes on your Hue Bridge. Pick one, and from the submenu, hit up the CURL ON and CURL OFF buttons, which will give you the curl scripts you need to call.
Knock up a pair of bash scripts with the contents of each curl call...
scene ON will be along lines of:
Code: Select all
#!/bin/bash
curl --header "Content-Type: application/json" --request PUT --data '{"status":1}' http://<bridge-ip-address>/api/<api-key>/sensors/<int>/state
and scene OFF will be along lines of:
Code: Select all
#!/bin/bash
curl --header "Content-Type: application/json" --request PUT --data '{"status":0}' http://<bridge-ip-address>/api/<api-key>/sensors/<int>/state
Save and chmod +x the pair of them, then use script:///home/pi/scene_on.sh for the On action of a Domoticz switch and script:///home/pi/scene_off.sh for the Off action.
homebridge should pick up the changes within 10 minutes of you adding the switch in Domoticz, and add the new switch to your HomeKit home’s default room automatically (if you’re running homebridge-edomoticz)
