Driver for Zigbee Tuya Power Monitoring

I purchased a whole house zigbee power monitor from aliexpress. It came with 2 phase 80CTs and I've been able to pair it with the power outlet driver (after removing one of the tuya light bulb entries)

This is the description in Aliexpress "Tuya Smart ZigBee Energy Meter Bidirection 1, 2 Channel with Current Transformer Clamp App Monitor Power 80A 110V/240V 50/60Hz"

This is what spits out at the pairing process.

Manufacturer: _TZE204_81yrt3lo
Endpoint 01 application: 4A
Endpoint 01 endpointId: 01
Endpoint 01 idAsInt: 1
Endpoint 01 inClusters: 0004,0005,EF00,0000
Endpoint 01 initialized: true
Endpoint 01 manufacturer: _TZE204_81yrt3lo
Endpoint 01 model: TS0601
Endpoint 01 outClusters: 0019,000A
Endpoint 01 profileId: 0104
Endpoint 01 stage: 4
Endpoint F2 application: unknown
Endpoint F2 endpointId: F2
Endpoint F2 idAsInt: 242
Endpoint F2 initialized: true
Endpoint F2 manufacturer: unknown
Endpoint F2 model: unknown
Endpoint F2 outClusters: 0021
Endpoint F2 profileId: A1E0

The quantities reported do not make sense. Does anybody have a driver for this?

1 Like

Got an Aliexpress link?

Maybe try this?

1 Like

I've quickly checked the Tuya driver code - it will not work with this particular device.

