# Zigbee switch not working

**URL:** <https://discourse.nodered.org/t/zigbee-switch-not-working/52601>\
**Category:** Hardware\
**Created:** [23 October 2021 07:35 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601 "2021-10-23T07:35:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![myhobby2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myhobby2/32/49836_2.png) [@myhobby2](https://discourse.nodered.org/u/myhobby2)\
**Post date:** [23 October 2021 07:35 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/1 "2021-10-23T07:35:31Z")

</div>

Although I've read the post below, I still have a non working situation.

[https://discourse.nodered.org/t/howto-set-a-zigbee-switch/45227/2](https://discourse.nodered.org/t/howto-set-a-zigbee-switch/45227/2)

I installed MQTTexplorer and this is what I see

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/9/f9b5927e5ab9a3f061a109b11acca62b17e49032.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/7/67276944d9061f08fb10237c0905a0350627422f.png)

My goal is to have the switches working in HA without the zigbee2MQTT addon.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [23 October 2021 08:13 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/2 "2021-10-23T08:13:08Z")

</div>

I don't know about HA (few here do) but if you configure an MQTT In node with that topic you will instantly have access to the data.  
I am on my phone so have not looked at your flow.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [23 October 2021 09:13 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/3 "2021-10-23T09:13:06Z")

</div>

Unfortunately your flow is not importable. In order to make flow importable it is important to surround your code with three backticks  
`````  
`like this`  
`````

When pasting the flow you can use the `</>` button to add the backticks.  
You can edit and correct your post by clicking the pencil icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [23 October 2021 09:20 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/4 "2021-10-23T09:20:09Z")

</div>

Looking at the text of the flow you posted, even though it is not importable, I see that you are sending data to the mqtt topic `cmnd/home/ZbSend`, I thought you were trying to get the current state from the switch.

Can you post a link to the docs describing what you have to send to that switch to control it?  
Also are you able to see control the switch by any other means?

---

<div class="post-metadata">

**Author:** ![myhobby2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myhobby2/32/49836_2.png) [@myhobby2](https://discourse.nodered.org/u/myhobby2)\
**Post date:** [23 October 2021 10:44 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/5 "2021-10-23T10:44:01Z")

</div>

```auto
[{"id":"434ba335.1c8b7c","type":"tab","label":"Zigbee","disabled":false,"info":""},{"id":"41e6870f.95be88","type":"mqtt out","z":"434ba335.1c8b7c","name":"TestZigbee","topic":"","qos":"2","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"fdf8e6cc.83733","x":510,"y":440,"wires":[]},{"id":"1338adea.a0c8d2","type":"inject","z":"434ba335.1c8b7c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"cmnd/home/ZbSend","payload":"{\"device\":\"light.sonoff_01minizb_62b7e9fe_on_off\",\"send\":{\"Power\":\"Toggle\"}}","payloadType":"json","x":170,"y":440,"wires":[["41e6870f.95be88","6d573cbe.79f4d4"]]},{"id":"6d573cbe.79f4d4","type":"debug","z":"434ba335.1c8b7c","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":310,"y":340,"wires":[]},{"id":"fdf8e6cc.83733","type":"mqtt-broker","name":"MQTT","broker":"core-mosquitto","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]

```

---

<div class="post-metadata">

**Author:** ![myhobby2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myhobby2/32/49836_2.png) [@myhobby2](https://discourse.nodered.org/u/myhobby2)\
**Post date:** [23 October 2021 10:49 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/6 "2021-10-23T10:49:08Z")

</div>

> [@myhobby2](#):
>
> [Howto set a Zigbee switch - #2 by edje11](https://discourse.nodered.org/t/howto-set-a-zigbee-switch/45227/2)

I used the info as discussed in the link a the top of this post and I want to control the zigbee switch (on/off) based on the provided input. I can control the switch manually in HA (so it is connected and working).

Meanwhile I used the tip to correct my flow 😉

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [23 October 2021 10:59 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/7 "2021-10-23T10:59:24Z")

</div>

I'm using

```auto
Program Version	9.5.0(zbbridge)
Build Date & Time	2021-06-17T08:27:09
Core/SDK Version	2_7_4_9/2.2.2-dev(38a443e)

```

it works for me.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [23 October 2021 11:08 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/8 "2021-10-23T11:08:49Z")

</div>

The topic you are using does not seem to be anything like the one in the post you linked to.

---

<div class="post-metadata">

**Author:** ![myhobby2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myhobby2/32/49836_2.png) [@myhobby2](https://discourse.nodered.org/u/myhobby2)\
**Post date:** [23 October 2021 11:17 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/9 "2021-10-23T11:17:34Z")

</div>

Communicating is always a tricky thing. In my situation I'm trying to switch on (or off) a zigbee device in my network via node-red. Maybe I'm too new to node-red to understand that my situation is different than I mentioned as a reference in my openings post. IF so, can someone explain the difference so I can learn 😉

---

<div class="post-metadata">

**Author:** ![myhobby2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myhobby2/32/49836_2.png) [@myhobby2](https://discourse.nodered.org/u/myhobby2)\
**Post date:** [23 October 2021 11:21 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/10 "2021-10-23T11:21:41Z")

</div>

> [@cflurin](#):
>
> `Program Version	9.5.0(zbbridge)`

I have the same firmware, but in ZHABridge mode. Is my issue that I need to reconfigure the sonoff to zbbridge mode ? And can you provide a simple example that I can try ?

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [23 October 2021 11:23 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/11 "2021-10-23T11:23:13Z")

</div>

> [@myhobby2](#):
>
> I have the same firmware

No, you have version 9.5.0.8

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [23 October 2021 11:27 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/12 "2021-10-23T11:27:43Z")

</div>

Your `inject node` seems to be ok, here an example I'm using:

```auto
	"topic": "cmnd/zigbeeBridge/ZbSend",
	"payload": "{"Device":"moesActuator","Send":{"Power":"Toggle"}}",
	"payloadType": "json",

```

---

<div class="post-metadata">

**Author:** ![myhobby2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myhobby2/32/49836_2.png) [@myhobby2](https://discourse.nodered.org/u/myhobby2)\
**Post date:** [23 October 2021 11:31 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/13 "2021-10-23T11:31:56Z")

</div>

So you are using this firmware ?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/0/10b96e350820c719dffe57837d752d1acc59f733.png)

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [23 October 2021 11:33 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/14 "2021-10-23T11:33:57Z")

</div>

Correct, actually there is a new `Tasmota v10.0.0 Norman`.

---

<div class="post-metadata">

**Author:** ![myhobby2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myhobby2/32/49836_2.png) [@myhobby2](https://discourse.nodered.org/u/myhobby2)\
**Post date:** [23 October 2021 11:50 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/15 "2021-10-23T11:50:06Z")

</div>

Just "downgraded" to 9.5.0

No improvement yet. Not sure what device name to use...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/8/1828de83831b1158b32beb2cbd2b656064fb442a.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/b/7bd7f94661e45f24199288acaa7ad6bd63ca818d.png)

Can you confirm that your Sonoff is in ZHA-bridge mode (or are you using a different mode?)

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [23 October 2021 12:11 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/16 "2021-10-23T12:11:19Z")

</div>

Module\_type:

 ![zigbeeBridge](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/8/985d50930d91a849052d5145979c046526a931ee.png)

---

<div class="post-metadata">

**Author:** ![myhobby2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myhobby2/32/49836_2.png) [@myhobby2](https://discourse.nodered.org/u/myhobby2)\
**Post date:** [23 October 2021 12:12 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/17 "2021-10-23T12:12:49Z")

</div>

thnx, will give it a try tonight 😉

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [23 October 2021 12:16 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/18 "2021-10-23T12:16:08Z")

</div>

To test your device you can also use the zigbee commands in the console.

[https://tasmota.github.io/docs/Commands/#zigbee](https://tasmota.github.io/docs/Commands/#zigbee)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [23 October 2021 12:27 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/19 "2021-10-23T12:27:19Z")

</div>

Moved to Hardware category as this is more about Tasmota than Node-RED. 🙂

---

<div class="post-metadata">

**Author:** ![myhobby2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myhobby2/32/49836_2.png) [@myhobby2](https://discourse.nodered.org/u/myhobby2)\
**Post date:** [24 October 2021 06:22 UTC](https://discourse.nodered.org/t/zigbee-switch-not-working/52601/20 "2021-10-24T06:22:52Z")

</div>

Thanks for your help again. I can confirm that it is working after I found the correct device name, based on the fact that I was able to determine my switch from this list (only device with an "off" indication)..

I'm still looking for a way to "find" the user-friendly name that I can use in Node-red, but that is a new question 😉

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/b/1ba9dfb9b129e68f9fb6e36988b98cc58bc01df2.png)

[Next page](https://discourse.nodered.org/t/zigbee-switch-not-working/52601.md?page=2)
