Hello @reneklomp
You wrote:
Is there a reason the Instantaneous Currents for L1, L2, L3 are not supported in Domoticz?
@waltervl said that it depends on the version of the Smart meter Protocol DSMR 4.2.2 or DSM 5.0.2.
Also in version 4.2.2 of the protocol Amperes are supported. It has nothing to do with the protocol differences between 4.2.2 and 5.0.2
The reason is that in the Dutch version the accuracy is considered insufficient. In the Dutch version the Current Consumption and Current Delivery for each phase are rounded to an integer value.
Therefore you can find in the source code (
https://github.com/domoticz/domoticz/bl ... erBase.cpp) on line 318 to 323 the following:
/* The ampere is rounded to whole numbers and therefor not accurate enough
//we could calculate this ourselfs I=P/U I1=(m_power.powerusage1/m_voltagel1)
if (m_bReceivedAmperage) {
SendCurrentSensor(1, 255, m_amperagel1, m_amperagel2, m_amperagel3, "Amperage" );
}
*/
I calculated the currents for each phase myself, years ago in Node Red, as automatically, if you have Node Red and MQTT installed, the values are available. It is just Domoticz MQTT input node and a Function node to Domoticz MQTT Output node.
The contents of the Function node is as follows:
Code: Select all
//Read all 3 Line Voltages
if (msg.payload.name == "Voltage L1") {
flow.set("U1", msg.payload.svalue1);
}
if (msg.payload.name == "Voltage L2") {
flow.set("U2", msg.payload.svalue1);
}
if (msg.payload.name == "Voltage L3") {
flow.set("U3", msg.payload.svalue1);
}
// Current Consumption and Current Delivery
// Phase L1
if (msg.payload.name == "Power Consumption L1") {
flow.set("PC1", msg.payload.svalue1);
msg.payload = {"command":"udevice","idx":240,"nvalue":0,"svalue":parseFloat((flow.get("PC1"))/(flow.get("U1"))).toFixed(3)};
msg.topic = "current_consumption_L1";
return msg;
}
if (msg.payload.name == "Power Delivery L1") {
flow.set("PD1", msg.payload.svalue1);
msg.payload = {"command":"udevice","idx":243,"nvalue":0,"svalue":parseFloat((flow.get("PD1"))/(flow.get("U1"))).toFixed(3)};
msg.topic = "current_delivery_L1";
return msg;
}
// Current Consumption and Current Delivery
// Phase L2
if (msg.payload.name == "Power Consumption L2") {
flow.set("PC2", msg.payload.svalue1);
msg.payload = {"command":"udevice","idx":241,"nvalue":0,"svalue":parseFloat((flow.get("PC2"))/(flow.get("U2"))).toFixed(3)};
msg.topic = "current_consumption_L2";
return msg;
}
if (msg.payload.name == "Power Delivery L2") {
flow.set("PD2", msg.payload.svalue1);
msg.payload = {"command":"udevice","idx":244,"nvalue":0,"svalue":parseFloat((flow.get("PD2"))/(flow.get("U2"))).toFixed(3)};
msg.topic = "current_delivery_L2";
return msg;
}
// Current Consumption and Current Delivery
// Phase L3
if (msg.payload.name == "Power Consumption L3") {
flow.set("PC3", msg.payload.svalue1);
msg.payload = {"command":"udevice","idx":242,"nvalue":0,"svalue":parseFloat((flow.get("PC3"))/(flow.get("U3"))).toFixed(3)};
msg.topic = "current_consumption_L3";
return msg;
}
if (msg.payload.name == "Power Delivery L3") {
flow.set("PD3", msg.payload.svalue1);
msg.payload = {"command":"udevice","idx":245,"nvalue":0,"svalue":parseFloat((flow.get("PD3"))/(flow.get("U3"))).toFixed(3)};
msg.topic = "current_delivery_L3";
return msg;
}
In a later stadium this Dutch Smart Meter protocol has been adapted in other countries, but with modifications. In the Flemish Part of Belgium they use the P1 Companion Standard 5.02. but with the extension eMucs, which has currently reached version 1.5. You can download this at:
https://maakjemeterslim./be.
As also said in the other thread, where you recently raised a question, you have a problem as, if you have seen above, you need both the Power and the Voltage for each Phase. Also @waaren suggested a nice dzVents script, but also that script need both the Power and Voltage for each Phase.
This Power for each Phase is not available in the protocol eMUCS 1.4 and earlier.
However from eMucs 1.5 you have:
Addition of power per phase.
In the eMUCS specifications they use also 2 digits after the comma, instead of none, as in The Netherlands.
That's why a lot of questions from Belgian users are coming to include the Current. Indeed it would help them much as they do not have the Power per Phase available and so not able to calculate in themselves.
But I suggest not to hijack this thread, as it started with questions from a Swedish user, where they use also the P1 protocol, but again with different OBIS references.
Best regards