question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Zemismart (Tuya) smart plug

See original GitHub issue

Hello!

I’m really thankful for all the efforts running this project, my Home Assistant works like a charm! ❤️

I just acquired a Zemismart ZigBee Smart Plug, and it does not seem to be supported by Zigbee2MQTT yet.

Looking at the logs, I identified its model ID and manufacturer name: TS011F, _TZ3000_hyfvrar3. I could not find the manufacturer name in the device files, but I found the model ID more than once.

To try and enable support on my Home Assistant, I created the following file:

// /config/zigbee2mqtt/_TZ3000_hyfvrar3.js
const tuya = require('zigbee-herdsman-converters/devices/tuya');
const ts011f_plug = tuya.find(element => element.model == "TS011F_plug");
ts011f_plug.fingerprint.push({modelID: 'TS011F', manufacturerName: '_TZ3000_hyfvrar3'});
module.exports = ts011f_plug;

This allows me to reuse an existing Tuya smart plug’s definition: https://github.com/Koenkk/zigbee-herdsman-converters/blob/e58938c8ca604e501458397243b694d094747442/devices/tuya.js#L650-L672

Updated Zigbee2MQTT’s configuration then restarted it, and voilà, my smart plug was supported!

Unfortunately, it looks like this is not a perfect match:

state and power_outage_memory work pretty well (tested), but the rest seems not to.

Here is a log extract.
Zigbee2MQTT:info  2021-06-06 18:10:06: Zigbee: allowing new devices to join.
Zigbee2MQTT:info  2021-06-06 18:10:06: MQTT publish: topic 'zigbee2mqtt/bridge/response/permit_join', payload '{"data":{"time":254,"value":true},"status":"ok","transaction":"gmr2w-1"}'
Zigbee2MQTT:warn  2021-06-06 18:10:17: Device '0x84fd27fffe3e25a8' left the network
Zigbee2MQTT:info  2021-06-06 18:10:17: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"ieee_address":"0x84fd27fffe3e25a8"},"type":"device_leave"}'
Zigbee2MQTT:info  2021-06-06 18:10:17: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"left_network","meta":{"friendly_name":"0x84fd27fffe3e25a8"},"type":"device_removed"}'
Zigbee2MQTT:warn  2021-06-06 18:10:17: Device '0x84fd27fffe3e25a8' left the network
Zigbee2MQTT:info  2021-06-06 18:10:17: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"ieee_address":"0x84fd27fffe3e25a8"},"type":"device_leave"}'
Zigbee2MQTT:info  2021-06-06 18:10:17: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"left_network","meta":{"friendly_name":"0x84fd27fffe3e25a8"},"type":"device_removed"}'
Zigbee2MQTT:warn  2021-06-06 18:10:18: Device '0x84fd27fffe3e25a8' left the network
Zigbee2MQTT:info  2021-06-06 18:10:18: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"ieee_address":"0x84fd27fffe3e25a8"},"type":"device_leave"}'
Zigbee2MQTT:info  2021-06-06 18:10:18: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"left_network","meta":{"friendly_name":"0x84fd27fffe3e25a8"},"type":"device_removed"}'
Zigbee2MQTT:info  2021-06-06 18:10:19: Device '0x84fd27fffe3e25a8' joined
Zigbee2MQTT:info  2021-06-06 18:10:19: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x84fd27fffe3e25a8","ieee_address":"0x84fd27fffe3e25a8"},"type":"device_joined"}'
Zigbee2MQTT:info  2021-06-06 18:10:19: Starting interview of '0x84fd27fffe3e25a8'
Zigbee2MQTT:info  2021-06-06 18:10:19: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x84fd27fffe3e25a8","ieee_address":"0x84fd27fffe3e25a8","status":"started"},"type":"device_interview"}'
Zigbee2MQTT:info  2021-06-06 18:10:19: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":{"friendly_name":"0x84fd27fffe3e25a8"},"type":"device_connected"}'
Zigbee2MQTT:info  2021-06-06 18:10:19: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_started","meta":{"friendly_name":"0x84fd27fffe3e25a8"},"type":"pairing"}'
Zigbee2MQTT:debug 2021-06-06 18:10:20: Device '0x84fd27fffe3e25a8' announced itself
Zigbee2MQTT:info  2021-06-06 18:10:20: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x84fd27fffe3e25a8","ieee_address":"0x84fd27fffe3e25a8"},"type":"device_announce"}'
Zigbee2MQTT:info  2021-06-06 18:10:20: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"announce","meta":{"friendly_name":"0x84fd27fffe3e25a8"},"type":"device_announced"}'
Zigbee2MQTT:debug 2021-06-06 18:10:33: Received Zigbee message from '0x84fd27fffe3e25a8', type 'readResponse', cluster 'genBasic', data '{"modelId":"TS011F"}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2021-06-06 18:10:33: Skipping message, definition is undefined and still interviewing
Zigbee2MQTT:debug 2021-06-06 18:10:33: Received Zigbee message from '0x84fd27fffe3e25a8', type 'readResponse', cluster 'genBasic', data '{"manufacturerName":"_TZ3000_hyfvrar3"}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2021-06-06 18:10:33: Received Zigbee message from '0x84fd27fffe3e25a8', type 'readResponse', cluster 'genBasic', data '{"powerSource":1}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2021-06-06 18:10:33: Received Zigbee message from '0x84fd27fffe3e25a8', type 'readResponse', cluster 'genBasic', data '{"zclVersion":3}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2021-06-06 18:10:33: Received Zigbee message from '0x84fd27fffe3e25a8', type 'readResponse', cluster 'genBasic', data '{"appVersion":67}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2021-06-06 18:10:33: Received Zigbee message from '0x84fd27fffe3e25a8', type 'readResponse', cluster 'genBasic', data '{"stackVersion":0}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2021-06-06 18:10:33: Received Zigbee message from '0x84fd27fffe3e25a8', type 'readResponse', cluster 'genBasic', data '{"hwVersion":1}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2021-06-06 18:10:33: Received Zigbee message from '0x84fd27fffe3e25a8', type 'readResponse', cluster 'genBasic', data '{"dateCode":""}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2021-06-06 18:10:34: Received Zigbee message from '0x84fd27fffe3e25a8', type 'readResponse', cluster 'genBasic', data '{}' from endpoint 1 with groupID 0
Zigbee2MQTT:info  2021-06-06 18:10:34: Successfully interviewed '0x84fd27fffe3e25a8', device has successfully been paired
Zigbee2MQTT:info  2021-06-06 18:10:34: Device '0x84fd27fffe3e25a8' is supported, identified as: TuYa Smart plug (TS011F_plug)
Zigbee2MQTT:info  2021-06-06 18:10:34: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"definition":{"description":"Smart plug","exposes":[{"features":[{"access":7,"description":"On/off state of the switch","name":"state","property":"state","type":"binary","value_off":"OFF","value_on":"ON","value_toggle":"TOGGLE"}],"type":"switch"},{"access":1,"description":"Instantaneous measured power","name":"power","property":"power","type":"numeric","unit":"W"},{"access":1,"description":"Instantaneous measured electrical current","name":"current","property":"current","type":"numeric","unit":"A"},{"access":1,"description":"Measured electrical potential value","name":"voltage","property":"voltage","type":"numeric","unit":"V"},{"access":1,"description":"Sum of consumed energy","name":"energy","property":"energy","type":"numeric","unit":"kWh"},{"access":3,"description":"Recover state after power outage","name":"power_outage_memory","property":"power_outage_memory","type":"enum","values":["on","off","restore"]},{"access":1,"description":"Link quality (signal strength)","name":"linkquality","property":"linkquality","type":"numeric","unit":"lqi","value_max":255,"value_min":0},{"access":1,"description":"Link quality (signal strength)","name":"linkquality","property":"linkquality","type":"numeric","unit":"lqi","value_max":255,"value_min":0}],"model":"TS011F_plug","supports_ota":false,"vendor":"TuYa"},"friendly_name":"0x84fd27fffe3e25a8","ieee_address":"0x84fd27fffe3e25a8","status":"successful","supported":true},"type":"device_interview"}'
Zigbee2MQTT:info  2021-06-06 18:10:34: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_successful","meta":{"description":"Smart plug","friendly_name":"0x84fd27fffe3e25a8","model":"TS011F_plug","supported":true,"vendor":"TuYa"},"type":"pairing"}'
Zigbee2MQTT:debug 2021-06-06 18:11:52: Received Zigbee message from 'Bedroom T&H', type 'attributeReport', cluster 'msTemperatureMeasurement', data '{"measuredValue":2485}' from endpoint 1 with groupID 0
Zigbee2MQTT:info  2021-06-06 18:11:52: MQTT publish: topic 'zigbee2mqtt/Bedroom T&H', payload '{"battery":95,"humidity":65.67,"linkquality":73,"temperature":24.85,"voltage":2900}'
Zigbee2MQTT:debug 2021-06-06 18:12:05: Received MQTT message on 'zigbee2mqtt/0x84fd27fffe3e25a8/set' with data '{"state":"OFF"}'
Zigbee2MQTT:debug 2021-06-06 18:12:05: Publishing 'set' 'state' to '0x84fd27fffe3e25a8'
Zigbee2MQTT:debug 2021-06-06 18:12:05: Received Zigbee message from '0x84fd27fffe3e25a8', type 'attributeReport', cluster 'genOnOff', data '{"onOff":0}' from endpoint 1 with groupID 0
Zigbee2MQTT:info  2021-06-06 18:12:05: MQTT publish: topic 'zigbee2mqtt/0x84fd27fffe3e25a8', payload '{"current":null,"energy":null,"linkquality":107,"power":null,"power_outage_memory":null,"state":"OFF","voltage":null}'
Zigbee2MQTT:info  2021-06-06 18:12:05: MQTT publish: topic 'zigbee2mqtt/0x84fd27fffe3e25a8', payload '{"current":null,"energy":null,"linkquality":105,"power":null,"power_outage_memory":null,"state":"OFF","voltage":null}'
Zigbee2MQTT:debug 2021-06-06 18:12:06: Received MQTT message on 'zigbee2mqtt/0x84fd27fffe3e25a8/set' with data '{"state":"ON"}'
Zigbee2MQTT:debug 2021-06-06 18:12:06: Publishing 'set' 'state' to '0x84fd27fffe3e25a8'
Zigbee2MQTT:info  2021-06-06 18:12:06: MQTT publish: topic 'zigbee2mqtt/0x84fd27fffe3e25a8', payload '{"current":null,"energy":null,"linkquality":105,"power":null,"power_outage_memory":null,"state":"ON","voltage":null}'
Zigbee2MQTT:debug 2021-06-06 18:12:06: Received Zigbee message from '0x84fd27fffe3e25a8', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
Zigbee2MQTT:info  2021-06-06 18:12:06: MQTT publish: topic 'zigbee2mqtt/0x84fd27fffe3e25a8', payload '{"current":null,"energy":null,"linkquality":105,"power":null,"power_outage_memory":null,"state":"ON","voltage":null}'
Zigbee2MQTT:debug 2021-06-06 18:12:08: Received MQTT message on 'zigbee2mqtt/0x84fd27fffe3e25a8/set' with data '{"power_outage_memory":"restore"}'
Zigbee2MQTT:debug 2021-06-06 18:12:08: Publishing 'set' 'power_outage_memory' to '0x84fd27fffe3e25a8'
Zigbee2MQTT:info  2021-06-06 18:12:08: MQTT publish: topic 'zigbee2mqtt/0x84fd27fffe3e25a8', payload '{"current":null,"energy":null,"linkquality":110,"power":null,"power_outage_memory":"restore","state":"ON","voltage":null}'
Zigbee2MQTT:debug 2021-06-06 18:12:56: Received MQTT message on 'zigbee2mqtt/0x84fd27fffe3e25a8/set' with data '{"power_outage_memory":"off"}'
Zigbee2MQTT:debug 2021-06-06 18:12:56: Publishing 'set' 'power_outage_memory' to '0x84fd27fffe3e25a8'
Zigbee2MQTT:info  2021-06-06 18:12:56: MQTT publish: topic 'zigbee2mqtt/0x84fd27fffe3e25a8', payload '{"current":null,"energy":null,"linkquality":105,"power":null,"power_outage_memory":"off","state":"ON","voltage":null}'
Zigbee2MQTT:debug 2021-06-06 18:12:57: Received MQTT message on 'zigbee2mqtt/0x84fd27fffe3e25a8/set' with data '{"power_outage_memory":"restore"}'
Zigbee2MQTT:debug 2021-06-06 18:12:57: Publishing 'set' 'power_outage_memory' to '0x84fd27fffe3e25a8'
Zigbee2MQTT:info  2021-06-06 18:12:57: MQTT publish: topic 'zigbee2mqtt/0x84fd27fffe3e25a8', payload '{"current":null,"energy":null,"linkquality":105,"power":null,"power_outage_memory":"restore","state":"ON","voltage":null}'
Zigbee2MQTT:debug 2021-06-06 18:13:00: Saving state to file /config/zigbee2mqtt/state.json
Zigbee2MQTT:debug 2021-06-06 18:13:19: Received MQTT message on 'zigbee2mqtt/bridge/request/device/configure' with data '{"id":"0x84fd27fffe3e25a8","transaction":"gmr2w-2"}'
Zigbee2MQTT:info  2021-06-06 18:13:19: MQTT publish: topic 'zigbee2mqtt/bridge/response/device/configure', payload '{"data":{"id":"0x84fd27fffe3e25a8"},"status":"ok","transaction":"gmr2w-2"}'

