Home Home Automation Zemismart Zigbee switch

Zemismart Zigbee switch

Zigbee is getting more attention

Good home automation is about tailoring solutions to individual needs. This rings true for lights. A smart bulb might be the easiest option, but often far from perfect. In my previous article, I focused on wall switches, this time around I want to talk about reusing existing lights and wall switches thanks to a simple Zemismart Zigbee switch. What sets it apart from Sonoff Mini (review), Shelly 1 (review) and this unbranded one (review) – is the ZigBee protocol.

Going ZigBee – a smart move?

In case you didn’t get the memo, Apple and Google joined the ZigBee alliance, indicating the direction in which home automation will continue moving forward. For once, I’m glad as thanks to a unified protocol, mixing and matching hardware becomes easier. ZigBee protocol is still fragmented, but given enough time, a unified API should emerge and devices made by various brands would become more compatible with each other.

Zemismart seems to be ahead of that thinking. They sent me a couple of Zemismart Zigbee switches (ZW-EU-02) that are made for 2 gang lights and wall switches. While designed for the likes of SmartThings, compatible with Tuya ZigBee kit (review), these will fit very nicely into my ZigBee2MQTT enabled, NodeRED based, home automation server.

Enclosed in a plastic shell, Zemismart Zigbee switch is slightly bigger than Sonoff Mini, measuring 55x50x22mm. It requires Live & Neutral wire to work, therefore ceiling fitting would be a preferred place to mount it at. Wiring is straight forward, as long as you remember that switch connectors use 3.3V logic (don’t use mains) and they are listed in GND, S2, S1 order (left to right). The device is rated for 300W which isn’t enough to run a decent PC, but these switches are for lights and if you are packing more than 300W per gang, you have bigger problems!

Please be careful with these switches. The mains terminal screws are exposed and it’s possible to get an electric shock while handling these. I remedied this with a piece of electrical tape to cover up the screws, but only after I got shocked on a live stream.

The switch could use one more terminal for neutral wire, otherwise wago-styled clips must be used to connect all wires inside the ceiling fitting.

On the inside

A bit of digging inside reveals an EFR32 Gecko IC responsible for handing ZigBee signals. Unfortunately due to module design, I had to desolder the connectivity board to take a peek inside. Don’t recommend doing that, as pads are fragile. 11 Pins are exposed and additional 4 dev pads are present to talk to the chipset itself. EFR32 serves also as a router in ZigBee mesh so it’s a great device to expand the network even more. This is the same chip that had been used on Sonoff ZigBee Bridge (review), that had been recently hacked with Tasmota (hacking guide).

Tuya and eWeLink?

Fortunately, no hardware hacking is needed. Zemismart Zigbee switch pairs instantly (hold 2 buttons for 10 sec) with Tuya Zigbee hub (review), but what’s even more interesting, I was able to pair it with eWeLink and Sonoff ZigBee Bridge – I also know why! A 2 gang switch with ZigBee protocol will launch soon! Unfortunately, Zemismart Zigbee switch isn’t playing nice with Sonoff just yet!

Tuya

Tuya app works flawlessly and the switch indeed shows up correctly as a 2 gang wall switch. It’s responsive and it comes with all associated bells and whistles or the app. These bells include integrations with Google Assistant and Alexa ecosystems, timers and schedules and Tuya’s automation panel. Just rename the individual gangs so you can use these correctly with smart speakers.

Advanced options in the app allow to group individual gangs with other lights sources. It’s a great add on if you have more than 2 lights in the room. You can trigger selected lights with a physical switch rather than a scene.

Make it mine!

The next step was to connect Zemismart Zigbee switch with NodeRED running Zigbee2MQTT. This is where I run into the first snag. The switch was not supported by default. I had to refer to my writeup on how to add unsupported devices to Zigbee2MQTT. If you want to follow the process, take a look this live stream, or read the guide linked above and add the following device to your devices.js file:

{
    zigbeeModel: ['LXN59-2S7LX1.0'], 
    model: 'LXN59-2S7LX1.0', 
    vendor: 'BENEXMART', 
    description: '2 gang switch netural, 3.3V switch logic', 
    supports: 'ON/OFF, 2 GANG',
    fromZigbee: [fz.on_off],
        toZigbee: [tz.on_off],
        endpoint: (device) => {
            return {'left': 1, 'right': 2};
        },
        meta: {configureKey: 3, multiEndpoint: true},
        configure: async (device, coordinatorEndpoint) => {
            await bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
            await bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
        },
 },

After sudo systemctl stop|start zigbee2mqtt you will see the correct payloads flooding in. After listening to zigbee2mqtt/device_name you will notice payload looking like this:

{"state_left":"OFF","linkquality":102,"state_right":"ON"}

Both gangs are listed as state_lx – note this as to control the switch you will need to use the following command structure:

// get current state
topic: zigbee2mqtt/device_name/get
payload: {"state": ""}  

//control relay 1  (ON)
topic: zigbee2mqtt/switch2/left/set
payload: {"state_left": "ON"}

//control relay l2  (OFF)
topic: zigbee2mqtt/switch2/right/set
payload: {"state_right": "OFF"}

That’s simple enough. If you want to link the switch with Alexa and Google Assistant, I would recommend you Alexa integration and Google Assistant integration articles. If you want to try the sample flow – use the JSON below. Just remember to edit your ZigBee2MQTT device!

Sample NodeRED flow
[{"id":"782bb442.2ddf7c","type":"group","z":"cc6a049c.54ef68","name":"Control","style":{"stroke":"#ffC000","fill":"#ffdf7f","label":true,"label-position":"n","color":"#000000"},"nodes":["21810bd5.4a9064","a1fbdbe1.0de008","763270c3.b8a4f","656d2285.5919bc","85194b53.99ea08"],"x":165,"y":290,"w":670,"h":240},{"id":"21810bd5.4a9064","type":"mqtt out","z":"cc6a049c.54ef68","g":"782bb442.2ddf7c","name":"Zemismart Zigbee Switch","topic":"","qos":"","retain":"","broker":"6e117ba5.8026e4","x":690,"y":400,"wires":[]},{"id":"a1fbdbe1.0de008","type":"inject","z":"cc6a049c.54ef68","g":"782bb442.2ddf7c","name":"Gang one (on)","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"zigbee2mqtt/switch2/left/set","payload":"{ \"state_left\": \"ON\"}","payloadType":"json","x":290,"y":340,"wires":[["21810bd5.4a9064"]]},{"id":"763270c3.b8a4f","type":"inject","z":"cc6a049c.54ef68","g":"782bb442.2ddf7c","name":"Gang one (off)","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"zigbee2mqtt/switch2/left/set","payload":"{ \"state_left\": \"OFF\"}","payloadType":"json","x":290,"y":380,"wires":[["21810bd5.4a9064"]]},{"id":"656d2285.5919bc","type":"inject","z":"cc6a049c.54ef68","g":"782bb442.2ddf7c","name":"Gang two (on)","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"zigbee2mqtt/switch2/right/set","payload":"{ \"state_right\": \"ON\"}","payloadType":"json","x":290,"y":440,"wires":[["21810bd5.4a9064"]]},{"id":"85194b53.99ea08","type":"inject","z":"cc6a049c.54ef68","g":"782bb442.2ddf7c","name":"Gang two (off)","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"zigbee2mqtt/switch2/right/set","payload":"{ \"state_right\": \"OFF\"}","payloadType":"json","x":290,"y":480,"wires":[["21810bd5.4a9064"]]},{"id":"6e117ba5.8026e4","type":"mqtt-broker","z":"","name":"MQTT","broker":"automation.local","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"df690484.e3a6d8","type":"group","z":"cc6a049c.54ef68","name":"State","style":{"stroke":"#777777","fill":"#c8e7a7","label":true,"label-position":"n","color":"#000000"},"nodes":["5f87a69e.04b778","d80b8b48.f407d8","2f67f6e7.784efa","2f0e2bbd.5d3144"],"x":165,"y":90,"w":630,"h":160},{"id":"5f87a69e.04b778","type":"mqtt in","z":"cc6a049c.54ef68","g":"df690484.e3a6d8","name":"Zemismart Zigbee Switch","topic":"zigbee2mqtt/switch2","qos":"2","datatype":"json","broker":"6e117ba5.8026e4","x":310,"y":140,"wires":[["2f67f6e7.784efa"]]},{"id":"d80b8b48.f407d8","type":"inject","z":"cc6a049c.54ef68","g":"df690484.e3a6d8","name":"Get State","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"zigbee2mqtt/switch2/get","payload":"{   \"state\": \"\" }","payloadType":"json","x":280,"y":200,"wires":[["2f0e2bbd.5d3144"]]},{"id":"2f67f6e7.784efa","type":"debug","z":"cc6a049c.54ef68","g":"df690484.e3a6d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":610,"y":140,"wires":[]},{"id":"2f0e2bbd.5d3144","type":"mqtt out","z":"cc6a049c.54ef68","g":"df690484.e3a6d8","name":"Zemismart Zigbee Switch","topic":"","qos":"","retain":"","broker":"6e117ba5.8026e4","x":650,"y":200,"wires":[]}]

Buy Zemismart ZigBee switch

Buy it using these links to support NotEnoughTech.

Final thoughts

Other than the shockingly short shrouds around terminals, I don’t see any problems with Zemismart Zigbee switches. Secure the terminals to get extra assurance and you can bag yourself fairly inexpensive ZigBee switches. You can grab these on AliExpress for around $13-15. There isn’t much competition in this field just yet. I’m awaiting my Sonoff Mini ZigBee edition – I will be posting soon about it as well! Let me know what do you think about these in this Reddit thread.

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated in style with crypto-currency

Smart Ideas with

Automate your space in with these ecosystems and integrate it with other automation services

Learn NodeRED

NodeRED for beginners: 1. Why do you need a NodeRED server?

0
To server or not to server? That's a very silly question!

Best Automation Projects

ESP8266 WIFI lights under $5

0
Your Sonoff device can't do this!

Free wireless doorbell (Amazon Dash button hack)

0
The most terrifying situation I can imagine* is missing a parcel

New Amazon Dash Buttons

0
You can teach new buttons old tricks!

ESP8266 ceiling light – demo

0
Testing the ESP8266 as a WIFI light controller

Try Tasker and Raspberry Pi for your home automation needs!

0
Raspberry Pi can help you with your Tasker profiles

Smart Home

Testing 9 external antennas with CC2531 ZigBee coordinator

0
I have tested the range and the link quality of 9 external antennas with CC2531!

I have infinite buttons thanks to Aqara Opple

0
Gaming on Switch meets IoT - can you play games on Aqara Opple? Apparently you can! This and more uses of the connected wall switch

Smart lights won’t save you money

0
It's pretty clear how much power a smart light draws when turned on, but have you ever wonder how much do you pay to have it connected 24/7?

Alexa Routines: Setting volume on all Echos at once

0
Setting volumes on all Amazon Echo devices at once doesn't have to be a chore!

If Edison made smart lights: OEEONE ZigBee lightbulb

0
OEEONE ZigBee lightbulb may look vintage, but packs the latest ZigBee protocol