originallyus / node-red-contrib-alexa-local

An easy-to-use NodeRED node for adding Alexa capability to NodeRED. NO Alexa Skills required.
106 stars 25 forks source link

For people wanting to get on/off and dimming function corrected for any dimming device here it is: #66

Open MattL0 opened 5 years ago

MattL0 commented 5 years ago

[{"id":"9f37aac0.e2c218","type":"debug","z":"e2ccb4ed.a4bb08","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":610,"y":40,"wires":[]},{"id":"17de273b.17f719","type":"mqtt out","z":"e2ccb4ed.a4bb08","name":"","topic":"AlexaMqtt/Bedroom/Lamp","qos":"2","retain":"","broker":"4c706bef.646df4","x":410,"y":40,"wires":[]},{"id":"cbb331d4.4f14d","type":"function","z":"e2ccb4ed.a4bb08","name":"payload","func":"var a = {payload :msg.bri };\nvar b = { payload:msg.on_off_command };\nvar c = { payload: msg.payload };\n \n\nif ( msg.on_off_command === true){\n return c;\n} else {\n return a ;\n}\n\n\n","outputs":1,"noerr":0,"x":240,"y":40,"wires":[["9f37aac0.e2c218","17de273b.17f719"]]},{"id":"76fe0583.6c7cbc","type":"alexa-local","z":"e2ccb4ed.a4bb08","devicename":"Bedroom lamp","inputtrigger":false,"x":100,"y":40,"wires":[["cbb331d4.4f14d"]]},{"id":"4c706bef.646df4","type":"mqtt-broker","z":"","name":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

MattL0 commented 5 years ago

For simple on/off device the node do not need any function added... since the payload is always on or off