-
Notifications
You must be signed in to change notification settings - Fork 18
/
Hue Flow mit rgb und Rückkanal.json
83 lines (83 loc) · 5.22 KB
/
Hue Flow mit rgb und Rückkanal.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
[
{
"id": "3280af50.0c2cc",
"type": "function",
"z": "d0bbe33a.4bc43",
"name": "Rückkanal on off mit Hex",
"func": "if (msg.payload.on === true ){msg.payload.on =1}else msg.payload.on=0; \nnode.send({payload:{\"id\":60,\"value\":msg.payload.on}})\nnode.send({payload:{\"id\":61,\"value\":msg.payload.brightness}})\nnode.send({payload:{\"id\":62,\"value\":msg.payload.colorTemp}})\nnode.send({payload:{\"id\":64,\"value\":msg.payload.rgb[0]}})\nnode.send({payload:{\"id\":65,\"value\":msg.payload.rgb[1]}})\nnode.send({payload:{\"id\":66,\"value\":msg.payload.rgb[2]}})\n\n\nif( msg.payload.hex){\n\nnode.send({payload: {\"id\":63,\"value\": parseInt(msg.payload.hex,16)}})}\n",
"outputs": 1,
"noerr": 0,
"x": 1150,
"y": 380,
"wires": [
[
"fae41ab.39e87e8"
]
]
},
{
"id": "e80a48fe.ac44a8",
"type": "switch",
"z": "d0bbe33a.4bc43",
"name": "",
"property": "payload.reachable",
"propertyType": "msg",
"rules": [
{
"t": "true"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 970,
"y": 380,
"wires": [
[
"3280af50.0c2cc"
]
]
},
{
"id": "fae41ab.39e87e8",
"type": "homeeDevice",
"z": "d0bbe33a.4bc43",
"virtual-homee": "",
"name": "Hue Strip Wohnen ",
"nodeId": "60",
"profile": "1002",
"icon": "",
"attributes": "[{\"id\":60,\"node_id\":60,\"instance\":0,\"minimum\":0,\"maximum\":1,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"\",\"step_value\":1,\"editable\":1,\"type\":1,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":61,\"node_id\":60,\"instance\":0,\"minimum\":0,\"maximum\":100,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"%25\",\"step_value\":1,\"editable\":1,\"type\":2,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":62,\"node_id\":60,\"instance\":0,\"minimum\":153,\"maximum\":500,\"current_value\":153,\"target_value\":0,\"last_value\":0,\"unit\":\"K\",\"step_value\":1,\"editable\":1,\"type\":42,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":63,\"node_id\":60,\"instance\":0,\"minimum\":0,\"maximum\":16777215,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"\",\"step_value\":1,\"editable\":1,\"type\":23,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"7001020%3B16419669%3B12026363%3B16525995\"},{\"id\":64,\"node_id\":60,\"instance\":1,\"minimum\":0,\"maximum\":255,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"RED\",\"step_value\":1,\"editable\":1,\"type\":2,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":65,\"node_id\":60,\"instance\":2,\"minimum\":0,\"maximum\":255,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"Green\",\"step_value\":1,\"editable\":1,\"type\":2,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":66,\"node_id\":60,\"instance\":3,\"minimum\":0,\"maximum\":255,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"BLUE\",\"step_value\":1,\"editable\":1,\"type\":2,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"}]",
"x": 150,
"y": 380,
"wires": [
[
"13ed7fe9.7e1d5"
]
]
},
{
"id": "13ed7fe9.7e1d5",
"type": "function",
"z": "d0bbe33a.4bc43",
"name": "RGB Funktion",
"func": "if (msg.payload.attributeId === 64){flow.set(\"red\",msg.payload.targetValue)}\nif (msg.payload.attributeId === 65){flow.set(\"green\",msg.payload.targetValue)}\nif (msg.payload.attributeId === 66){flow.set(\"blue\",msg.payload.targetValue)}\nvar red = flow.get(\"red\")||0;\nvar green = flow.get(\"green\")||0;\nvar blue = flow.get(\"blue\")||0;\nif (msg.payload.attributeId === 63){\n var ausgabe = Math.abs(msg.payload.targetValue).toString(16)\n node.send({payload:{\"hex\":ausgabe}});\n}\n\n\nif (msg.payload.attributeId === 60){node.send({payload:{\"on\":msg.payload.targetValue}})}\nif (msg.payload.attributeId === 61){node.send({payload:{\"brightness\":msg.payload.targetValue}})}\nif (msg.payload.attributeId === 62){node.send({payload:{\"colorTemp\":msg.payload.targetValue}})}\nif ((msg.payload.attributeId === 64)||(msg.payload.attributeId === 65)||(msg.payload.attributeId === 66)){node.send({payload:{rgb:{\"0\":red,\"1\":green,\"2\":blue}}})}",
"outputs": 1,
"noerr": 0,
"x": 420,
"y": 380,
"wires": [
[]
]
},
{
"id": "90388b42.f69038",
"type": "comment",
"z": "d0bbe33a.4bc43",
"name": "hier kommt das hue Magic Node Lampe hin",
"info": "",
"x": 690,
"y": 380,
"wires": []
}
]