A custom firmware for Tuya telink based switch module. Code is based on pvvx's ZigbeeTLc firmware, huge thanks!
Note that rebranded versions may have different internals and may not work. "Zigbee Manufacturer" is the most reliable identifier of the device.
Z2M device name | Vendor name | Zigbee Manufacturer | Type | Status | Issue |
---|---|---|---|---|---|
TS0012_switch_module | GIRIER TS0012, OXT | _TZ3000_jl7qyupf | router / end_device | Supported | - |
WHD02 | No-name 1 gang switch | _TZ3000_skueekg3 | router | Supported | - |
TS0002_basic | OXT TS0001, probably other rebrands | _TZ3000_01gpyda5 | router | Supported | link |
TS0011_switch_module | GIRIER TS0011, OXT TS0011 | _TZ3000_ji4araar | router / end_device | Supported | link |
TS0001_switch_module | OXT TS0001, probably other rebrands | _TZ3000_tqlv4ug4 | router | Supported | link |
TS0002_basic | GIRIER 2 Gang | _TZ3000_zmy4lslw | router | Supported | link |
TS0001_switch_module | Avatto TS0001 | _TZ3000_4rbqgcuv | router | Supported | link |
TS0002_limited | Avatto TS0002 | _TZ3000_mtnpt6ws | router | Supported | link |
TS0004_switch_module_2 | Avatto TS0004 | _TZ3000_5ajpkyq6 | router | Supported | link |
TS0012 | Moes TS0012 (2 gang switch) | _TZ3000_18ejxno0 | router / end_device | Supported | link |
TS0012 | Bseed TS0012 (2 gang switch) | _TZ3000_f2slq5pj | router / end_device | Supported | link |
LZWSM16-2 | Avatto TS0012 | _TZ3000_ljhbw1c9 | router / end_device | Supported | link |
WHD02 | Aubess WHD02 | _TZ3000_46t1rvdu | router / end_device | Supported | link |
ZS-EUB_1gang | Moes TS0011 (1 gang switch) | _TZ3000_hhiodade | router / end_device | Supported | link |
TS0013 | Moes TS0013 (3 gang switch) | _TZ3000_qewo8dlz | router / end_device | Supported | link |
TS0012 | Internet search says this is Zemismart 2 gang switch, needs confirmation | _TZ3000_zmlunnhy | router / end_device | In progress | link |
TS0011 | Avatto TS0011 | _TZ3000_hbxsdd6k | router / end_device | Supported | link |
TS0003 | Moes MS-104CZ | _TZ3000_pfc7i3kt | router | Supported | - |
ZB08 | Girier-ZB08 | _TZ3000_ypgri8yz | router / end_device | Supported | link |
TS0004_switch_module | Avatto 4 gang switch module with N | _TZ3000_ltt60asa | router | WIP, SUPPORT NOT CONFIRMED YET! | link |
If you device is not supported, but it is some Tuya switch module, please check the porting guide.
The main driver for this project was the following factory firmware bug: if one button is pressed, the device ignores clicks to other buttons for ~0.5 seconds. The most frustrating consequence is that pressing both buttons at the same time turns only one relay on.
- Detached mode, e.g. switch doesn't trigger relay but only generates events via Zigbee
- Long press for momentary switches with configurable duration
- Router/EndDevice modes for no-neutral devices
- Super fast reaction time (compared to the factory firmware)
- 5 quick presses to reset the device
- Power-on behavior
- Switch modes ON_OFF/OFF_ON/TOGGLE allowing to synchonize switch position with relay state
Only on linux:
make install
make
Firmware can be flashed via OTA. If you still use zigbee2mqtt 1.x, use this guide
To switch between End Device and Router follow this guide
To flash via wire, follow this guide
- Add support for Zigbee groups. Read doc for details about endpoints.
- Improve code logic for Indicator LED on for switches
- Fix power on behavior = OFF not working if toggle in pressed state during boot
- Add way to control network state led state (requires re-download of
switch_custom.js
)
- Fix led indicator state in manual mode not preserved after reboot
- Add forced device announcement after boot to make sure device is seen as "available" as soon as it boots
- Restored device pictures in z2m (requires re-download of
switch_custom.js
) - Cleaned-up z2m converter (fix typos, inconsistent names, etc). Warning! This may break your automations as it changes
property names (requires re-download of
switch_custom.js
)
- Improve join behaviour by decreasing timeout between tries to join
- Fix leave network: now device will send LeaveNetwork command properly
- Display firmware version in a human-readable form
- Add support for bi-stable relays contolled by 2 pins
- Fix Led indicator mode not preserved after reboot
- Fix reporting of indicator led status
- Add support for indicator leds
- Add way to force momentary mode as default via config
- Add SUSPEND-based sleep to EndDevice firmware to decrease power usage ~10x
- Add way to change device pinout on the fly, to allow easier porting of firmware
- Keep status LED on when device is connected
- Add separate firmwares for End Device/Router
- Improve device boot time significantly by removing unnecessary logs
- Fix bug that caused report to be sent every second
- Add support of statup behaviour: ON, OFF, TOGGLE, PREVIOUS
- Add support of button actions: 'released', 'press', 'long_press'. This is only useful for momentary (doorbell-like) switches.
- Add way to reset the device by pressing any switch button 5 times in a row
- Fix support for ON_OFF, OFF_ON actions
- https://github.com/pvvx/ZigbeeTLc (firmware for telink based ATC) as this was base for this project
- https://github.com/doctor64/tuyaZigbee (firmware for some other Tuya Zigbee devices) for some helpful examples
- https://medium.com/@omaslyuchenko for Hello Zigbee World series, that contain very usefull reference on how to implement a Zigbee device