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

Hi, let me know what Zigbee model/manufacturer device you have received - there are dozens of variations..

it is TO-Q-SY2-JZT

  • endpointId: 01
  • application: 45
  • inClusters: 0000,0003,0004,0005,0006,0702,0B04,0402,E000,E001
  • manufacturer: _TZ3000_cayepv1a
  • model: TS011F
  • outClusters: 0019,000A
1 Like

@ilkeraktuna do you see the configuration options as shown above?

yes I see them.
I had thought they were default/standard for all devices.
Do they appear according to the device's capabilities ?

The Preferences options will show up or not dynamically, depending on the particular device capabilities.

1 Like

I have a few Frient power plugs, and I have been succesfully using your driver with them and got the expected results. I was going through some housekeeping and noticed a difference in how the driver is implemented for some of the plugs.

  • Some are missing in- and outclusters (and then also the powercluster)
  • Some have the powercluster, but are then missing the in- and outcluster.
  • If the device is missing the in- and outclusters, it also has fewer state variables.

I generally have two types: SPLZB-131 and SPLZB-141, but the above rings true regardless of version.

I have tried cleaning the states by using the generic device driver, no change. Some of these plugs may have replaced others and as such I have used the replace device feature to do so.

One of the reasons I noticed this was that I was hoping to change the "Set Power On State" for all plugs (via the Preference Manager), but it seems this setting is not exposed to that app?

Do you think I need to repair the devices with no in- and outclusters?

Hubitat inbuilt 'Device' driver should fill in the inClusters and outClusters list when you click on the 'Get Info' button...

You can also try the following - go to HE drivers code editor and change the line _DEBUG = true, then save the changed code.

Refresh the device web page, a button "Active Endpoints" should show up:

Click on it, and then refresh again the device web page. Only the inClusters list will be updated, if reported different than what you already have.

Do you see a change?

Removing the device and pairing it again (close to the hub) will definitely update all the device info, but I don't recommend removing the devices lately because of the pairing problems that you may encounter.

1 Like

Thank you kkossev for your work on the Tuya PJ-1203A dual clamp power meter driver.

I only needed separate power readings from channel A and B.
Despite not ever using groovy and not fully understanding the "map", I managed to create separate custom attributes for powerA, powerB and powerAB.
Also got the events working for each channel using the Power minimum change to be reported in the preferences. That is all I need from this device.

Thanks again kkossev. I could have never figured this out on my own.

1 Like

I bought 4 sockets in December 2023 of the type described in the post 1 above as "Tuya Smart Zigbee Plug AU 16A" - I bought it on Aliexpress. In Hubitat it is manufacturer: _TZ3000_typdpbpg model: TS011F
These are not safe to use - I even got an electric shock as a result of one the switches. 2 problems:

  1. The earth connection on the 4 sockets I received is not reliable. I tested all of them and found that the earth pin and earth socket were normally connected as they should be. However, if the Neutral pin is pressed slightly outwards (thumb pressure), the earth disconnects!! This is very dangerous. The pressure on the neutral can happen when the pins on the plug side are pushed into a normal socket. A person could get a bad shock if a device like a kettle is faulty and not connected to earth. I even made a video to show this.
  2. The socket switches the neutral power and not the active power. Dangerous because a user may think a device is switched off and that it is not live but it will be live. This is very bad.
    I provided the above information to the store sixwgh but despite exchanging messages for over 11 days they never seemed to understand the problem. They sent me a video of their test, which clearly was not testing what I had described. Use at your own risk.

@byoder17, you can send me your modified code in a DM, and I can merge it and publish it into the common branch. This way, we can help others who have the same device.

Hi @user2176, thank you for sharing this with the community! I have edited the top post to include a warning and reference your post details.

1 Like

Hi @kkossev,

I've been using this driver for some ThirdReality power monitoring plugs - the "chatty" ones.

I've notice that the energy cost calculations seem to be off - I think at least by a factor of 1000. I am assuming this is calculated in the driver.

If so, would you be able to check the calculations?

The energy rate in the driver specifies the cost as KWh. If I multiply the (last hourly) energy value by the Energy price, I get the resulting driver calculated cost. But I'm thinking the energy value is not in KWh?

Current States

  • amperage : 0
  • energy : 1952.024
  • energyCost : 214.14
  • energyDuration : 40.01 Days
  • healthStatus : online
  • hourlyEnergy : 0.0
  • power : 0
  • switch : off
  • voltage : 122

State Variables

  • rxCounter : 66179
  • energyPollingSupported : true
  • lastResetDate : 2024-10-10 19:39:07.685
  • lastEnergyRaw : 1952.024
  • isDigital : false
  • rejoinCounter : 0
  • lastSwitchState : off
  • txCounter : 58114
  • isRefreshRequest : false
  • notPresentCounter : 0
  • lastEnergyCost : 214.13703279999996
  • lastHourlyEnergy : 1952.024
  • switchPollingSupported : true
  • powerPollingSupported : true
  • lastResetEnergy : 0.0
  • voltagePollingSupported : true
  • driverVersion : 1.9.3 2024/04/07 8:37 AM
  • switchDebouncing : false
  • currentPollingSupported : true
  • model : 3RSP02028BZ
  • destinationEP : 01

Energy price for 1 KWh , $: 0.1097

I most certainly have not used $214 in electricity on this plug :smiley:

Thanks

1 Like

Hi @Lamda ,

I haven't updated the HPM version of this driver for quite a long time, and there were some changes related to the ThirdReality power monitoring plugs back in May this year..

Today I have pushed an update to ver. 1.9.7 via HPM.

Before I dig deeper into the TR energy calculation code in the driver, can you update to the latest version of this driver and let me know if the energy scaling is still not correct?
I have tested the driver with the Europen version of the TR plug (3RSPE01044BZ).

Hi kkossev,

I updated the driver, initialized and refreshed. The energy cost value almost doubled while the energy stayed the same :stuck_out_tongue:

I re-set the energy price just to be sure.

Current States

  • amperage : 0
  • energy : 1952.024
  • energyCost : 416.29
  • energyDuration : 0.09 Mins
  • healthStatus : online
  • hourlyEnergy : 0
  • power : 0
  • switch : off
  • voltage : 122

State Variables

  • rxCounter : 72703
  • energyPollingSupported : true
  • lastResetDate : 2024-10-10 19:39:07.685
  • lastEnergyRaw : 1952.024
  • isDigital : false
  • rejoinCounter : 0
  • lastSwitchState : off
  • txCounter : 63846
  • isRefreshRequest : false
  • notPresentCounter : 1
  • lastEnergyCost : 214.13703279999996
  • lastHourlyEnergy : 1952.024
  • switchPollingSupported : true
  • powerPollingSupported : true
  • lastResetEnergy : 0.0
  • voltagePollingSupported : true
  • driverVersion : 1.9.3 2024/04/07 8:37 AM
  • switchDebouncing : false
  • currentPollingSupported : true
  • model : 3RSP02028BZ
  • destinationEP : 01

Strangely, the second plug I have did not have a doubling of it's energy cost value after updating, but the value did not change - it is still incorrect.

1 Like

@kkossev, could you add this device - https://vi.aliexpress.com/item/1005005725291219.html

endpointId: 01
application: 70
inClusters: 0000,0003,0004,0005,0006,000A,E000,0702,0B04,1000,1888
manufacturer: _TZ3000_ww6drja5
model: TS011F
outClusters: 0019

I added the fingerprint to your driver and everything is working.

1 Like

@Lamda, you are right. The ThirdReality US plug 3RSP02028BZ had the wrong energy divisor in this driver. It has now changed from 1,000 to 3,600,000.

Please manually update the driver to ver. 2.0.0 2024-11-30 (dev. branch) :

  • HE platform ver 2.4.0.x improved compatibility;
  • added rtt measurement in ping();
  • added TS011F _TZ3000_ww6drja5;
  • ThirdReality 3RSP02028BZ Energy divisor set to 3600000

@antti202 thank you for the fingerprint details!

2 Likes

I just bought an Aqara H2 socket, and although I could not find support for it on Hubitat, this driver will actually work with it, at least turn it off and on again.

However, it does produce a lot of WARN entries in the log and the device page will not list application, manufacturer or model.

Is there a chance that your driver could be adapted to provide more support for this one?

Here is some log information:

This driver was built primarily for Tuya single sockets, it does not have support for Aqara-specific devices...

Have you tried one of the available Aqara drivers listed here ?

1 Like