Comparing revisions for MoesZigbeeSceneButtons

Additions:
-- I couldn't get all the double press/hold options that the Tuya connection should get. They are supposed to allow for double presses and a HOLD for each button.
-- More options may be supported with Zigbee2Mqtt.
-- This setup was fine for what I wanted, but I did start playing with double press detection in Node Red... it wouldn't detect fast presses, but half a second apart I could do.
Top Left Button Pressed
Bottom Left Button Pressed
Top Right Button Pressed
Bottom Right Button Pressed
Top Right Button Held
-- Note that when held, and button is released, a different message is generated on release (I haven't listed those here, as I didn't need them)
Bottom Right Button Held
Deletions:
-- I couldn't get all the double press/hold options that the Tuya connection seems to get (based on the youtube vids I watched). They are supposed to allow for double presses and a HOLD for each button.
-- More options may be supported with Zigbee2Mqtt, or another zigbee setup.
-- This setup was fine for what I wanted, but I did start playing with double press detection in Node Red... it wouldn't detect fast presses, but half a second apart I could do. I might go back to it if I need doublepress.
{{image url="https://zorruno.com/wp-content/uploads/2021/10/PXL_20211010_142606573.jpg" title="Moes Scene Switch" alt="Moes Scene Switch"}}
{{image url="https://zorruno.com/wp-content/uploads/2021/10/PXL_20211010_132333838.jpg" title="Moes Scene Switch Mounted" alt="Moes Scene Switch Mounted"}}
**Top Left Button Pressed**
**Bottom Left Button Pressed**
**Top Right Button Pressed**
**Bottom Right Button Pressed**
**Top Right Button Held**
-- Note that when held, and button is released, a different message is generated on release (I haven't listed those here, as I didn't need them. Obviously designed for dimming control.)
**Bottom Right Button Held**
====Node Red Flow====
This could definitely be simplified futher with one function node, but it was a neater way of having 2 switches doing the same functions (and I could add more if needed). Also, if I figure out the double presses or move it to my Zigbee2MQTT setup, the changes will be fewer.
{{image url="https://zorruno.com/wp-content/uploads/2021/10/2021-10-10_15-48.png" title="Moes Scene Switch with Tasmota Zigbee Bridge Node Red Flow" alt="Moes Scene Switch with Tasmota Zigbee Bridge Node Red Flow"}}
[{"id":"fb73288b75d2f4a1","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"0370bab985570f71","type":"comment","z":"fb73288b75d2f4a1","name":"Scene Detect Button Presses from 2 Quad Switches","info":"","x":230,"y":240,"wires":[]},{"id":"d0777c18e77a6b3e","type":"mqtt in","z":"fb73288b75d2f4a1","name":"Quad Scene A Pressed","topic":"tele/tasmo-zigb-1/1234/SENSOR","qos":"1","datatype":"json","broker":"e28b763a.77bd98","nl":false,"rap":true,"rh":0,"x":140,"y":280,"wires":[["209a8ca7bd7b49ea"]]},{"id":"0d1ff70e74705b11","type":"function","z":"fb73288b75d2f4a1","name":"Convert to Button Press Value","func":"\nif ( msg.payload.Power == \"0\" ){\n msg.payload = \"bottomleft\" ;\n return [ msg ];\n }\n \nif ( msg.payload.Power == \"1\" ){\n msg.payload = \"topleft\" ;\n return [ msg ];\n }\n\nif ( msg.payload.DimmerStepUp == \"51\" ){\n msg.payload = \"topright\" ;\n return [ msg ];\n }\n \nif ( msg.payload.DimmerStepDown == \"51\" ){\n msg.payload = \"bottomright\" ;\n return [ msg ];\n }\n \nif ( msg.payload.DimmerMove == \"0\" ){\n msg.payload = \"toprighthold\" ;\n return [ msg ];\n }\n \nif ( msg.payload.DimmerMove == \"1\" ){\n msg.payload = \"bottomrighthold\" ;\n return [ msg ];\n }","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":280,"wires":[["a352ed9bbe5a9293"]]},{"id":"f180aa2689ae2cbc","type":"mqtt in","z":"fb73288b75d2f4a1","name":"Quad Scene B Pressed","topic":"tele/tasmo-zigb-1/4321/SENSOR","qos":"1","datatype":"json","broker":"e28b763a.77bd98","nl":false,"rap":true,"rh":0,"x":140,"y":340,"wires":[["c92f31eaa08f9d9d"]]},{"id":"209a8ca7bd7b49ea","type":"function","z":"fb73288b75d2f4a1","name":"Remove irrelevant JSON values","func":"\nmsg.payload = msg.payload.ZbReceived.Moes_Quad_Scene ;\nreturn [ msg ];\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":280,"wires":[["0d1ff70e74705b11"]]},{"id":"c92f31eaa08f9d9d","type":"function","z":"fb73288b75d2f4a1","name":"Remove irrelevant JSON values","func":"\nmsg.payload = msg.payload.ZbReceived.Moes_Quad_Scene_B ;\nreturn [ msg ];\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":340,"wires":[["0d1ff70e74705b11"]]},{"id":"a352ed9bbe5a9293","type":"switch","z":"fb73288b75d2f4a1","name":"Action for each 6 options","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"topleft","vt":"str"},{"t":"eq","v":"topright","vt":"str"},{"t":"eq","v":"bottomleft","vt":"str"},{"t":"eq","v":"bottomright","vt":"str"},{"t":"eq","v":"toprighthold","vt":"str"},{"t":"eq","v":"bottomrighthold","vt":"str"}],"checkall":"false","repair":false,"outputs":6,"x":950,"y":280,"wires":[[],[],[],[],[],[]]},{"id":"e28b763a.77bd98","type":"mqtt-broker","name":"MQTTBROKER","broker":"192.168.1.256","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki