[RELEASE] Tuya Zigbee Metering Plug (w/ healthStatus)

Thanks Kkkossev,

This is annoying to find a bug within the Tuya firmware and waiting many week for this to arrive.
I did create a RM to switch the device back on each time it detected that the switch state was off and send me a notification but l was receiving too many notifications and deemed the product as faulty.
Well l guess... back to the drawing board as they say.. :frowning:
Thanks again for confirming :slight_smile:

Do you still have this plug? If so, can you try the latest dev. branch version? I think I have found a workaround ...

@Stiggle

Dang, I never throw anything out.... but I sent one to Mike at Hubitat and he couldn't get it to work so I must have thrown out the other one ( I bought 2) ...so sorry I do not....
Thanks for all you do !!!
Tim

1 Like

Still got a few on my SmartThings hub (the only things left on the SmartThings hub)
Plugged in, switched on, with a battery charger as a load (just a couple of AA getting charged)

On/Off not working.
Voltage is correct - actual voltage coming into the house is : 247.407

Presence not present
Switch off
Power 0 W
Voltage 247 V
Amperage 0.0 A
Energy 0.0 kWh
Last hour 0 kWh
Cost 0.0 $
Duration 0

State Variables

  • rxCounter : 0

  • energyPollingSupported : true

  • lastResetDate : 2022-11-06 23:26:16.712

  • lastEnergyRaw : 0.0

  • isDigital : true

  • lastSwitchState : unknown

  • txCounter : 8

  • isRefreshRequest : false

  • notPresentCounter : 2

  • lastEnergyCost : 0.0

  • lastHourlyEnergy : 0.0

  • switchPollingSupported : true

  • powerPollingSupported : true

  • lastResetEnergy : 0.0

  • voltagePollingSupported : true

  • driverVersion : 1.6.3 2022/11/06 6:49 PM

  • switchDebouncing : false

  • currentPollingSupported : true

  • model : TS011F

  • destinationEP : 01

  • endpointId: 01

  • application: A0

  • manufacturer: _TZ3000_okaz9tjs

  • model: TS011F

And the logs:
[dev:228]2022-11-06 23:19:28.033[info]Power Meter Plug Auto polling is enabled, polling interval is 1 minutes
[dev:228]2022-11-06 23:19:27.997[info]Power Meter Plug Debug logging is false Description text logging is true
[dev:228]2022-11-06 23:19:27.996[info]Power Meter Plug Updating Power Meter Plug (Tuya Zigbee Metering Plug) model TS011F presence: present AlwaysOn is false
[dev:228]2022-11-06 23:19:25.323[info]Power Meter Plug amperage is 0 A
[dev:228]2022-11-06 23:19:25.282[info]Power Meter Plug voltage is 247 V
[dev:228]2022-11-06 23:19:25.259[info]Power Meter Plug power is 0 W
[dev:228]2022-11-06 23:19:19.148[info]Tuya Zigbee Metering Plug Tuya Zigbee Metering Plug switch is off
[dev:228]2022-11-06 23:19:18.974[info]Tuya Zigbee Metering Plug refresh()...
[dev:228]2022-11-06 23:19:18.212[info]Tuya Zigbee Metering Plug Energy (total:0.0 kWh) was reset on 2022-11-06 23:19:17.951
[dev:228]2022-11-06 23:19:18.165[info]Tuya Zigbee Metering Plug hourlyEnergy is 0 kWh
[dev:228]2022-11-06 23:19:18.164[info]Tuya Zigbee Metering Plug energy is 0.0 kWh, energyCost=$0.0 (rate=$0.21326), duration=0 Mins
[dev:228]2022-11-06 23:19:17.950[trace]resetEnergy() : state.lastEnergyRaw = 0.0
[dev:228]2022-11-06 23:19:16.835[warn]state.lastResetEnergy = null, resetting it back to 0!
[dev:228]2022-11-06 23:19:16.816[warn]Tuya Zigbee Metering Plug Initialize()...
[dev:228]2022-11-06 23:19:11.857[warn]Tuya Zigbee Metering Plug WARNING! This TS011F plug manufacturer _TZ3000_okaz9tjs is known to be problematic with HE!
[dev:228]2022-11-06 23:19:11.850[warn]fixing other Tuya oddities ...
[dev:228]2022-11-06 23:19:11.849[warn]ep=01 isF2=false
[dev:228]2022-11-06 23:19:11.821[info]Tuya Zigbee Metering Plug configure()..
[dev:228]2022-11-06 23:19:11.701[warn]state.lastResetEnergy = null, resetting it back to 0!
[dev:228]2022-11-06 23:19:11.699[info]Tuya Zigbee Metering Plug Installed()...

1 Like

Thank you for the logs, @Stiggle. Is there a change in the plug behavior compared to the previous driver version? I see power, voltage, and amperage readings now, although it is very strange that the number of the received packets ( rxCounter ) is zero and the on/off switching is not working yet.

I will ask you for one more test - update to the new version timeStamp 2022/11/07 7:45 AM.
The only change here is that the debug logging is enabled by default. Click on the Initialize button and copy/paste the logs that follow.

If you switch the plug off/on from the physical button, is the state updated on the driver? I still can not understand why the voltage is reported... Can you plug in some load > 3 Watts to see whether the power and the current are reported as well?

Desk fan plugged into the socket - according to SmartThings (using a plug thats still synced with that), its pulling 29W, and 237mA

Manually pressing the switch does not update the state in the browser display.

Logs:
dev:228 2022-11-07 10:55:35.282tracePower Meter Plug off() sending [he cmd 0x2905 0x01 0x0006 0 {}, delay 200]
dev:228 2022-11-07 10:55:35.260debugPower Meter Plug Switching Power Meter Plug Off
dev:228 2022-11-07 10:55:32.872tracePower Meter Plug on() sending [he cmd 0x2905 0x01 0x0006 1 {}, delay 200]
dev:228 2022-11-07 10:55:32.843debugPower Meter Plug Switching Power Meter Plug On
dev:228 2022-11-07 10:55:26.744tracePower Meter Plug off() sending [he cmd 0x2905 0x01 0x0006 0 {}, delay 200]
dev:228 2022-11-07 10:55:26.723debugPower Meter Plug Switching Power Meter Plug Off
dev:228 2022-11-07 10:55:22.948tracePower Meter Plug on() sending [he cmd 0x2905 0x01 0x0006 1 {}, delay 200]
dev:228 2022-11-07 10:55:22.919debugPower Meter Plug Switching Power Meter Plug On
dev:228 2022-11-07 10:55:00.074tracePower Meter Plug polling all
dev:228 2022-11-07 10:55:00.073tracePower Meter Plug polling.. refreshAll is false
dev:228 2022-11-07 10:55:00.070debugPower Meter Plug autoPoll()
dev:228 2022-11-07 10:54:57.980infoPower Meter Plug Initialization finished
dev:228 2022-11-07 10:54:57.979infoPower Meter Plug energyPollingSupported = true
dev:228 2022-11-07 10:54:57.978infoPower Meter Plug powerPollingSupported = true
dev:228 2022-11-07 10:54:57.977infoPower Meter Plug currentPollingSupported = true
dev:228 2022-11-07 10:54:57.976infoPower Meter Plug voltagePollingSupported = true
dev:228 2022-11-07 10:54:57.975infoPower Meter Plug switchPollingSupported = true
dev:228 2022-11-07 10:54:57.054warnPower Meter Plug WARNING! This TS011F plug manufacturer _TZ3000_okaz9tjs is known to be problematic with HE!
dev:228 2022-11-07 10:54:57.051tracePower Meter Plug sendZigbeeCommands received : [he raw 0x2905 1 0x01 0x0000 {10 00 00 04 00 00 00 01 00 05 00 07 00 FE FF}, delay 200, zdo bind 2905 01 0x01 0x0006 {70B3D52B6000F2C4} {}, delay 250, he cr 0x2905 01 6 0 16 0 900 {}, delay 250]
dev:228 2022-11-07 10:54:57.049infoPower Meter Plug Automatic reporting is disabled!
dev:228 2022-11-07 10:54:57.048debugPower Meter Plug skipping onOff standard configuration for an odd Tuya device...
dev:228 2022-11-07 10:54:57.047warnfixing other Tuya oddities ...
dev:228 2022-11-07 10:54:57.046warnep=01 isF2=false
dev:228 2022-11-07 10:54:57.013infoPower Meter Plug configure()..
dev:228 2022-11-07 10:54:57.010infoPower Meter Plug configuring the switch and energy reporting..
dev:228 2022-11-07 10:54:57.009infoPower Meter Plug Auto polling is enabled, polling interval is 1 minutes
dev:228 2022-11-07 10:54:56.975infoPower Meter Plug Debug logging will be automatically switched off after 24 hours
dev:228 2022-11-07 10:54:56.943infoPower Meter Plug Debug logging is true Description text logging is true
dev:228 2022-11-07 10:54:56.941infoPower Meter Plug Updating Power Meter Plug (Tuya Zigbee Metering Plug) model TS011F presence: not present AlwaysOn is false
dev:228 2022-11-07 10:54:52.342warnPower Meter Plug WARNING! This TS011F plug manufacturer _TZ3000_okaz9tjs is known to be problematic with HE!
dev:228 2022-11-07 10:54:52.338tracePower Meter Plug sendZigbeeCommands received : [he raw 0x2905 1 0x01 0x0000 {10 00 00 04 00 00 00 01 00 05 00 07 00 FE FF}, delay 200, zdo bind 2905 01 0x01 0x0006 {70B3D52B6000F2C4} {}, delay 250, he cr 0x2905 01 6 0 16 0 900 {}, delay 250]
dev:228 2022-11-07 10:54:52.337infoPower Meter Plug Automatic reporting is disabled!
dev:228 2022-11-07 10:54:52.336debugPower Meter Plug skipping onOff standard configuration for an odd Tuya device...
dev:228 2022-11-07 10:54:52.334warnfixing other Tuya oddities ...
dev:228 2022-11-07 10:54:52.334warnep=01 isF2=false
dev:228 2022-11-07 10:54:52.297infoPower Meter Plug configure()..
dev:228 2022-11-07 10:54:52.294infoPower Meter Plug configuring the switch and energy reporting..
dev:228 2022-11-07 10:54:52.293infoPower Meter Plug Auto polling is enabled, polling interval is 1 minutes
dev:228 2022-11-07 10:54:52.268infoPower Meter Plug Debug logging will be automatically switched off after 24 hours
dev:228 2022-11-07 10:54:52.230infoPower Meter Plug Debug logging is true Description text logging is true
dev:228 2022-11-07 10:54:52.228infoPower Meter Plug Updating Power Meter Plug (Tuya Zigbee Metering Plug) model TS011F presence: not present AlwaysOn is false
dev:228 2022-11-07 10:54:47.922tracePower Meter Plug polling all
dev:228 2022-11-07 10:54:47.919tracePower Meter Plug polling.. refreshAll is true
dev:228 2022-11-07 10:54:47.918infoPower Meter Plug refresh()...
dev:228 2022-11-07 10:54:47.143infoPower Meter Plug Energy (total:0.0 kWh) was reset on 2022-11-07 10:54:46.899
dev:228 2022-11-07 10:54:47.102infoPower Meter Plug hourlyEnergy is 0 kWh
dev:228 2022-11-07 10:54:47.100infoPower Meter Plug energy is 0.0 kWh, energyCost=$0.0 (rate=$0.21326), duration=0 Mins
dev:228 2022-11-07 10:54:47.026traceenergy_total=0, state.lastResetEnergy=0.0
dev:228 2022-11-07 10:54:46.898debugresetEnergy() : state.lastEnergyRaw = 0.0
dev:228 2022-11-07 10:54:45.873tracePower Meter Plug destinationEP = 01
dev:228 2022-11-07 10:54:45.872tracePower Meter Plug model = TS011F
dev:228 2022-11-07 10:54:45.783warnstate.lastResetEnergy = null, resetting it back to 0!
dev:228 2022-11-07 10:54:45.782warnPower Meter Plug preservedResetEnergy = 0
dev:228 2022-11-07 10:54:45.780warnPower Meter Plug clearing states and preferences ...
dev:228 2022-11-07 10:54:45.779infoPower Meter Plug InitializeVars()... fullInit = true
dev:228 2022-11-07 10:54:45.753warnPower Meter Plug Initialize()...

State Variables

  • rxCounter : 0
  • energyPollingSupported : true
  • lastResetDate : 2022-11-07 10:54:46.899
  • lastEnergyRaw : 0.0
  • isDigital : false
  • lastSwitchState : unknown
  • txCounter : 11
  • isRefreshRequest : false
  • notPresentCounter : 3
  • lastEnergyCost : 0.0
  • lastHourlyEnergy : 0.0
  • switchPollingSupported : true
  • powerPollingSupported : true
  • lastResetEnergy : 0.0
  • voltagePollingSupported : true
  • driverVersion : 1.6.3 2022/11/07 7:45 AM
  • switchDebouncing : false
  • currentPollingSupported : true
  • model : TS011F
  • destinationEP : 01

Switching back to the old driver (1.6.2)

Current States

  • amperage : 0
  • energy : 0.0
  • energyCost : 0.0
  • energyDuration : 0 Mins
  • hourlyEnergy : 0.0
  • html :
  • power : 0
  • presence : not present
  • switch : off
  • voltage : 247

State Variables

  • rxCounter : 0
  • energyPollingSupported : true
  • lastResetDate : 2022-11-07 11:16:11.031
  • lastEnergyRaw : 0.0
  • isDigital : true
  • lastSwitchState : unknown
  • txCounter : 8
  • isRefreshRequest : false
  • notPresentCounter : 1
  • lastEnergyCost : 0.0
  • lastHourlyEnergy : 0.0
  • switchPollingSupported : true
  • lastPresenceState : unknown
  • powerPollingSupported : true
  • lastResetEnergy : 0.0
  • voltagePollingSupported : true
  • driverVersion : 1.6.2 2022/09/28 8:58 PM
  • currentPollingSupported : true
  • switchDebouncing : false
  • model : TS011F
  • destinationEP : 01

Logs:
dev:228 2022-11-07 11:19:15.142warnPower Meter Plug WARNING! This TS011F plug manufacturer _TZ3000_okaz9tjs is known to NOT WORK with HE!
dev:228 2022-11-07 11:19:15.103infoPower Meter Plug refresh()...
dev:228 2022-11-07 11:19:15.062infoPower Meter Plug configure()..
dev:228 2022-11-07 11:19:15.059infoPower Meter Plug configuring the switch and energy reporting..
dev:228 2022-11-07 11:19:15.058infoPower Meter Plug Auto polling is enabled, polling interval is 1 minutes
dev:228 2022-11-07 11:19:15.004infoPower Meter Plug Debug logging is false Description text logging is true
dev:228 2022-11-07 11:19:15.002infoPower Meter Plug Updating Power Meter Plug (Tuya Zigbee Metering Plug) model TS011F presence: not present AlwaysOn is false
dev:228 2022-11-07 11:19:05.973infoPower Meter Plug refresh()...
dev:228 2022-11-07 11:19:05.189infoPower Meter Plug Energy (total:0.0 kWh) was reset on 2022-11-07 11:19:04.957
dev:228 2022-11-07 11:19:05.144infoPower Meter Plug hourlyEnergy is 0 kWh
dev:228 2022-11-07 11:19:05.140infoPower Meter Plug energy is 0.0 kWh, energyCost=$0.0 (rate=$0.12), duration=0 Mins
dev:228 2022-11-07 11:19:04.956traceresetEnergy() : state.lastEnergyRaw = 0.0
dev:228 2022-11-07 11:19:03.930tracePower Meter Plug destinationEP = 01
dev:228 2022-11-07 11:19:03.929tracePower Meter Plug model = TS011F
dev:228 2022-11-07 11:19:03.852warnstate.lastResetEnergy = null, resetting it back to 0!
dev:228 2022-11-07 11:19:03.851warnPower Meter Plug preservedResetEnergy = 0
dev:228 2022-11-07 11:19:03.849warnPower Meter Plug clearing states and preferences ...
dev:228 2022-11-07 11:19:03.848infoPower Meter Plug InitializeVars()... fullInit = true
dev:228 2022-11-07 11:19:03.823warnPower Meter Plug Initialize()...

Can you do that and send me a PCAPng file ?

I'll generate some new files tomorrow as I'll be away from home and so no additional zigbee traffic to clutter the airways.

1 Like

Whats the best way to send you the files?

I've captured from it syncing with the hub, switching on & off, child lock, LED, setting a schedule, and a screen shot of the load as displayed in the app.

1 Like

I've sent you a PM

1 Like

I have updated the main branch to ver. 1.6.3 (2022-11-08), as there were a lot of changes accumulated in the last few weeks. These changes were mostly related to non-Tuya plugs, so I will not push this version for automatic updates from HPM.

1 Like

Hey @kkossev, I've used this for 2-3 days now and I'm really impressed how good it works compared to my old/other metering plug drivers, so congrats for that. However I have a question - I have a blitzwolf SPH-13 and when I look at the logs, sometimes they look like this:

There are some changes to the values, but the driver says that "2 is less than 1W" for example. Is that expected? Or maybe is a bug specific to that brand/model of plugs?

1 Like

It's the debug log text wording that may need to be improved...

The meaning is: "the 2 Watts power report was ignored because the change from the previously reported value of 2 Watts is less than the configured threshold of 1 Watt." : )

1 Like

I have pushed an update to driver version 1.6.4 today via HPM.

This version adds support also for Frient energy monitor.

frient Electricity Meter Interface
image
frient :
vesternet:
smartify.in :

These are new options specific to Frient Energy Monitor only :

Many thanks to @Pradeep for the tests!

Thanks @kkossev, Much appreciated.

Is anyone able to explain the difference between "automatic reporting" and polling - I assume for automatic reporting the plug/meter will (once configured) send energy data on some schedule while for polling energy data is only sent on demand, in response to a request from the hub?

Is there a recommended setting for the Frient meter, do we know? - mine is currently set to both automatic reporting and automatic polling. I note that my state variables include "PowerPollingSupported : false" - so I'm guessing that the Frient meter doesn't respond to polling and that it may be best to have polling off to reduce hub load a little?

1 Like

Hi @AberangSteve ,

As this driver was made initially for Tuya plugs most of which models do not report the power automatically, the software polling is a default option. For the Frient energy meter it seems like the only working option is the automatic reporting, so you may turn off the polling or set it up for a period of 1 hour for example.

Trying to pair NEO zigbee outlets with no success
I downloaded the drivers you prepared, but it didn't help
I have three such devices and the hub does not see them
Do you have any suggestions


1 Like

Hi @user3012 ,

We need to first identify your device. Does it pair successfully to Hubitat as a Zigbee device?

Do you mean that when you go to Devices -> Add Device -> Zigbee -> Start Zigbee Pairing and you press and hold the plug pairing button for 5 or more seconds, nothing happens?

1 Like

No, It is not pairing at all , is not visible for a hub