Bonjour,
N’ayant pas trouvé de documentation comme demandé par @Loic, j’ai continuer mes recherches et mes tests.
J’ai réussi à rajouter ma commande dans mon équipement en modifiant un fichier de zigbee2mqtt.
Si cela peut aider quelqu’un, ci-dessous les modifications réalisées dans le fichier html/plugins/z2m/resources/zigbee2mqtt/node_modules/zigbee-herdsman-converters/devices/owon.js
Pour que les modifications soient prises en compte, j’ai supprimé le module dans Jeedom et arrêté le démon.
En début de fichier (juste après const fzLocal), j’ai rajouté ce code :
const tzLocal = {
PC321_clearMetering: {
key: ['clear_metering'],
convertSet: async (entity, key, value, meta) => {
const endpoint = meta.device.getEndpoint(1);
const group = 0xFFE0;
const command = 0x00;
const payload = {};
await endpoint.command(group, command, payload, {disableDefaultResponse: true});
meta.logger.info(`Sent clear command to ${entity.ieeeAddr}`);
},
},
};
Au niveau de l’équipement, j’ai modifié/ajouté le code (ci-dessous) :
toZigbee: [tzLocal.PC321_clearMetering],
e.enum('clear_metering', ea.SET, ['Clear']).withDescription('Clear measurement data'),
Le code complet :
{
zigbeeModel: ['PC321'],
model: 'PC321',
vendor: 'OWON',
description: '3-Phase clamp power meter',
fromZigbee: [fromZigbee_1.default.metering, fzLocal.PC321_metering],
toZigbee: [tzLocal.PC321_clearMetering],
exposes: [],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['seMetering']);
await reporting.readMeteringMultiplierDivisor(endpoint);
if (device.powerSource === 'Unknown') {
device.powerSource = 'Mains (single phase)';
device.save();
}
},
meta: { publishDuplicateTransaction: true },
exposes: [
e.current(),
e.power(),
e.power_reactive(),
e.energy(),
e.numeric('reactive_energy', ea.STATE).withUnit('kVArh').withDescription('Reactive energy for all phase'),
e.numeric('voltage_l1', ea.STATE).withUnit('V').withDescription('Phase 1 voltage'),
e.numeric('voltage_l2', ea.STATE).withUnit('V').withDescription('Phase 2 voltage'),
e.numeric('voltage_l3', ea.STATE).withUnit('V').withDescription('Phase 3 voltage'),
e.numeric('current_l1', ea.STATE).withUnit('A').withDescription('Phase 1 current'),
e.numeric('current_l2', ea.STATE).withUnit('A').withDescription('Phase 2 current'),
e.numeric('current_l3', ea.STATE).withUnit('A').withDescription('Phase 3 current'),
e.numeric('energy_l1', ea.STATE).withUnit('kWh').withDescription('Phase 1 energy'),
e.numeric('energy_l2', ea.STATE).withUnit('kWh').withDescription('Phase 2 energy'),
e.numeric('energy_l3', ea.STATE).withUnit('kWh').withDescription('Phase 3 energy'),
e.numeric('reactive_energy_l1', ea.STATE).withUnit('kVArh').withDescription('Phase 1 reactive energy'),
e.numeric('reactive_energy_l2', ea.STATE).withUnit('kVArh').withDescription('Phase 2 reactive energy'),
e.numeric('reactive_energy_l3', ea.STATE).withUnit('kVArh').withDescription('Phase 3 reactive energy'),
e.numeric('power_l1', ea.STATE).withUnit('W').withDescription('Phase 1 power'),
e.numeric('power_l2', ea.STATE).withUnit('W').withDescription('Phase 2 power'),
e.numeric('power_l3', ea.STATE).withUnit('W').withDescription('Phase 3 power'),
e.numeric('reactive_power_l1', ea.STATE).withUnit('VAr').withDescription('Phase 1 reactive power'),
e.numeric('reactive_power_l2', ea.STATE).withUnit('VAr').withDescription('Phase 2 reactive power'),
e.numeric('reactive_power_l3', ea.STATE).withUnit('VAr').withDescription('Phase 3 reactive power'),
e.numeric('power_factor_l1', ea.STATE).withDescription('Phase 1 power factor'),
e.numeric('power_factor_l2', ea.STATE).withDescription('Phase 2 power factor'),
e.numeric('power_factor_l3', ea.STATE).withDescription('Phase 3 power factor'),
e.enum('clear_metering', ea.SET, ['Clear']).withDescription('Clear measurement data'),
],
},
Penser à redémarrer le démon et synchroniser.
Un petit visuel, côté zigbbe2mqtt :

Côté Jeedom :
N’étant pas un spécialiste, c’est pour l’instant la seule solution que j’ai trouvée. Le problème (l’inconvénient), lors de chaque mise à jour les modifications sont effacées.
La prochaine étape est de trouver comment garder ces modifications en permanence, peut-être en regardant du côté des convertisseurs externe …