Here we have the same problem as with the mmWave radars - too many different manufacturers in China, everyone using a different set of 'data points' that require changes in the custom driver code... : (

@user6451 if you don't want to go the Home Assistant route (this device is already supported in Zigbee2MQTT), the alternative is to wait (probably a few months) until a new custom driver becomes available in Hubitat.

If your device looks like a switch puck with two CT's that's likely not actually a 2 phase monitoring device. That's potentially just a two channel device.

Yes, this is a two channel energy monitoring device - measures voltage, current, power, energy, and the power factor for the two channels. The energy is reported separately for the forward and the reverse directions. Tuya 'Data Points' are listed here.

image

https://www.aliexpress.com/item/1005005782430275.html

1 Like

I'm interested on it, have you found a way to use it? On smartthings they're able to use but they're using edge driver so I don't know how to find them, I can put the edge driver link of someone is able to find them.

@miki5787 do you have this device? It could be added to the Tuya Metering Plug driver, however the second channel will use custom attributes for the power and energy reporting, which is something I am trying to avoid. And this is old driver code which becomes more and more difficult to support after adding a bunch of non-standard devices into it.

About the Generic EF00 edge driver ... see what Mariano is saying about its complexity ..

I am trying to do something similar in the latest versions of the Tuya 4 In 1 driver, will see how it goes.

Next week I suppose to receive it and I'll try it

I just purchased one of these as a single channel from Ali Express. Should arrive in a week or two. I am willing to beta test a driver if you’ld like.

I also am interested in this device. My home is 99% Zigbee. The only Z-Wave device left is an Aeotec Home Energy meter.

I recommend supporting @kkossev, as he spends a lot of time on these drivers and is always willing to help.

2 Likes

hi,
I got Tuya ZigBee Smart Energy Meter KWh Power Monitor 3 Phase from aliexpress. Can anyone please help which driver it will work, i am using C8 hub.

https://www.aliexpress.com/item/1005005823551876.html?spm=a2g0o.productlist.main.25.17dd407eS8ZIMG&algo_pvid=6f7ce086-8d58-412f-b84c-59b96934f169&algo_exp_id=6f7ce086-8d58-412f-b84c-59b96934f169-12&pdp_npi=4%40dis!USD!123.52!57.53!!!880.38!410.01!%402103200617051295937702835ea618!12000034482712797!sea!AE!0!AB&curPageLogUid=7dWptC0GoRdp&utparam-url=scene%3Asearch|query_from%3A

This device will require a specific driver in Hubitat to support all three channels as child devices.

If any developer is willing to try writing such a HE-specific driver, I can help if needed.

Thanks for reply and support.

I picked up a 2 channel power monitor similar to that described above. Differences are manufacturer (_TZE200_rks0sgb7) and inClusters:"0000,0004,0005,EF00,FF66". There is also a line in the logs that reads "ZCL version:03"; I'm guessing this indicates Zigbee 3?
I'd rather not go the Home Assistant route, but unless someone comes out with an HE driver for this or can guide me on how to modify the existing Tuya driver (with 2500+ lines of code) I don't have any other options.

ZCL 3.0 means nothing in regard to whether a device will follow the Zigbee Home Automation (ZHA) 1.2 standards or not. A lot of Tuya devices do not .. : (

If you are using a lot of AliExpress stuff, the safest way to go is to have a HA 'çompanion', where all the new Tuya gadgets are usually added very quickly (in Zigbe2MQTT). Hopefully, in the near future with the inclusion of the Power and Energy monitoring in the Matter standard there will be alternative ways to bring these devices to Hubitat.

I have added this device to the current dev. branch version of the Tuya driver ver 1.9.0 2024/01/18 8:19 PM - you can update the driver clicking on the Import button within the HE driver editor, or directly from here.

Note, that only the first channel is expected to work - this driver is not suited for multi-channel devices.

Thanks kkossev. I updated the driver and while it shows energy used, for voltage and amperage it only shows n/a. Power is usually zero, although it occasionally changes to 93.1. The logs do show this error message:
"groovy.lang.MissingMethodException: No signature of method: user_driver_kkossev_Tuya_Zigbee_Metering_Plug_1827.currentEvent() is applicable for argument types: (java.math.BigDecimal) values: [0.06] on line 1356 (method parse)"

Ideally I would like to see current or power from this device.Again, I appreciate your help on this.

I have found a bug in the code, fixed in new dev. branch version 1.9.1 2024/01/24 10:52 AM
It affects the amperage readings only. I still have no idea why the power readings are not shown.
Can you post some debug logs that include a keyword 'power' in the text (use Control-F on the live logs page to search for the text). I have also reduced the debug logs a bit so that it is easier to read.

I expect the Voltage, Frequency and PowerFactor to be working. If you see 'n/a', this means that these are disabled in the Preferences section - just enable these options there.

It may be a good idea to use both clamps (even if only clamp A should generate events), in case A/B is interpreted wrongly in the driver. Make sure you have active load > 10 watts ( a single LED bulb may have bad powerFactor and may not be detected by a 63A clamp).

I updated the code and it is moving things in the right direction. Voltage and amperage are now 0 instead of n/a and the error message is gone. I also extracted some lines from the logs that may be helpful.

dev:23882024-01-30 08:43:29.085 AMinfoPC311 power is 0.0 W
dev:23882024-01-30 08:43:29.083 AMinfoPC311 (103) Real Active Power : 0E+1 W (raw 0)
dev:23882024-01-30 08:43:28.085 AMinfoPC311 power is 93.2 W
dev:23882024-01-30 08:43:28.082 AMinfoPC311 (101) PJ1203A power_a : 93.2 raw (932)
dev:23882024-01-30 08:43:11.066 AMdebugPC311 (105) PJ1203A power_b : 1372.6 raw (13726)
dev:23882024-01-30 08:42:41.034 AMdebugPC311 (105) PJ1203A power_b : 1360.9 raw (13609)

dev:23882024-01-30 08:42:58.128 AMinfoPC311 power is 93.2 W
dev:23882024-01-30 08:42:58.125 AMinfoPC311 (101) PJ1203A power_a : 93.2 raw (932)

dev:23882024-01-30 08:43:04.134 AMdebugPC311 ignored powerFactorEvent (0) - reportPowerFactor is disabled
dev:23882024-01-30 08:43:04.131 AMinfoPC311 (110) PJ1203A power_factor_a : 0 raw (0)

dev:23882024-01-30 08:43:27.085 AMwarnPC311 map= [raw:catchall: 0104 EF00 01 01 0040 00 3A23 01 00 0000 02 01 0053020200040000048D, profileId:0104, clusterId:EF00, clusterInt:61184, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:3A23, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:02, direction:01, data:[00, 53, 02, 02, 00, 04, 00, 00, 04, 8D]]

dev:23882024-01-30 08:43:27.082 AMwarnPC311 Tuya unknown attribute: 0053=02=0200 data.size() = 10 value: 1165}

dev:23882024-01-30 08:43:28.075 AMdebugPC311 parse: description is catchall: 0104 EF00 01 01 0040 00 3A23 01 00 0000 02 01 005465020004000003A4

dev:23882024-01-30 08:43:27.080 AMdebugPC311 parse: Desc Map: [raw:catchall: 0104 EF00 01 01 0040 00 3A23 01 00 0000 02 01 0053020200040000048D, profileId:0104, clusterId:EF00, clusterInt:61184, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:3A23, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:02, direction:01, data:[00, 53, 02, 02, 00, 04, 00, 00, 04, 8D]]

dev:23882024-01-30 08:43:27.075 AMdebugPC311 parse: description is catchall: 0104 EF00 01 01 0040 00 3A23 01 00 0000 02 01 0053020200040000048D

dev:23882024-01-30 08:43:26.081 AMdebugPC311 Tuya switch event cmd=(01) value=938

dev:23882024-01-30 08:43:26.078 AMdebugPC311 parse: Desc Map: [raw:catchall: 0104 EF00 01 01 0040 00 3A23 01 00 0000 02 01 005201020004000003AA, profileId:0104, clusterId:EF00, clusterInt:61184, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:3A23, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:02, direction:01, data:[00, 52, 01, 02, 00, 04, 00, 00, 03, AA]]

dev:23882024-01-30 08:43:26.073 AMdebugPC311 parse: description is catchall: 0104 EF00 01 01 0040 00 3A23 01 00 0000 02 01 005201020004000003AA

dev:23882024-01-30 08:43:20.088 AMdebugPC311 attribute report: cluster=0000 attrId=0001 value=43 status=null data=null

dev:23882024-01-30 08:43:20.086 AMdebugPC311 parse: Desc Map: [raw:3A230100000A01002043, dni:3A23, endpoint:01, cluster:0000, size:0A, attrId:0001, encoding:20, command:01, value:43, clusterInt:0, attrInt:1]

dev:23882024-01-30 08:43:20.081 AMdebugPC311 parse: description is read attr - raw: 3A230100000A01002043, dni: 3A23, endpoint: 01, cluster: 0000, size: 0A, attrId: 0001, encoding: 20, command: 01, value: 43

dev:23882024-01-30 08:43:20.043 AMtracePC311 sendZigbeeCommands : [he raw 0x3A23 1 0x01 0x0000 {10 00 00 01 00}, delay 200]

I bought the gateway for the device to a) ensure that it is working properly and b) try using with the cloud integration for HA. As the screen shot shows, it does indeed work. The cloud integration for HA is not worth it for me because it only reports total energy and is pretty slow to respond. My ideal scenario is to access it directly from Hubitat, but if I'm not able to do that I plan to try a local integration for HA.

I now have it working in Home Assistant, bridged back to Hubitat.

I don't know if this information will help getting it working in Hubitat directly, but here goes for anyone interested:
When I first set it up in HA it was recognized as a PJ1203A which looks identical but didn't work (the results were the same as I was seeing with the Hubitat driver).
I then found specific support for it by adding an external converter created by KPfff, posted Oct 31, 2023. Here is a link to that thread. It is important to note that the ZHA integration won't work. You need to use Zigbee2MQTT Edge integration.

1 Like

I bought one of these as well - except mines blue! Maybe they ran out of white plastic that day. :wink:

When I first did the add device, it came up as a garage door opener!?
HE is reporting:

  • manufacturer: _TZE204_81yrt3lo
  • model: TS0601

I got this one in particular since it's 2 channel (and being in Canada, we are of course split phase 240) - and it's bidirectional - so I could then hopefully tell if my solar system is over generating and dumping back into the grid. I'm shooting for zero!

Only JUST hooked it up, and tried using the metered plug option. Seems that I'm at about 83hz, and I've used ~$8 of power in the last 15 minutes. Boy do I hope it's wrong. Ha ha....