Hue Labs - control scenes from Domoticz / homebridge

Moderator: leecollings

Post Reply
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Hue Labs - control scenes from Domoticz / homebridge

Post by Marci »

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:

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
(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) 8-)
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests