Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Toggle Philips Hue Lights with Homematic Script. Credits: https://www.technikkram.net/2017/04/philips-hue-per-homematic-steuern
!Hue Lampe ein-/ausschalten
!------------------------------
!__IP Adresse der Hue Bridge
string ip_address = "192.168.2.172";
!__User ID in der Bridge
string api_key="9YqN4igBFdRpXo8kw3lhzzNIzPXFFSoJSn6488bV";
!__Auswahl der Lampe
string lamp ="1";
!__Farbeinstellungen
string reqdata_on="{\"on\":true, \"sat\":254, \"bri\":254,\"hue\":10000}";
string reqdata_off="{\"on\":false}";
!------ NICHT MODIFIZIEREN-------
string request="/usr/local/addons/cuxd/curl -s -X GET -H \"Content-Type: application/json\" http://" # ip_address # "/api/" # api_key # "/lights/" # lamp # " | grep -o '\"on\":true' && /usr/local/addons/cuxd/curl -X PUT -H \"Content-Type: application/json\" -d '" # reqdata_off # "' http://" # ip_address # "/api/" # api_key # "/lights/" # lamp # "/state || /usr/local/addons/cuxd/curl -X PUT -H \"Content-Type: application/json\" -d '" # reqdata_on # "' http://" # ip_address # "/api/" # api_key # "/lights/" # lamp # "/state";
dom.GetObject("CUxD.CUX2801001:1.CMD_EXEC").State(request);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment