-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support for OWON PC321 3-phase Clamp Power Meter #9525
Comments
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days |
Still need support for my OWON Power Meter. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days |
Hello, I also own this device but am struggling to configure an external converter for it... I'd be happy to help, if somebody would be able to provide guidance on this ;) Received Zigbee message from '0x3c6a2cfffed1a7d2', type 'attributeReport', cluster 'seMetering', data '{"12288":2318,"12544":0,"16384":[0,0],"16640":[0,0],"16644":0,"8192":2,"8448":0}' from endpoint 1 with groupID 0 |
Hello, I sold my meter since I no longer had any use for it, but before I did, I asked the manufacturer for the protocol spec's which I got, but only after signing a Non Disclosure Agreement which stipulates I cannot share the document with anyone. My suggestion is that you request the protocol specification from the manufacturer. I sent my request to: sales@owon.com and info@owon.com and got a reply from their outfit in Canada. I'm not at liberty of sharing their names and e-mail addresses, but I'm sure they will reply to you promptly which they did to me. |
Hi FoxConsult, Uon searching on the device, I found the following repository which contains basically all that is needed to integrate the device : What I don't know however, is how to use the external converters for that, as to me it seems that the seMetering cluster definition of Z2M has to be extended to fully support this device. Also, to test it I guess I have to (re)compile the whole Z2M project with the updated clusters.ts file ? Or can I simply edit a file on my Z2M instance ? Hello @Koenkk, sorry to disturb you but if you could shed some light/point me towards the right direction... ;) |
It seems the device is using non standard attributes and therefore zigbee2mqtt doesn't know what the device means with e.g. |
I see you added the manufacturer specific attributes, you can create a new converter which converts these to MQTT.
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const ota = require('zigbee-herdsman-converters/lib/ota');
const e = exposes.presets;
const ea = exposes.access;
const fzLocal = {
PC321_metering: {
cluster: 'seMetering',
type: ['attributeReport', 'readResponse'],
convert: (model, msg, publish, options, meta) => {
const payload = {};
// TODO: add the other attributes here
if (msg.data.hasOwnProperty('owonL1Energy')) {
payload.energy_l1 = msg.data['owonL1Energy'];
}
return payload;
},
}
}
const definition = {
zigbeeModel: ['PC321'],
model: 'PC321',
vendor: 'OWON',
description: '3-Phase Clamp Power Meter',
toZigbee: [],
fromZigbee: [fz.metering, fzLocal.PC321_metering],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['seMetering']);
await reporting.readMeteringMultiplierDivisor(endpoint);
await reporting.instantaneousDemand(endpoint, {min: 5, max: constants.repInterval.MINUTES_5, change: 2});
},
exposes: [e.voltage(), e.power(), e.current(), e.energy()],
};
module.exports = definition; |
Many thanks Koenkk for the converter template. I added it and switched to the dev branch, but Z2M fails to start, returning the following error:
Following the template, if I wanted to expose the phase 1 energy, e.energy_l1() into exposes would be enough ? Sorry for all those questions, I am not really familiar with nodejs.. |
Updated #9525 (comment), should be fixed now. |
It works ! I even managed to have the attributes exposed to Home Assistant using a new numeric() definition in the 'exposes' array. There are a couple minor issues left, for which I am pretty much clueless for now...
I fixed the first two by dividing the data before storing it to the payload, but that does not seem the right way to do :) Z2M also reports some errors, most likely while trying to get the multiplier/divisor values which could be related to some of the issues faced ? Here is the error message : And here is my external converter :
|
Try adding the following line at the top of your file: |
Hi Koenkk, It improved but now Z2M goes into timeout trying to configure the device, here is the error :
I am all ears (and fingers) to try to improve this ;) |
What is you replace const payload = [{
attribute: 'owonL2Energy',
minimumReportInterval: 5,
maximumReportInterval: 3600,
reportableChange: 0,
}];
await endpoint.configureReporting('haElectricalMeasurement', payload); |
Hi Koenkk, it still fails, but with another error
|
@Phil-ibert is the on the latest z2m dev? (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html) |
I am currently running 1.25.0-dev commit: 91d80f1 I'll upgrade to the latest, see if there is any improvement |
After upgrading to the last dev version no error messages anymore, you rock Sir ! |
Hi, |
Hi Ano10, I managed to get most of the data reporting working, only the network frequency is not reported but it seems to be on the device side. However, I did not know how to configure Z2M in order to set up the writable attributes such as the report frequency or threshold. |
@Phil-ibert you will be able to write any value via the dev console (frontend -> click on your device) |
Hi, i have tried to install it to Zigbee2Mqtt (into Home Assistant) . Home assistant 2022.6.2 i have added a file ( OWONPC321.js ) into the config dir, with the content of post #9525 Item is now 'supported' :) but i have this errors : on the exposed value , i have only ( in french ) (in french , 'sans valeur' is 'no value' in english ) thank's |
Hi Zekje, here is my custom converter :
I have a pending pull request for the device to be supported natively by Z2M, it may be closed soon ;) |
Hi Koenkk, when I try to use the console dev, I get an "Unsupported_attribute" error, even on data items that are already reporting correctly |
@Phil-ibert some adjustement needed , but not important . |
@Koenkk Model: OWON PC321-Z-TY I have added a file ( 321-z-ty.js ) into the config dir, with the content of post @Phil-ibert :
but i have this errors : Zigbee2MQTT:info 2022-10-28 20:09:57: Configuring 'Energy' please help me |
@zekje @Phil-ibert sorry I did not respond, does the device work well with the external converter? |
Hi @Koenkk |
Sorry i am not at home, i Can answer today with my working configuration
Le mar. 1 nov. 2022, 12:44, dokkomp ***@***.***> a écrit :
… Hi @Koenkk <https://github.com/Koenkk>
@zekje <https://github.com/zekje> @Phil-ibert
<https://github.com/Phil-ibert> Guys don't answer(.
Can you help me with my problem?
Please)
—
Reply to this email directly, view it on GitHub
<#9525 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHBIBLQMOCZV42F43ISJLVLWGD7BVANCNFSM5HONYNRQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi @dokkomp, My apologies for the late reply. Regarding the frequency, the documentation of the device says it reports it through a specified attribute, but it actually does not report anything for that... As to the power source, it is actually working into the code I pushed to the official repository. Today, all you need is to have an up to date Z2M version (1.28 at least ?) |
I have the latest version now 1.28.1-1 |
This error is in regard of a Tuya switch, not the OWON PC321 You should already see your power meter device, provided that you paired it with Z2M ? |
@Phil-ibert how do i add it now in z2m? |
You just have to follow the usual pairing process :
Please note that the PC321-TY is wifi and the PC321-Z-TY is Zigbee |
@Phil-ibert |
What does the "exposes" tab shows for your device ? How did you wire it in your electrical installation ? |
Without an external converter: With the external converter from the post above: |
Maybe the PC321-Z-TY is different than the PC321 that I have ? Because mine is working as expected with the default converter maybe @Koenkk can help out on this, I believe some debug logging of the device could be helpful ? |
@dokkomp this is a completely different device, please fill in the "New device support request" https://github.com/Koenkk/zigbee2mqtt/issues/new/choose |
Hi, is this pc321 suppose to work well in both direction I’d used to monitor house energy having solar panel ? (We can inject energy to grid , and the opposite when no sun) I think it’s not ok in energy Dashboard home assistant |
Please add the OWON PC321 3-phase Clamp Power Meter
Information about the device + link
Description: ZigBee 3-Phase Clamp Power Meter (80A/120A/200A/300A)
Model: PC321
Vendor: OWON Technology Inc.
ZigBee Profile: ZigBee HA1.2
Exposes: Irms, Vrms, Active Power & Energy, Reactive Power & Energy
Vendors product description:
https://www.owon-smart.com/three-phase-clamp-measuring-equipment-energy-power-clamp-pc321-2-product/
Thanks
Update:
Here is my altered owon.js where i copied WSP404 to PC321, removed the switch stuff like on_off and changed the WSP404 line "exposes: [e.switch(), e.power(), e.energy()]," to "exposes: [e.voltage(), e.power(), e.current(), e.energy()],":
const exposes = require('../lib/exposes');
const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
const tz = require('../converters/toZigbee');
const constants = require('../lib/constants');
const reporting = require('../lib/reporting');
const e = exposes.presets;
module.exports = [
{
zigbeeModel: ['PC321'],
model: 'PC321',
vendor: 'OWON',
description: '3-Phase Clamp Power Meter',
fromZigbee: [fz.metering],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['seMetering']);
await reporting.readMeteringMultiplierDivisor(endpoint);
await reporting.instantaneousDemand(endpoint, {min: 5, max: constants.repInterval.MINUTES_5, change: 2});
},
exposes: [e.voltage(), e.power(), e.current(), e.energy()],
},
{
zigbeeModel: ['WSP404'],
model: 'WSP404',
vendor: 'OWON',
description: 'Smart plug',
fromZigbee: [fz.on_off, fz.metering],
toZigbee: [tz.on_off],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
await reporting.onOff(endpoint);
await reporting.readMeteringMultiplierDivisor(endpoint);
await reporting.instantaneousDemand(endpoint, {min: 5, max: constants.repInterval.MINUTES_5, change: 2});
},
exposes: [e.switch(), e.power(), e.energy()],
},
The data coming back from the PC321 meter is:
Nov 6 20:11:14 raspberrypi-4 npm[32041]: #33[32mZigbee2MQTT:info #33[39m 2021-11-06 20:11:14: MQTT publish: topic 'zigbee2mqtt/0x3c6a2cfffed0d65c', payload '{"linkquality":123,"power":0}'
Nov 6 20:11:14 raspberrypi-4 npm[32041]: #33[34mZigbee2MQTT:debug#033[39m 2021-11-06 20:11:14: Received Zigbee message from '0x3c6a2cfffed0d65c', type 'attributeReport', cluster 'seMetering', data '{"12288":2334,"12544":0,"16384":[0,142],"16640":[0,0],"16644":0,"8192":0,"8448":0}' from endpoint 1 with groupID 0
Nov 6 20:11:15 raspberrypi-4 npm[32041]: #33[34mZigbee2MQTT:debug#033[39m 2021-11-06 20:11:15: Received Zigbee message from '0x3c6a2cfffed0d65c', type 'attributeReport', cluster 'seMetering', data '{"12289":5,"12545":0,"16385":[0,141],"16641":[0,0],"16645":0,"8193":0,"8449":0}' from endpoint 1 with groupID 0
Nov 6 20:11:16 raspberrypi-4 npm[32041]: #33[34mZigbee2MQTT:debug#033[39m 2021-11-06 20:11:16: Received Zigbee message from '0x3c6a2cfffed0d65c', type 'attributeReport', cluster 'seMetering', data '{"12290":5,"12546":0,"16386":[0,142],"16642":[0,0],"16646":0,"8194":0,"8450":0}' from endpoint 1 with groupID 0
Nov 6 20:12:16 raspberrypi-4 npm[32041]: #33[34mZigbee2MQTT:debug#033[39m 2021-11-06 20:12:16: Received Zigbee message from '0x3c6a2cfffed0d65c', type 'attributeReport', cluster 'seMetering', data '{"12547":0,"16643":[0,0],"8451":0,"currentSummDelivered":[0,425],"instantaneousDemand":0,"status":0}' from endpoint 1 with groupID 0
And this is how the PC321 looks in my Domoticz installation:
Unfortunately, I am stuck here not having the neccesary knowledge to make the PC231 Power Meter work.
Added 2021-11-16:
Instead of using t he WSP404 as basis I tried the 'EMIZB-132' from the develco.js file since the 'EMIZB-132' has 3-phase power measurement, added the line const "ea = exposes.access;" to my owon.js file as well as this:
but get this error
2021-11-16 13:45:58.052 Error: Zigbee2MQTT: 0x3c6a2cfffed0d65c: can not process numeric item "current_phase_b"
2021-11-16 13:45:58.052 Error: Zigbee2MQTT: 0x3c6a2cfffed0d65c: can not process numeric item "voltage_phase_b"
2021-11-16 13:45:58.052 Error: Zigbee2MQTT: 0x3c6a2cfffed0d65c: can not process numeric item "current_phase_c"
2021-11-16 13:45:58.052 Error: Zigbee2MQTT: 0x3c6a2cfffed0d65c: can not process numeric item "voltage_phase_c"
The device reports energy and power usage, but with a negative value:
I have emailed Owon and asked for a copy of the protocol, but unfortunately, no answer.
The text was updated successfully, but these errors were encountered: