-
Notifications
You must be signed in to change notification settings - Fork 18
/
Shellydimmer
1 lines (1 loc) · 5.11 KB
/
Shellydimmer
1
[{"id":"c414830.a778f8","type":"mqtt in","z":"c69e167a.226bc","name":"","topic":"shellies/shellydimmer-treppenlicht/light/0/power","qos":"2","datatype":"auto","broker":"ce968524.35f848","x":200,"y":200,"wires":[["842243c6.8df17"]]},{"id":"842243c6.8df17","type":"function","z":"c69e167a.226bc","name":"Filter power","func":"node.send({payload:{\"id\":682,\"value\":(Math.round(10*msg.payload))/10}})","outputs":1,"noerr":0,"x":610,"y":200,"wires":[["6eff167d.ce62b8"]]},{"id":"24cd8275.f7da56","type":"mqtt out","z":"c69e167a.226bc","name":"","topic":"shellies/shellydimmer-treppenlicht/light/0/set","qos":"2","retain":"","broker":"ce968524.35f848","x":1190,"y":180,"wires":[]},{"id":"cd10c879.b33db","type":"mqtt in","z":"c69e167a.226bc","name":"","topic":"shellies/shellydimmer-treppenlicht/light/0/energy","qos":"2","datatype":"auto","broker":"ce968524.35f848","x":200,"y":240,"wires":[["fec09f92.b6cbf"]]},{"id":"fec09f92.b6cbf","type":"function","z":"c69e167a.226bc","name":"Filter Energy","func":"/*var energy = (msg.payload/100000)\n\nnode.send({payload:{\"id\":683,\"value\":parseFloat(energy)}})\n*/\n\nnode.send({payload:{\"id\":683,\"value\":(Math.round(msg.payload))/100000}})\n","outputs":1,"noerr":0,"x":610,"y":240,"wires":[["6eff167d.ce62b8"]]},{"id":"f340c1b7.17c8a8","type":"function","z":"c69e167a.226bc","name":"","func":"if (msg.payload.attributeId === 680 && msg.payload.targetValue === 1){node.send({payload:{\"turn\":\"on\"}})}\nif (msg.payload.attributeId === 680 && msg.payload.targetValue === 0){node.send({payload:{\"turn\":\"off\",\"brightness\":0 }})}\n\nif (msg.payload.attributeId === 681 && msg.payload.targetValue >= 1){node.send({payload:{\"turn\":\"on\",\"brightness\":msg.payload.targetValue}})}\nif (msg.payload.attributeId === 681 && msg.payload.targetValue === 0){node.send({payload:{\"turn\":\"off\",\"brightness\":msg.payload.targetValue}})}\n","outputs":1,"noerr":0,"x":950,"y":180,"wires":[["24cd8275.f7da56"]]},{"id":"6eff167d.ce62b8","type":"homeeDevice","z":"c69e167a.226bc","virtual-homee":"de3d6408.f67bb8","name":"Treppenlicht","nodeId":"68","profile":"11","icon":"default","attributes":"[{\"id\":680,\"node_id\":68,\"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\":681,\"node_id\":68,\"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\":682,\"node_id\":68,\"instance\":0,\"minimum\":0,\"maximum\":3000,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"W\",\"step_value\":0.5,\"editable\":0,\"type\":3,\"state\":1,\"last_changed\":1572619585,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":683,\"node_id\":68,\"instance\":0,\"minimum\":0,\"maximum\":50000,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"kWh\",\"step_value\":1,\"editable\":0,\"type\":4,\"state\":1,\"last_changed\":1572807225,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"}]","x":810,"y":180,"wires":[["f340c1b7.17c8a8"]]},{"id":"6c10779a.0ad058","type":"mqtt in","z":"c69e167a.226bc","name":"","topic":"shellies/shellydimmer-treppenlicht/light/0","qos":"2","datatype":"auto","broker":"ce968524.35f848","x":180,"y":120,"wires":[["35db4b00.959d76"]]},{"id":"fdebaf00.b4ae18","type":"function","z":"c69e167a.226bc","name":"On/Off","func":"if (msg.payload === \"on\"){var status =1}\nif (msg.payload === \"off\"){var status =0}\n\nnode.send({payload:{\"id\":680,\"value\":status}})\nif (status === 0){node.send({payload:{\"id\":681,\"value\":0}})}","outputs":1,"noerr":0,"x":590,"y":120,"wires":[["6eff167d.ce62b8"]]},{"id":"35db4b00.959d76","type":"rbe","z":"c69e167a.226bc","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":470,"y":120,"wires":[["fdebaf00.b4ae18"]]},{"id":"92f16ea4.6907f","type":"mqtt in","z":"c69e167a.226bc","name":"","topic":"shellies/shellydimmer-treppenlicht/light/0/status","qos":"2","datatype":"auto","broker":"ce968524.35f848","x":200,"y":160,"wires":[["2ca3b537.35dc6a"]]},{"id":"2ca3b537.35dc6a","type":"json","z":"c69e167a.226bc","name":"","property":"payload","action":"","pretty":false,"x":470,"y":160,"wires":[["3f9c32ae.5496d6"]]},{"id":"3f9c32ae.5496d6","type":"function","z":"c69e167a.226bc","name":"","func":"if (msg.payload.ison === true){node.send({payload:{\"id\":681,\"value\":msg.payload.brightness}})}","outputs":1,"noerr":0,"x":590,"y":160,"wires":[["6eff167d.ce62b8"]]},{"id":"ce968524.35f848","type":"mqtt-broker","z":"","name":"MQTT Raspi (Pi3 - 150)","broker":"10.1.103.150","port":"1883","clientid":"NanoPi NodeRed","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"de3d6408.f67bb8","type":"virtualHomee","z":"","name":"virtualHomee01"}]