Based on this picture on the product page, I was expecting the smart plug to have some power monitoring ability, but I have no idea what I’d need to do to implement that. 😅

Would love to get some help and or guidance. 🙏🏻

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Koenkkcommented, Jun 16, 2021

This will be fixed with the next z2m release.

1reaction
Koenkkcommented, Jun 15, 2021

Added the device (without power monitoring capabilities). Assuming this can be closed now.

Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/how_tos/how-to-switch-to-dev-branch.html)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Zemismart Tuya WiFi Electrical Sockets with Dimmable ...
Zemismart Tuya WiFi Electrical Sockets with Dimmable Light Smart Plug Alexa Google Home Echo APP Control 16A EU Plug for Bedroom. USD $15.70....
Read more >
Z Tuya WiFi Smart Electrical Socket with Dimmable Night ...
Zemismart Tuya WiFi Smart Electrical Socket with Dimmable Night Light Alexa Google Home Echo Voice Contro Smart Plug for Bedroom. USD $15.70. USD...
Read more >
Zemismart Tuya Zigbee Brazil Socket Smart Light Switch ...
Zemismart Tuya Zigbee Brazil Socket Smart Light Switch Support Alexa Google Home Voice Control Brazilian Wall Push Button Switch. USD $29.70. USD $65.99....
Read more >
Socket & Outlet - Zemismart Smart Home
Zemismart Tuya WiFi Brazil Socket Smart Wall Light Switch Support Alexa Google Home Voice Control Brazilian Wall Outlet Switch.
Read more >
Zemismart ZigBee Smart Plug Power Socket Timing ...
Zemismart ZigBee Smart Plug Power Socket Timing Function Home Voice Remote Tuya Smart Life APP Control With Alexa Google Home. USD $15.00. USD...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found