-
Notifications
You must be signed in to change notification settings - Fork 509
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
OWON - Single/Three Phase Zigbee Power Consumption Meter #7010
Comments
Can you please add the screenshot of the clusters list ? |
Done |
Hello this device is triphase or work for 3 devices ? Can start with this DDF
It only enable the consumption for the moment. |
It registers consumption for 3 phases. I sold it already though, since it also needs a 3-phase power supply which is inconvenient for me. Hence I'm closing this ticket for now. |
Hi, Question 1: About value interpretationThe power datapoints (0x06, 0x07 and 0x08) have the datatype 0x00 (raw) with a 8 bytes data value. From my understanding, this data is formatted as follow:
This is not what I have seen implemented in other projects, but I am confident in these choices. Please correct me if you think I am wrong!
@Smanar answerThoses dpid are not used yet in the DDF, I prefer wait to see if the user is able to use them before spent time on them, and yes its 2 byte for Voltage, 1 ignored, 2 for current, 1 ignored and 2 for power (from Z2m) |
Question 2: About datatypesFrom deCONZ source code I see that Can I just set "datatype" to the correct value for each item in the DDF, or do I need to do anything more? I am asking because in the resource.cpp file I see lines like @Smanar answerdon't take care of type, the JS engine just need to generate a number (with JS code) deconz will convert it itself |
Question 3: DataPoints for which there is no generic item already defined in deCONZThis device provides datapoins for AC Frequency (in Hz) and Power Factor (in %). I could just ignore them for the moment, but what if want to take them into account? I doubt that I only need to create json files in devices/generic/items/ and add the item in resource.cpp and resource.h. Could anyone tell me what else need to be implemented? @Smanar answeron last deconz versio, if you want to create new field like like state/acfrequency, you don't need to edit c++ code only add a json |
Question 4: Work around a bug in the firmwareThis device has a faulty firmware giving erroneous values from time to time or in certain circumstences (high power usage or production). For example while the Power for phase C should be 0, it rerports a few times in an hour a value of 0x999998 (10066328 W) ; the Power A+B+C reports a value of 0x19999998 (not necessarely at the same time as the single phase reports erroneous value). There are already discussions about this bug in other projects with different solutions to overcome this issue, but none of them are fully satisfying (1, 2, 3...). After a lot of trial and error, I ended up proposing the following fix which gives good results after a few days using it:
let val = ZclFrame.at(13) | (ZclFrame.at(12) << 8) | (ZclFrame.at(11) << 16);
val = ZclFrame.at(11) == 0x99 ? -(val - 0x999998) : val;
Item.val = val; 0x999998 is the unexpected value I see when Power should be 0. When there there is Power usage, substracting 0x999998 gives a negative value, so I added the "-()" to invert the sign. Unfortanetly, I do not have solar panels to check if this is working as expected when there is power production.
I really don't know if it would be possible to compute the good value like this. So I ended up creating 3 items in the Power A+B+C device, one for Phase A Power, one for Phase B Power, and one for Phase C Power. Like this I have the values for all 3 phases available in this device and I just compute the sum in deCONZ instead of relying on the sensor value. Item.val = R.item('state/current_P1').val+R.item('state/current_P2').val+R.item('state/current_P3').val;
Do you think this proposed fix is acceptable or is it a bad idea to process like this? @Smanar answerfor the bugs in firmwares, how often it happen ? we can't just ignore some reports ? I think this device is talkative enought for we can skip some of them ? |
Based on the bug frequency, I agree that we could just ignore erroneous reports, as it happens a few times per hour. But unfortunatelly, the bug also arises in certain circumstances. For example, As soon as I start charging my EV car, which drains around 7KW, the bug is present on both Power C and PowerA+B+C during the whole time the car is charging. I am using this DDF since a few days, and I am satisfied with the results. However I need to make some adjustments for taking your answers into consideration. |
On the first TYPE_POWER_SENSOR, you make state/power = current P1 + current P2+ current p3 ? So to resume the firmware bug.
I can imagine the big number is just a signed/unsigned issue, the device probably reverse the current side on his measurement, but I don't see why you have the issue when charging your car, and with a persistent way? It happen if you have too a big consumption ? You haven't a sample with raw value ? Edit:
|
About the signed/unsigned convertion
will return 3. both value in fact |
Here is a file with sample data including raw values
|
Sorry, didn't see I forgot a part of my Discord message for question 4. I updated my post with the full text to make things more readable.
Yes I think the bug is becoming permanent as soon as the power usage is reaching a certain value. The car is using around 6.8KW while charging. I am still trying to reach a high value on my wall plug monitored by phase A, but for moment I couldn't reach more than 4KW with the devices I plugged in, and it didn't make the bug happened. |
I don't really understand what you meant on this post. 3 is hard coded in your function, so this is normal it always gives 3 whatever the arg1 value is. I believe that |
Oups sorry, wanna say for exemple
both give -2, but it's useless, was just a comment, you are making the same thing with substracting 0x999998
On your side you have only consumption? so you can't have negative value, the device reverse randomly value itself, making sum from device totaly unusable. As long as you haven't production (solar panel) I don't see what you can do better. |
Device
Screenshots
Node Info
Cluster List
Basic
Identify
Alarms
Device Temperature
Groups
Scenes
On/Off
Level Control
Color Control
Simple Metering
Diagnostics
Other clusters that are not mentioned above
Tuya specific
Hitting "Trigger report all datapoints" get the following in the log:
The text was updated successfully, but these errors were encountered: