-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathphilipsHueSliderGroup.json
62 lines (62 loc) · 6.31 KB
/
philipsHueSliderGroup.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{ "name":"Hue Slider Group",
"manufacturer":"Philips",
"type":"AVRECEIVER",
"version":21,
"persistedvariables":{
"ToInitiate":true,
"HueBridgeIp":"",
"HueUserName":""
},
"discover":{
"welcomeheadertext":"Hue Driver",
"welcomedescription":"Warning ! Press the button on your Hue bridge before pressing next.",
"initcommandset":[
{"label":"", "type":"mDNS", "command":"", "queryresult":"$.[?(@property === \"name\" && @.match(/_hue/i))]^", "evalwrite":[{"variable":"HueBridgeIp","value":"DYNAMIK JSON.parse(\"$Result\").ip"}]},
{"type":"http-rest", "command":"{\"verb\":\"post\",\"call\":\"http://$HueBridgeIp/api\", \"message\":{\"devicetype\":\"meta\"}}", "queryresult":"$..success.username", "evalwrite":[{"variable":"HueUserName","value":"$Result"},{"variable":"ToInitiate","value":"DYNAMIK \"$HueUserName\" == \"undefined\""}], "evaldo":[{"test":"DYNAMIK !$ToInitiate","then":"__PERSIST", "or":""}]}
],
"command": {"type":"http-get", "command":"http://$HueBridgeIp/api/$HueUserName/groups/", "queryresult":["$.*~","$..name"]}
},
"template" : {
"dynamicname":"DYNAMIK_INST_START DYNAMIK \"Philips Hue by group \" + JSON.parse(\"$Result\")[1] DYNAMIK_INST_END",
"dynamicid":"DYNAMIK_INST_START DYNAMIK \"HueSliderGroup\" + JSON.parse(\"$Result\")[0] DYNAMIK_INST_END",
"variables":{
"HueBridgeIp":"$HueBridgeIp",
"HueUserName":"$HueUserName",
"LightNumber":"DYNAMIK_INST_START DYNAMIK JSON.parse(\"$Result\")[0] DYNAMIK_INST_END",
"Brightness":"",
"SavedBright":"",
"URLColor":"",
"Color":""
},
"listeners" : {
"HueStatus" : {"type":"http-get", "ishub":true, "command":"http://$HueBridgeIp/api/$HueUserName/groups/", "pooltime":"3000", "poolduration":"", "queryresult" : ["$.*~","$..action"],
"evalwrite" : [
{"variable" : "Brightness", "value" : "DYNAMIK JSON.parse(\"$Result\").find(elt => elt[0] == \"$LightNumber\")[1].on ? Math.round(JSON.parse(\"$Result\").find(elt => elt[0] == \"$LightNumber\")[1].bri/2.67 + 5) : 0"}
]
}
},
"images": {
"ColorStatus": {"label": "", "size": "large", "listen": "URLColor"}
},
"sliders":{
"BRIGHTNESS": {"label":"Brightness", "unit" : "Lux", "listen" : "Brightness", "evaldo":[{"test":true, "then":"__BRIGHTNESSCHANGE", "or":""}]}
},
"buttons":{
"POWER ON": {"label":"", "type":"static", "command":".", "evaldo":[{"test":true,"then":"__INITIALISE", "or":""}]},
"POWER OFF": {"label":"", "type":"static", "command":".", "evaldo":[{"test":true,"then":"__CLEANUP", "or":""}]},
"SWITCH ON": {"label":"", "type":"http-rest", "command":"{\"verb\":\"put\",\"call\":\"http://$HueBridgeIp/api/$HueUserName/groups/$LightNumber/action\", \"message\":{\"on\": true}}"},
"SWITCH OFF": {"label":"", "type":"http-rest", "command":"{\"verb\":\"put\",\"call\":\"http://$HueBridgeIp/api/$HueUserName/groups/$LightNumber/action\", \"message\":{\"on\": false}}"},
"CURSOR RIGHT": {"label":"", "type":"static", "command":"", "evalwrite":[{"variable":"Brightness","value":"DYNAMIK (Number($Brightness)<95)?Number($Brightness)+5:100"}], "evaldo":[{"test":true, "then":"__BRIGHTNESSCHANGE", "or":""}]},
"CURSOR LEFT": {"label":"", "type":"static", "command":"", "evalwrite":[{"variable":"Brightness","value":"DYNAMIK (Number($Brightness)>5)?Number($Brightness)-5:0"}], "evaldo":[{"test":true, "then":"__BRIGHTNESSCHANGE", "or":""}]},
"__BRIGHTNESSCHANGE": {"label":"", "type":"http-rest", "command":"DYNAMIK let mes = {\"on\": \"\"}; mes.on = $Brightness<6?false:true; if ($Brightness>5) {mes.bri = Math.round(2.67*($Brightness-5))}; let finMes = {\"verb\":\"put\",\"call\":\"http://$HueBridgeIp/api/$HueUserName/groups/$LightNumber/action\", \"message\":\"\"}; finMes.message = mes; finMes;"}
},
"directories":{
"Colors": {"label":"Color Picker", "feeders": {
"color":{"label":"", "commandset": [{"type":"static", "command": "[{\"color\":{\"hue\":25652,\"sat\":254, \"xy\": [ 0.674, 0.322 ], \"ct\":289}, \"imageurl\":\"https://raw.githubusercontent.com/jac459/NeeoHueDriver/master/Resources/Col_Red.jpg\"}, {\"color\":{\"hue\":7458,\"sat\":252, \"xy\": [ 0.5958, 0.3791 ], \"ct\":153}, \"imageurl\":\"https://raw.githubusercontent.com/jac459/NeeoHueDriver/master/Resources/Col_Orange.jpg\"}, {\"color\":{\"hue\":37458,\"sat\":149, \"xy\": [ 0.5158, 0.3721 ], \"ct\":235}, \"imageurl\":\"https://raw.githubusercontent.com/jac459/NeeoHueDriver/master/Resources/Col_Light_Orange.jpg\"}, {\"color\":{\"hue\":65511,\"sat\":43, \"xy\": [ 0.4302, 0.3675 ], \"ct\":322}, \"imageurl\":\"https://raw.githubusercontent.com/jac459/NeeoHueDriver/master/Resources/Col_Warm_White.jpg\"}, {\"color\":{\"hue\":34153,\"sat\":243, \"xy\": [ 0.3157, 0.33 ], \"ct\":156}, \"imageurl\":\"https://raw.githubusercontent.com/jac459/NeeoHueDriver/master/Resources/Col_Full_White.jpg\"}, {\"color\":{\"hue\":35616,\"sat\":238, \"xy\": [ 0.3016, 0.3005 ], \"ct\":153}, \"imageurl\":\"https://raw.githubusercontent.com/jac459/NeeoHueDriver/master/Resources/Col_Cold_White.jpg\"}, {\"color\":{\"hue\":25653,\"sat\":254, \"xy\": [ 0.4084, 0.5168 ], \"ct\":289}, \"imageurl\":\"https://raw.githubusercontent.com/jac459/NeeoHueDriver/master/Resources/Col_Green.jpg\"}, {\"color\":{\"hue\":43110,\"sat\":252, \"xy\": [ 0.2102, 0.1248 ], \"ct\":153}, \"imageurl\":\"https://raw.githubusercontent.com/jac459/NeeoHueDriver/master/Resources/Col_Light_Blue.jpg\"}, {\"color\":{\"hue\":46989,\"sat\":251, \"xy\": [ 0.1708, 0.0465 ], \"ct\":153}, \"imageurl\":\"https://raw.githubusercontent.com/jac459/NeeoHueDriver/master/Resources/Col_Deep_Blue.jpg\"}, {\"color\":{\"hue\":59221,\"sat\":253, \"xy\": [ 0.5005, 0.226 ], \"ct\":443}, \"imageurl\":\"https://raw.githubusercontent.com/jac459/NeeoHueDriver/master/Resources/Col_Pink.jpg\"}]",
"queryresult":"$.*", "itemtype": "tile", "itemaction":"colorSet", "itemUI":"", "itemimage":"DYNAMIK JSON.parse(\"$Result\").imageurl", "evalwrite":[{"variable":"Color","value":"DYNAMIK JSON.stringify(JSON.parse(\"$Result\").color)"}, {"variable":"URLColor","value":"DYNAMIK JSON.parse(\"$Result\").imageurl"}]}]},
"colorSet":{"label":"", "commandset": [{"type":"http-rest", "command":"{\"verb\":\"put\",\"call\":\"http://$HueBridgeIp/api/$HueUserName/groups/$LightNumber/action\", \"message\":$Color}"}]}
}
}
}
}
}