New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Findings while trying to add a Sunricher 2-wire dimmer (retrofit) #2829
Comments
You need to remove the resources through the API (using DELETE
To create the
Probably because you haven't reset the dimmer, and it has retained the bindings and attribute reporting. Could also be that they're whitelisted on cluster, mac address, and/or manufacturer code, and the model id isn't used for that.
It's the info from the basic descriptor: device type, endpoint, server clusters, client clusters and profile. |
Thanks for your answer and time. I will give deleting through the API a try. I was hoping upon a cascade delete of (sub)devices when the actual device is removed. Doesn't seem logical to leave them around imho. :-) In regards of the whitelisting, I get it. For my dimmer it probably also needs some more code changes/whitelists, as I understand from you. For instance: I needed to do the pairing twice, or pair only via Sensors and get the
That's correct, I didn't reset the dimmer. Can you, or someone else, make the correct code-changes for this dimmer module? So that the Sensors appear, bindings are done and the right conversion for the values returned from the Metering and Measurement cluster? I'll try to supply as much additional information as possible below. There are 3x Ikea Ledare LED GU10 lights of 7,5W each behind this dimmer. The values from the screenshot's are:
Are you or anyone else willing to make the right updates in the code in the right places? |
@SwoopX thanks for adding! The correct ones are as follow for both identical built-in-dimmers:
There both from Silicon Laboratories. Triple checked them this time, sorry for the inconvenience. I saw that you made the calculations as well. They do seem to defer on what I thought was right, shown just above this post. If I use the changes that you propose, the following can be read in both the API and deCONZ: ZHAConsumption
ZHAPower
It seems that I'm now missing the precision due to the rounding. I see that in a couple of more comments on other issues as well. Still can't make sense of the numbers though, in particular the current. Thanks for helping! |
Haven't noticed that one so no worries ;)
Without explaining the mechanism behind it, that's kinda normal in that particular case. What most likely will not work out of the box is the attribute reporting and eventually calculation of values without any code changes. For the values you mentioned, I'm not sure if I can follow you here. Yes, you loose precision rounding as internally, integers are used instead of floats. Although it sounds comparable easy, a change is far from it so I'm afraid that's currently one death to live with. For the adequacy of the reported values from the devices, that's just what they are. However, please take note of the units the REST API reports upon. Consumption is in Wh, power in Wh, current in mA and voltage in V. |
Thanks, yeah you put effort in adding support for the devices I noticed, but I provided the wrong MacPrefix at first. Tried to be as complete as possible though, hehe. You got the right ones now!
I'll explain it with some live readings. I'm looking at the original dimmer (ROB_200-011-0) within the deCONZ GUI. Under the If I understand you right, this is 45464 mA. That would be 45,464 Ampère! Lets do another reading, this time under the This would be 965 Wh according to your info above. Looks also a bit much to me, as behind this dimming module there is a lamp wit 3 GUI10 LED lights of 7.5W, 600 lm each :) I'm getting nuts from these numbers...
The precision part I understand now. I see that this is the case with the A possible solution would be to provide the (full) integer value as deCONZ does, in my case, and also expose the divider/multiplier through the API so clients consuming the API can do there own calculation(s) or not. Although this would be a breaking change I guess? |
Sorry, totally forgot to come back on this.
That's indeed rubbish. The value got multiplied by 1000 instead of kept as is. I'll have it covered by a new commit. For the other remarks on the values, I'm afraid I cannot really follow you. There's indeed some math to be done with the values presented in deconz GUI, but your calculations seemed to be pretty much correct up here #2829 (comment). However, for the power calculation, your device does only offer the values displayed + I don't get where the 200 came from. Please do not forget that most devices have a measurement accuracy of +-5% or so, so stuff never adds up perfectly. Does that make it a bit clearer? |
Excuse the delay here also. Thank you for explaining. I've updated to the latest (dev) release and it looks better now. Unfortunately our MAC-prefix mistake is still present in this release. The prefix Secondly, can you also add the non-whitelabel version? It seems not yet in the code. It's MAC address is different and not yet defined in the source-code, but is also from the same MAC vendor, Silicon Laboratories. All info below for both identical dimmers for your convenience:
See also my previous comment: #2829 (comment) 😁 Thanks! |
Closing this as device is now supported with .79 beta. |
First off, thanks for the new release and the new up-to-date Wiki documentation!
I've bought some 2-wire built-in dimmer modules, quite similar to #1124 (comment). They're whitelabel Sunricher modules under different names like iCasa, Iluminize, yphix, Lubeez, Relicus etc. If I'm not mistaken the one that @ebaauw got is a Sunricher SR-ZG9101SAC-HP.
Mine is labeled
ROB_200-011-0
and is a Sunricher SR-ZG9040A Built-in Micro Smart Dimmer in disguise. It's supported out of the box in deCONZ, but the Simple Metering and Electrical Measurement cluster aren't exposed in the API.I've added the following line to the whitelist in
de_web_plugin.cpp
to expose the metering:After compilation you will get:
/sensors
(ZHAPower)/sensors
(ZHAConsumption)I'm not yet sure what
state.current
does within ZHAPower. It looks like some mA conversion from RMSCurrent (0x0508) within the Electrical Measurement Cluster (0B04), but the numbers don't completely add up.Looking at the AC Power Divisor (0x0605) of 10, the Active Power seems to be in deciWatt.
To whitelist or not to whitelist
After the above source modification, recompilation and Add new sensor via Phoscon, the API finds the new Sensors. When I put back the default API (
libde_rest_plugin.so
: v1.16.0) from the debian-sources, these new parameters (ZHAConsumption & ZHAPower) are still there and keep updating. Makes me wonder why whitelisting via source-code is needed in the first place. You will also get now theswversion
in the API for these two new parameters. So that's different too. Lets take it a step further.Removing the actual device from the network does not remove the two new parameters in
/sensors
. The result from deCONZ and Phoscon regarding removal doesn't change this fact. The only way to remove these seems to be deleting the rows in thezll.db
sensors table from the SQLite file.I've reset the whole network and started from scratch with the shipped API and added the Micro Dimmer in this clean network.
Then I shut down deCONZ and opened a SQLite editor. Subsequently added the following two rows in the
zll.db
database:After that the dimmer gets the
/sensor
endpoints and all works well. They also keep updating. This makes me even more wondering why there is a whitelist :-)I couldn't figure out what the
fingerprint
column represents, but besides that this means you can add these "power" sensors on-the-fly. Curious what others think.So, anyone that completely understands the codebase, please feel free to add this awesome module the right way, and maybe get the conversion of
state.current
correctly!While I'm at it (as feedback via e-mail has no success):
--dbg-info=1
increases fonts and colors of the GUI.lumi.sensor_magnet
device which works, but again you only know that after you buy it./usr/bin/deCONZ-WIFI2.sh
needs to be active on a RPI with Conbee II?The text was updated successfully, but these errors were encountered: