But based on the fromZigbee.js from herdsman (zigbee2mqtt), I cant find a custom code for it, so I’m guessing its using standard zigbee nodes.
Go into the hub events, and try and find the registration event, which should tell me which clusters of zigbee are available and adjust the code for the SP-EUC1,
OK this is weird… i tried at least 6 times pairing and it always works OK but i cant see in live logging or hub events any zbjoin event… actually hub events stay completely empty… there should be zbjoin event normally yes ?
This is the only event i can see related to SP-EUC01 outlet:
Configuring Reporting and Bindings, setting schedule and forcing first report
Did the zbjoin event info help in any way ? (sorry dont mean to rush things just making sure since i only updated my earlier msg and did not create new reply)
turn off the led between 9PM to 9AM! (this is great, it was annoying me like crazy when close to it in the dark)
charging protection! (if power is less than 2W for 30m, turn off) (it seems its a zigbee command setting on its own and not a automation)
I had to connect to AQARA Hub and re-pair to ST to use these functions…
Any chance to get lower refresh rate time? I use the Plug to tell if my TV is on or off for other automations and stuff like this is really important
Awesome work on the DTH, Thank you!
For the extra functionality, I haven’t had time to do the research required to enable the functions on ST (Also, every Xiaomi Zigbee plug has a different code/behaviour, and was only aware of the ZNCZ02LM one).
If you’re asking for the refresh of the ZNCZ02LM, unfortunately that’s a custom Xiaomi refresh message, so it cannot be changed.
As for forcing the refresh interval for any model try the following:
1.- remove the following from line 120:
runLocally: true, executeCommandsLocally: true
2.- add the following after line 157:
rates << [“1” : “Refresh data every 1 minute”]
3.- then, over the options, change the refresh to the newly added 1 minute option
I’m not entirely sure if it’ll work, as SmartThings from memory has a limit of zigbee/refresh messages a device can handle every X minutes/seconds.
Let me know of that is what you want and it works
As for your question:
What momentary button? Do bear in mind the only physical outlet I had to test around was the ZNCZ02LM.
Thanks for responding!
We have the exact same model number (ZNCZ02LM) and i seem to have a momentary button (could be from the previous DTH because I just switched and not re-pair)
When theres a “huge” surge in power (1 to 80) the plug will immediately update this info but when turning off the plug will take a minute or so I also did as you instructed.
Hmm yes, that’s probably from an old DTH, normally in those situations you delete the device, close the app, force stop in android, and clear cache, re-add the device, and the problem’s gone.
For the updates, yes its because of the Xiaomi custom refresh message, took me quite a while to understand and parse it’s logic as it’s very complicated and against the zigbee standard.
So yes i am now at least seeing power values… for example now laptop charger shows value 198 which should mean 19.8w to my understanding (value / 10)… unfortunately i am not seeing any energy values (debug is ON - no other than power related messages)
Example:
Aqara Zigbee EU Smart Outlet: Zigbee event extracted from description: [name:power, value:238]
Are you using the latest 1.7.2 from August? There was a fix for 0702 vs 0B04 that I did back then. did you clear the app cache after installing the new DTH version?
I’ve attempted to understand the lua code development but I decided to stop and throw it in a can until SmartThings can come up with better and more streamlined tutorials on how to understand how to code an edge driver, as the examples/reference docs I saw back then were ugly, badly commented, badly explained.
0702 is power and 0B04 is energy based on the standard Zigbee clusters, unless SP-EUC01 has a problem with the standard clusters (or I switched them back wrong in 1.7.1),
You can bypass this by switching the sendEvent parts in that part of the code you mentioned:
so switch the: sendEvent(name: “power”, value: xxxxxxxxx, unit: “W”)
with sendEvent(name: “energy”, value: xxxxxxxxxxxx, unit: “kWh”)
Edit 1: where xxxxxxxxx is the variables
Edit 2: and ofc change the debug log parts if you wish.
for me electrical measurement mean being able to measure, Watts, Amps, Volts,
also to me Simple metering means being able to meter, Wh, consumption calculated in two dimensions.
Edit 1: Note - Since the cluster library doesnt provide examples, and I’m not a native English speaker, and I keep finding people confusing Electrical measurement vs metering (and not a clear, example driven differentiation, and seeing multiple zigbee implementations reversing both, I have not a single source of truth that can tell me which one is which).