Frient EMIZB-151 does not provide produced energy
What happened?
The energy produced or fed back into the grid is not being delivered, even though the device is supplying it. (currentSummdelivered)
What did you expect to happen?
Add this numeric value
How to reproduce it (minimal and precise)
No response
Zigbee2MQTT version
1.42.0
Adapter firmware version
8.0.3.0
Adapter
box luna
Setup
Device database.db entry
No response
Debug log
No response
Notes
No response
I think this was added in https://github.com/Koenkk/zigbee-herdsman-converters/issues/10458 (CC: @Fabiancrg)
Hello, than you for the link. My knowledge is limited, but is it possible for me to integrate this feature through an update?
Hi @AJFproduction normally you should not have much to do so please give me your feedback after the next upgrade.
With pleasure, I'm eagerly looking forward to this update.
Just install; new commands appears but seems not working; 2.8.0 seems also still missing (but not real problem as 2.8.0 = 2.8.1 + 2.8.2)
When I tried to refrech value, I got this error. z2m: No converter available for 'energy_tier_1' on '0x0015bc001b1012db': ("") z2m: No converter available for 'energy_tier_2' on '0x0015bc001b1012db': ("") z2m: No converter available for 'produced_energy_tier_1' on '0x0015bc001b1012db': ("") z2m: No converter available for 'produced_energy_tier_2' on '0x0015bc001b1012db': ("")
EMIZB-151 latest F/W App: 0.0 build 3 // Stack: 0.1 build 7
Just upgraded to 2.6.3 and now I can see this:
Where Energy = Energy tier 1 + Energy tier 2
You also have Produced energy tier 1 and Produced energy tier 2 but not the sum, I will check if this can be added in next release. In the meanwhile, you can sum the two as produced energy in your home automation software.
Unfortunatly, not working for me.
So apparently there is a problem with the reporting configuration, I tried to remove/add the device and it's not working anymore. Reporting is sometimes only partially configured but most of the time not configured. If you want, you can use this external converter, create a folder /opt/zigbee2mqtt/data/external_converters and copy the file frient_EMIZB-151.js in it. After a restart of Zigbee2mqtt, everything should be back.
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const m = require('zigbee-herdsman-converters/lib/modernExtend');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const e = exposes.presets;
const ea = exposes.access;
const definition = {
zigbeeModel: ['EMIZB-151'],
model: 'EMIZB-151',
vendor: 'Frient',
description: 'Electricity Meter Interface 2 P1',
// Use the official modern extend for three-phase electricity meter (includes all calibration and precision)
extend: [m.electricityMeter({threePhase: true})],
// Add additional seMetering functionality for energy tariffs
fromZigbee: [
{
cluster: 'seMetering',
type: ['attributeReport', 'readResponse'],
convert: (model, msg, publish, options, meta) => {
const result = {};
// Additional energy measurements for tariffs (not covered by standard electricityMeter)
if ('currentSummReceived' in msg.data) {
result.energy_produced = Math.round(msg.data['currentSummReceived'] / 1000);
}
if ('currentTier1SummDelivered' in msg.data) {
result.energy_consumed_tariff1 = Math.round(msg.data['currentTier1SummDelivered'] / 1000);
}
if ('currentTier2SummDelivered' in msg.data) {
result.energy_consumed_tariff2 = Math.round(msg.data['currentTier2SummDelivered'] / 1000);
}
if ('currentTier1SummReceived' in msg.data) {
result.energy_produced_tariff1 = Math.round(msg.data['currentTier1SummReceived'] / 1000);
}
if ('currentTier2SummReceived' in msg.data) {
result.energy_produced_tariff2 = Math.round(msg.data['currentTier2SummReceived'] / 1000);
}
return result;
},
}
],
// Additional exposes for the extra seMetering attributes not covered by electricityMeter
exposes: [
e.numeric('energy_produced', ea.STATE).withUnit('kWh').withDescription('Total energy returned to the grid - OBIS 2.8.0'),
e.numeric('energy_consumed_tariff1', ea.STATE).withUnit('kWh').withDescription('Energy consumed in tariff 1 (peak/high) - OBIS 1.8.1'),
e.numeric('energy_consumed_tariff2', ea.STATE).withUnit('kWh').withDescription('Energy consumed in tariff 2 (off-peak/low) - OBIS 1.8.2'),
e.numeric('energy_produced_tariff1', ea.STATE).withUnit('kWh').withDescription('Energy produced in tariff 1 (peak/high) - OBIS 2.8.1'),
e.numeric('energy_produced_tariff2', ea.STATE).withUnit('kWh').withDescription('Energy produced in tariff 2 (off-peak/low) - OBIS 2.8.2'),
],
ota: true,
endpoint: (device) => ({default: 2}),
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(2);
// Bind seMetering cluster for the additional energy tariff measurements
try {
await reporting.bind(endpoint, coordinatorEndpoint, ['seMetering']);
} catch (error) {
// Binding can fail but device may still work
}
// Read metering multiplier/divisor
await reporting.readMeteringMultiplierDivisor(endpoint).catch(() => {});
// Configure the additional seMetering attributes for energy tariffs
const meteringAttributes = [
'currentSummReceived',
'currentTier1SummDelivered',
'currentTier2SummDelivered',
'currentTier1SummReceived',
'currentTier2SummReceived'
];
// Read the attributes initially
await endpoint.read('seMetering', meteringAttributes).catch(() => {});
// Configure reporting for energy tariff attributes
for (const attr of meteringAttributes) {
await endpoint.configureReporting('seMetering', [{
attribute: attr,
minimumReportInterval: 300, // Don't report more often than every 5 minutes
maximumReportInterval: 3600, // Report at least every hour
reportableChange: 1000 // Report when energy changes by 1 kWh
}]).catch(() => {});
}
},
};
module.exports = definition;
I will work on a fix for the existing converter.
Fisrt of all thank you for your support. My knwolege is limited.
Here’s what I did, but it doesn’t work:
(1) I created the file in /opt/... as root. → but it seems not correct. (2) I created a .txt file and then renamed it to .js. (3) I copied the code you gave me into it. (4) I restarted the dependencies of JeeZigbee2MQTT. (5) I tryed also this directory /var/www/html/plugins/zigbee2mqtt/resources/zigbee2mqtt/data/external_converters/
in that directory, the error is different, --> Cannot open the websocket;
my knowlede is very limited, but it seems when I restart the jeezigbee dependencies, the directory is scratched ... So may be I don't understand how to restart "restart Zigbee2mqtt" Could you also helpd me to find the good directory, I imagine /opt/ ... is not in the root ?
Thank you very much.
The directory is: /opt/zigbee2mqtt/data/external_converters
You might have to use sudo to create it so if the command
mkdir /opt/zigbee2mqtt/data/external_converters
returns Permission denied then use
sudo mkdir /opt/zigbee2mqtt/data/external_converters
then copy the content of the converter above (make sure you use the copy button)
nano frient_EMIZB-151.js
or if you had to use sudo to create the directory
sudo nano frient_EMIZB-151.js
and paste the code
use CTRL-x to save
Then restart zigbee2mqtt, preferably before restarting, you can remove the device, it will rejoin automatically after the restart once you permit joining.
If you cannot do that, if the directory disappear after restart, please let me know how you installed it (+platform)
OK, I have a box luna, so I have to use SSH. I'll try it. But if I remove the device, the command ID will change, which means I’ll need to update all the scenario code accordingly. So may be for me it is better to wait the fix. Thanks a lot for your help!
Which software are you using ?
I have different scenarios to manage annual, monthly, and daily energy using some PHP code. I use command numbers, so if I have to remove and pair the device again, the command number will change. This means I have to go through the code to make corrections.
For example: $v1 = cmd::byId(1260)->execCmd() *1000 ; // Production PV en Wh $v2 = cmd::byId(1117)->execCmd() ; // Production moyenne sur les 5 dernières minutes en W
I compute also data for pvoutput. (https://pvoutput.org/intraday.jsp?id=20913&sid=18792)
I can wait for a fix. Since my knowledge of the Jeedom architecture is limited, I'm hesitant to start this manual operation for fear of making things worse.
I won't be able to help you with that but I am working on the issue so hopefully I might get a fix soon
Many thanks for the good job.
I submitted two PR, one to add "Produced energy" and another to fix the data not being reported.
Reading the attributes using /get is still not working, I need to continue working on that but the automatic reporting is working so you can adapt the reporting settings if needed.
Manually added in the automatic reporting. Thanks a lot.
Solved with version 2.7.0 of MQTT; thanks.