Hi,
I’m tying to use some Sonoff ZigBee switches with a Sonoff ZigBee bridge with Tasmota.
I flashed Tasmota in the brigde and I paired two Sonoff switches whit it. All works fine. When I press a switch I see in the bridge console the information coming from it.
My problem is: how can I distinguish the single switches in Node Red?
I try to explain what I mean.
I gave the two switches two “friendly names” for the two espresso machines I want to switch on with them (with the commands: “ZbName 0x85AE, Rancilio1” and “ZbName 0x2ABA, Rancilio2”).
Then I used a MQTT input node with the topic “ZbTasmota/tele/SENSOR”, a Json node and a debug node:
[{"id":"49159c60.270e1c","type":"mqtt in","z":"bca0d3e2.0e7bb8","name":"","topic":"ZbTasmota/tele/SENSOR","qos":"2","datatype":"json","broker":"b8ea3341.dc51","x":200,"y":130,"wires":[["e31d5195.a97f38","88da732e.96e978"]]},{"id":"e31d5195.a97f38","type":"json","z":"bca0d3e2.0e7bb8","name":"JSON","x":360,"y":210,"wires":[["8e3f7a6c.a76ad","84f6f1d8.26144","20ffd9e2.e7452e"]]},{"id":"20ffd9e2.e7452e","type":"debug","z":"bca0d3e2.0e7bb8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":620,"y":90,"wires":},{"id":"b8ea3341.dc51","type":"mqtt-broker","z":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""}]
When I press the Sonoff switch 1 in the debug windows I see
{"ZbReceived":{"0x85AE":{"Device":"0x85AE","Name":"Rancilio1","0006!02":"","Power":2,"Endpoint":1,"LinkQuality":107}}}
And when I press switch 2 I see:
{"ZbReceived":{"0x2ABA":{"Device":"0x2ABA","Name":"Rancilio2","0006!02":"","Power":2,"Endpoint":1,"LinkQuality":107}}}
How can I (with a function node or with a switch node e.g.) activate different devices or in other words how can I extract the “Name” of the Switches from the Json string?
Thank you!