forked from homeean/node-red-contrib-homee-flows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVelux_mit_Status_Rollershutter
116 lines (116 loc) · 3.71 KB
/
Velux_mit_Status_Rollershutter
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
[
{
"id": "d66c46af.89aa48",
"type": "homeeDevice",
"z": "d174baed.50e358",
"virtual-homee": "3cb0442.da4adbc",
"name": "Rollo Badezimmer",
"nodeId": "2050",
"profile": "2002",
"icon": "default",
"attributes": "[{\"id\":2052,\"node_id\":2050,\"instance\":0,\"minimum\":0,\"maximum\":100,\"current_value\":100,\"target_value\":100,\"last_value\":100,\"unit\":\"%25\",\"step_value\":1,\"editable\":1,\"type\":15,\"state\":1,\"last_changed\":1573237874,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":2054,\"node_id\":2050,\"instance\":0,\"minimum\":0,\"maximum\":4,\"current_value\":1,\"target_value\":1,\"last_value\":0,\"unit\":\"n%2Fa\",\"step_value\":1,\"editable\":1,\"type\":135,\"state\":1,\"last_changed\":1573237874,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"}]",
"x": 550,
"y": 180,
"wires": [
[
"e85e7586.0fb8e8"
]
]
},
{
"id": "886115ae.bd8d68",
"type": "ioBroker out",
"z": "d174baed.50e358",
"name": "target_position",
"topic": "velux.0.home.modules02.target_position",
"ack": "false",
"autoCreate": "false",
"x": 960,
"y": 180,
"wires": []
},
{
"id": "e85e7586.0fb8e8",
"type": "function",
"z": "d174baed.50e358",
"name": "",
"func": "var attri =msg.payload.attributeId;\nvar tava = msg.payload.targetValue;\nif (attri === 2054 && tava ===0){node.send({payload:100})}\nif (attri === 2054 && tava ===1){node.send({payload:0})}\nif (attri === 2052 && tava <= 80){node.send({payload:parseFloat((JSON.stringify(tava -100)).replace(\"-\",\"\"))})}\nif (attri === 2052 && tava >=80){node.send({payload:parseFloat((JSON.stringify(tava -100)).replace(\"-\",\"\"))})}",
"outputs": 1,
"noerr": 0,
"x": 750,
"y": 180,
"wires": [
[
"886115ae.bd8d68"
]
]
},
{
"id": "86bc61cd.7fa72",
"type": "ioBroker in",
"z": "d174baed.50e358",
"name": "current_position",
"topic": "velux.0.home.modules02.current_position",
"payloadType": "object",
"onlyack": "",
"func": "all",
"gap": "",
"x": 80,
"y": 180,
"wires": [
[
"7e678f7e.86dba"
]
]
},
{
"id": "cea65340.ba3a6",
"type": "function",
"z": "d174baed.50e358",
"name": "",
"func": "var val = parseFloat((JSON.stringify(msg.payload.val -100)).replace(\"-\",\"\"));\nnode.send({payload:{\"id\":2052 , \"value\": val}})\nif (val >=90){node.send({payload:{\"id\":2054 , \"value\": 1}})}\nif (val <= 90){node.send({payload:{\"id\":2054 , \"value\": 0}})}",
"outputs": 1,
"noerr": 0,
"x": 390,
"y": 180,
"wires": [
[
"d66c46af.89aa48"
]
]
},
{
"id": "8deb718c.54e3",
"type": "comment",
"z": "d174baed.50e358",
"name": "Als Objekt senden ",
"info": "",
"x": 100,
"y": 120,
"wires": []
},
{
"id": "7e678f7e.86dba",
"type": "rbe",
"z": "d174baed.50e358",
"name": "",
"func": "rbe",
"gap": "",
"start": "",
"inout": "out",
"property": "payload.val",
"x": 250,
"y": 180,
"wires": [
[
"cea65340.ba3a6"
]
]
},
{
"id": "3cb0442.da4adbc",
"type": "virtualHomee",
"z": "",
"name": "1234"
}
]