Last active
November 20, 2018 12:47
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!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