This is a new topic on the Tuya Zigbee Metering Plug driver that was first published in November 2021.
The focus of the driver is to provide an optimized way for reporting Power, Energy, Voltage, Amperage, and switch events (where available) for these Tuya plugs/outlets models that do not report the metering attributes automatically.
The driver is available for download from Hubitat Package Manager (HPM), search for 'Tuya Zigbee Metering Plug'. The direct link to the code in GitHub repository is here .
ver. 1.4.0 2022-01-23 - debug & trace logging cleanup; initialize switch and energy automatic reporting mode; energy and switch are excluded from polling; default debug logging is disabled, optimizations are enabled by default; switch digital/physical bug fixed; added driver version check
ver. 1.4.1 2022-01-27 - added XH-002P Outlet TS011F fingerprint (no power monitoring!)
ver. 1.4.6 2022-06-02 - added on/off switches for power, amperage, voltage, and energy reporting (logs+Events); added device display name in all logs
ver. 1.5.0 2022-06-05 - Bug fix - all settings were reset back in to the defaults on hub reboot; parsing 'other Tuya oddities..'; over current alarm 0x8003; 'Freeze' LED mode (sets the backlight to the current state);
ver. 1.5.1 2022-06-12 - ChildLock bug fix
ver. 1.6.0 2022-09-11 :
removed 'Health Check' and 'Polling' capabilities (ping and poll buttons);
added _TZ3000_okaz9tjs fingerprint for tests; automatic reporting configuration bug fixes;
added individual thresholds for W,A,V; added autoReportingEnabled switch(default:false);
added resetEnergy command; disabled attributes states are now deleted; added energyPrice (decimal) preference;
added setEnergyPrice command; added energyCost calculation and event
ver. 1.6.1 : added html attribute; added energyDuration; added hourlyEnergy; energy and energyCosts are reset when Initialize button is clicked; fixed autoPoll bug
ver 1.6.2 (2022/09/28) : added NON-Tuya plugs fingerprints; removed hardcoded EPVA dividers; SmartThings outlet power and voltage correction; added warning for _TZ3000_okaz9tjs'; removed lastAmperage, lastVoltage, lastPower states; negative energy automatic correction; * ignoring false zero W,A,V values from Tuya devices automatic reports; Frient A/S SPLZB-131 voltage correction; added processing for power Instantaneous Demand
ver. 1.6.3 2022-11-24 : * added OSRAM 'Plug 01'; maximum power cap set to 13KW; added 'Develco Products A/S' as Frient manufacturer; fixed power events when on/off; added lastHour energy in HTML; added _TZ3000_zloso4jk; 'not present' bug fix when polling is disabled; removed lastPresenceState; added SiHAS products; * added frequency; added powerFactor; fixOtherTuyaOddities() and extendedTuyaMagic() for _TZ3000_okaz9tjs
ver. 1.6.5 2022-12-19 - added _TZE204_cjbofhxw Smart Meter w/ Current Transformer ; fixed bug in html for Power attribute; added new models HIKING TOMZN DDS238-2 _TZE200_bkkmqmyo; added MatSee _TZE200_eaac7dkw
ver. 1.6.6 2023-01-20 - Zigbee 3.0 incompatible with HE _TZ3000_r6buo8ba and _TZ3000_okaz9tjs fingerprints commented out; added SONOFF Z111PL0H-1JX to the isHEProblematic() list; added _TZ3000_7dndcnnb
ver. 1.7.3 2023-03-28 - Third Reality amperage divisor fix; added frequency polling; completely removed presence capability; improved logging for disabled attributes; hourlyEnergy is not sent of disabled or the deviceHealth is offline; dummy ping; Frient freq. divisor fix; added Instantaneous Demand (power) configuration;
ver. 1.7.4 2023-04-22 kkossev - added TS011F _TZ3000_1hwjutgo _TZ3000_lnggrqqi Tuya Circuit Breaker 2P; TS0601 _TZE200_hkdl5fmv circuit breaker w/ energy: power, energy, voltage, amperage; polling and energyMode are set automatically depending on the device type; automatic reporting configuration thresholds bug fix;
ver. 1.7.5 2023-05-12 kkossev - (dev. branch) added Tongou TO-Q-SY1-JZT DIN Rail Switch TS011F _TZ3000_qeuvnohg; added toggles for enabling Frequency, Power Factor and temperature (if device supports it); added _TZE200_fsb6zw01;
ver. 1.7.6 2023-05-13 - added partial support for TS0601 _TZE200_abatw3kj RTX Circuit Breaker 4x25A ZCB25-4P; added Tongou SY2 TZ3000_cayepv1a; thresholds decoding for RTX
ver. 1.7.7 2023-06-10 - isTuyaE00xCluster procesing of known attributes; Tongou SY2 over/under V/A/P protection parameters decoding and encoding; moved TS011F non-power-reporting plugs to Zemismart driver
ver. 1.7.8 2023-07-29 kkossev - added TS0001 _TZ3000_kqvb5akv; bug fix: report containing multiple 0x0006 attributes was not processed correctly; added setSwitchType configuration command; suppressed some warning logs;
The development branch is not pushed to HPM, so you need to manually copy and paste the code from the link above.
If you were using another driver, make sure you press once the 'Initialize' button. Initialize button will load the default settings depending on your plug model and manufacturer!
If you have any issues or suggestions for improvements - please comment in this thread.
I'd been looking but I can't find any zigbee ones that say they do metering. They may do, but the sellers aren't making it clear. So I just asked on the off-chance you happened to know one specifically.
50 day shipping!! :o I found something that looks like this on Ebay finally and should have it by the end of the month. Hopefully it's the same one Thanks!
Ali Express orders are hit-or-miss... I have received small items from China in just one week, although it states more than a month. Seems like it depends whether the same item is already present in Amsterdam or not. And at the same time - items that are claimed to be available in Spain or France warehouses may travel several weeks inside the EU countries, although there are no customs... go figure!
I see now there are some debug/information messages that I have missed to suppress when the Debug option is switched off, will correct this in the next update. This is a network update message that is not of interest.
Does the driver work OK with your device? Does it need the polling option to be enabled in order to receive power readings?
Second question: does the plug report the On/Off status immediately when you switch it locally pressing the plug button, or the status is reported after a delay (on the next polling cycle) ?
And in answer to your two questions, it only updates the status at the polling intervals, and without polling on it reports nothing at all, not even on/off state (unless instigated via the hub)
It turns out that Tuya has made a strange (for us) decision to disable the automatic reporting of the switch and energy readings in the firmware of the plugs produced in the last year. So the automatic reporting of the switch state actually depends on the 'application' version:
Application version: 0x41 (65 decimal) - switch state and energy are reported automatically
Application version: 0x45 (69 decimal) - switch state and energy needs polling
The power, voltage, and amperage attribute of TS0121 and TS011F models always need polling, regardless of the application version. Only the TOMZN DDS238-2 model reports all the measured attributes automatically.
The good news is that there seems to be a possibility/workaround to initialize the newer models to work in a backward-compatible mode, i.e. to start reporting the switch and energy states automatically. If this works for all different types of Tuya plugs, it will reduce the unnecessary Zigbee network communication load even more. I hope will be ready to publish the new version for testing later tonight or tomorrow.
Can you give it a try? You'll need to press the Initialize() button again. Now the automatic switch state reporting works OK with my TS011F plug app. version 0x45, even if I use the inbuilt Generic Zigbee Outlet driver.
There are also a lot of other small bug fixes and improvements, if this version works OK, I will update also the 'production' version that is available from HPM.
Ok I think this is working as you intended. Without automatic polling enabled it now briskly updates the On/Off state as initiated via the physical device, but does not update power readings etc. (they update when automatic polling is reinstated)
Thank you for the tests! If you have any other suggestions for improvements, please let me know. I have too many items in this driver TODO list, but it is difficult for me to decide which of them are really worth spending the time and could be useful for anyone else than me
Version 1.4.0 is now available for update from HPM.
My TS011F doesn't seem to want to do power metering. Even though the seller (aliexpress) advertises it as capable.
Could it be that this is a different version or something?
endpointId: 01
application: 43
softwareBuild:
inClusters: 0003,0004,0005,0006,E000,E001,0000
outClusters: 0019,000A
model: TS011F
powerCluster: none
manufacturer: _TZ3000_v1pdxuqq
The box indicates the model as XH-002P
From manufacturer: shenzhen Sparkle IOT
After pairing the outlet, selecting your driver and pressing initialize:
I can control the on / off state
I can see (under state variables) all kinds of vallues, but lastEnergy, lastPower, lastAmperage and lastVoltage remaine at 0.