I decided to dig into custom Zigbee drivers a little bit and was testing two out on my Sengled G2 (E1C-NB7). The recently published Third Reality driver does not support the correct cluster for the power reporting. Then I found out your driver here specifically supports this Sengled plug. After playing with the options a bunch I found out it supports Energy and Power. I don't need Energy so I turned that off. It automatically reports for wattage changes which is I how I had it setup before.
I noticed now that with debug logging on it is reporting energy stats about every 30-60 seconds (which the driver is ignoring because I have it off). I cannot seem to make it stop. Should the driver be disabling this? I do see some "Failed" messages in logs as well when saving settings but not totally sure what is failing. I think the best config will be for it to report on watt changes only, no automatic interval, and no polling.
I am comfortable making changes to the driver but there is so much in this universal driver (and I am new to Zigbee code) its hard to track things down.
This is probably my second Zigbee driver started initially a year and a half ago, and now the code needs serious refactoring, it became rather messy adding new stuff over time... : (
The driver was made for these Tuya plugs that do not report the power and the energy automatically, but require polling. Later I got some Tuya plugs that can be configured for automatic reporting, as well as one Frient plug to test with. I don't have any Sengled plugs, most of the other non-Tuya models fingerprints should be commented out in the code, I have added these while I have searched the net for information on other types of reporting plugs.
If the "Automatic Polling" option is switched off, the 'autoPoll' job should be unscheduled.. I will double check this again in the next days, this may not be working properly as almost all of my plugs require polling.
If you want to automatically report just the power and nothing else, make sure the " Automatic reporting configuration" option is switched on. Only then the reporting configuration command is sent to the device. However, I have not found yet how to disable the automatic reporting, if previously enabled. I will research in the next days, I think that the min/max/delta settings intended to disable the automatic reporting were somewhere in the ZCL specifications documents.
The 'Failed' debug log is for a Tuya specific initialization, that I can try to bypass when using the driver with non-Tuya pugs.
I have made some small changes in the dev.branch version 1.7.3, now if you enable only the power reporting, the Current States must be much cleaner - showing only the healthStatus, switch, and power. You may still see 'ignored voltage' or 'ignored energy' debug logs, as currently the driver refreshes once all the power cluster attributes several seconds after switching the plug on or off even if the periodic polling is disabled - this is to speed up the update of the power readings, as some plugs are too 'lazy' and send the zero power value long time after the plug was switched off.
Ok, looks like maybe if I turn automatic reporting on, and set both values to 0 it should make it stop. Will give it a try. I think eventually I am going to make a stripped down version for a very basic plug driver that supports my Sengled plugs and two non metering Sonoff plugs. But this gives me lots of sample code to work with!
If I had to start from scratch, I would use Jonathan's driver as a base. Much better and cleaner code .. : )
You can still use this driver for tests - if you set the debug constant to true in the code, you can experiment with different settings for the reporting configuration :
Seems like the different manufacturers have different understandings and different implementations of the standards. You can quickly check whether the Sengled plugs accept disabling of the automatic energy or other attributes reporting or now.
I just tried one of the ajax Zignito zigbee plugs, cheap from amazon, only just found this driver in above post (kkossev = cheers) HE C7
It certainly is what I was looking for to monitor a couple of fridges/freezers.
This should be it, BUT the last 2 I just purchased from the same seller has bad firmware ID _TZ3000_okaz9tjs which is documented in kkossev driver for tuya ZigBee metering plug.
I sent them back as faulty compared with the previous 2.
Tim, you are using an older version of this driver. This Samsung plug does not report Energy, so you can disable the energy processing. It should also report the power, voltage and amperage automatically, so you could probably switch the periodic polling option off. I don't have Samsung plugs, but you can experiment with settings like these :
Can you update to the latest dev. version (the link from the second post) and check whether the automatic reporting configuration ( power change threshold, minimum and maximum automatic reporting periods) works with your Samsung plug? Which model is it (there are at least 3-4 different Samsung models produced during the last years).
sorry it took a bit
i upgraded to ver. 1.7.4 2023-04-22 is that right?
What am I looking for again... and do I need to turn on debug?
in the normal logs is dev:1302023-05-11 08:27:33.668 AMinfoDryer voltage is 120 V
dev:1302023-05-11 08:12:32.970 AMinfoDryer voltage is 119 V
dev:1302023-05-11 07:40:38.933 AMinfoDryer voltage is 120 V