Skip to content

Instantly share code, notes, and snippets.

@jrenggli
Last active November 20, 2018 12:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrenggli/dcb6893b4b6c317341e871f15d512c20 to your computer and use it in GitHub Desktop.
Save jrenggli/dcb6893b4b6c317341e871f15d512c20 to your computer and use it in GitHub Desktop.
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