Page 1 of 1

All P1 Data Not Shown

Posted: Tuesday 02 March 2021 16:33
by torbjorb
Hi,

My P1 meter is a SAGEMCOM T211 from the power distributor Ellevio in Sweden. I tried using the "P1 Smart Meter USB" but only a few of the values show up. How can I get the full dataset? An example of my data is below.

Regards,

/Torbjörn.

/ELL5\253833635_A

0-0:1.0.0(210302151235W)
1-0:1.8.0(00012483.439*kWh)
1-0:2.8.0(00000000.244*kWh)
1-0:3.8.0(00000051.589*kvarh)
1-0:4.8.0(00000884.750*kvarh)
1-0:1.7.0(0002.879*kW)
1-0:2.7.0(0000.000*kW)
1-0:3.7.0(0000.000*kvar)
1-0:4.7.0(0000.433*kvar)
1-0:21.7.0(0002.292*kW)
1-0:41.7.0(0000.247*kW)
1-0:61.7.0(0000.340*kW)
1-0:22.7.0(0000.000*kW)
1-0:42.7.0(0000.000*kW)
1-0:62.7.0(0000.000*kW)
1-0:23.7.0(0000.000*kvar)
1-0:43.7.0(0000.000*kvar)
1-0:63.7.0(0000.000*kvar)
1-0:24.7.0(0000.141*kvar)
1-0:44.7.0(0000.107*kvar)
1-0:64.7.0(0000.184*kvar)
1-0:32.7.0(238.1*V)
1-0:52.7.0(237.9*V)
1-0:72.7.0(240.4*V)
1-0:31.7.0(009.6*A)
1-0:51.7.0(001.2*A)
1-0:71.7.0(001.9*A)
!C28E

Re: All P1 Data Not Shown

Posted: Tuesday 02 March 2021 17:17
by waltervl
What does the Domoticz log file say when reading the data? There could be errors.

Re: All P1 Data Not Shown

Posted: Tuesday 02 March 2021 17:27
by torbjorb
2021-03-02 16:17:27.968 Status: P1 Smart Meter: Meter is pre DSMR 4.0 - using DSMR 2.2 compatibility

This may be an incorrect assumption since my meter doesn't send any DSMR version. Is the only log thing related to the meter. I started peeking into the Domoticz source code, it looks like some of the values haven't been defined. Do I have to define my own P1 device?

Re: All P1 Data Not Shown

Posted: Tuesday 02 March 2021 18:54
by FireWizard
Hello @torbjorb

The P1 Smart Meter USB hardware in Domoticz has been based on the Dutch Smart Meter Requirements (DSMR). In the Netherlands we have now reached version 5.0.2. It has been made suitable for Belgium as well in a later stadium.

In a document of Lund University, which you can find at: https://www.iea.lth.se/publications/MS- ... Meters.pdf. you will see that the protocol looks very much to the DSMR protocol in The Netherlands.

And the difference is exact what you will be missing.

If I take your protocol and I add my comments after //:
/ELL5\253833635_A // Header information and Manufacturer specific

0-0:1.0.0(210302151235W)// Date & Time
1-0:1.8.0(00012483.439*kWh) // Unknown but probably Meter Reading electricity delivered to client in 0,001 kWh
1-0:2.8.0(00000000.244*kWh) // Unknown but probably Meter Reading electricity delivered by client in 0,001 kWh (Solar panels)
1-0:3.8.0(00000051.589*kvarh) // Unknown, reactive electricity delivered to client
1-0:4.8.0(00000884.750*kvarh) // Unknown, reactive electricity delivered by client
1-0:1.7.0(0002.879*kW) // Actual electricity power delivered (+P) in 1 Watt resolution
1-0:2.7.0(0000.000*kW) // Actual electricity power received (-P) in 1 Watt resolution
1-0:3.7.0(0000.000*kvar) // Unknown, reactive power delivered to client
1-0:4.7.0(0000.433*kvar) // Unknown, reactive power received by client
1-0:21.7.0(0002.292*kW) // Instantaneous active power L1 (+P) in W resolution
1-0:41.7.0(0000.247*kW) // Instantaneous active power L2 (+P) in W resolution
1-0:61.7.0(0000.340*kW) // Instantaneous active power L3 (+P) in W resolution
1-0:22.7.0(0000.000*kW) // Instantaneous active power L1 (-P) in W resolution
1-0:42.7.0(0000.000*kW) // Instantaneous active power L2 (-P) in W resolution
1-0:62.7.0(0000.000*kW) // Instantaneous active power L3 (-P) in W resolution
1-0:23.7.0(0000.000*kvar) // Next 6 OBIS references all unknown reactive component of the above
1-0:43.7.0(0000.000*kvar)
1-0:63.7.0(0000.000*kvar)
1-0:24.7.0(0000.141*kvar)
1-0:44.7.0(0000.107*kvar)
1-0:64.7.0(0000.184*kvar)
1-0:32.7.0(238.1*V) // Instantaneous voltage L1 in V resolution
1-0:52.7.0(237.9*V) // Instantaneous voltage L2 in V resolution
1-0:72.7.0(240.4*V) // Instantaneous voltage L3 in V resolution
1-0:31.7.0(009.6*A) // Instantaneous current L1 in 0,1 A (?) resolution. Not supported in Domoticz
1-0:51.7.0(001.2*A) // Instantaneous current L2 in 0,1 A (?) resolution. Not supported in Domoticz
1-0:71.7.0(001.9*A) // Instantaneous current L3 in 0,1 A (?) resolution. Not supported in Domoticz
!C28E // CRC Checksum
So, as you don't mention what you get in Domoticz and what not, let me guess:

You will see:
- Actual electricity power delivered (+P) in 1 Watt resolution
- Actual electricity power received (-P) in 1 Watt resolution (if you have solar panels)
- Instantaneous active power L1. L2 and L3 (+P) in W resolution
- Instantaneous active power L1. L2 and L3 (-P) in W resolution (if you have solar panels)
- Instantaneous voltage L1, L2 and L3 in V resolution
And if you are lucky:
- Meter Reading electricity delivered to client
- Meter Reading electricity delivered by client

So the conclusion will be:

The P1 Smart Meter in Domoticz will not support your Swedish Smart Meter.

We see that often, that for other functions this protocol is used.
Example, see post for city heating: viewtopic.php?f=4&t=35210&p=266567&hili ... rt#p266567

Also an (incomplete) version of the P1 protocol.

So if you want to have more values in Domoticz, you have to do it yourself and that is possible, e.g. MQTT and Node Red.

If you need more information or support with NR and MQTT, let me know.

[Added] All information, including the protocol, in Swedish and English can be found at:
https://hanporten.se/


Regards

Re: All P1 Data Not Shown

Posted: Tuesday 16 March 2021 10:18
by per42
Here's some info from ellevio's fact sheet for SAGEMCOM T211:

Sorry for swedish, but I figured better untranslated than no post. I suppose those who have this understands swedish anyway ;)

•1.8.0 Mätarställning Total (Förbrukad energi i kWh)
•2.8.0 Mätarställning Total (Producerad energi i kWh)
•1.8.1 Mätarställning Tariff 1/Höglast (Förbrukad energi i kWh)
•1.8.2 Mätarställning Tariff 2/Låglast (Förbrukad energi i kWh)
•1.7.0 Momentan effekt (Aktuell effekt i kW)

Re: All P1 Data Not Shown

Posted: Wednesday 17 March 2021 21:51
by FireWizard
Hello @per42,
I suppose those who have this understands swedish anyway
Yes, I can read Swedisch and Norwegian for approx 50-70%

Is the provided data correct and complete?
•1.8.0 Mätarställning Total (Förbrukad energi i kWh)
•2.8.0 Mätarställning Total (Producerad energi i kWh)
•1.8.1 Mätarställning Tariff 1/Höglast (Förbrukad energi i kWh)
•1.8.2 Mätarställning Tariff 2/Låglast (Förbrukad energi i kWh)
•1.7.0 Momentan effekt (Aktuell effekt i kW)
If I see the post of @torbjorb of 02 Mar 2021, 16:33 , I do not see the OBIS references:
•1.8.1 Mätarställning Tariff 1/Höglast (Förbrukad energi i kWh)
•1.8.2 Mätarställning Tariff 2/Låglast (Förbrukad energi i kWh)
In the link to https://hanporten.se/ I don't see those references either.

Vänliga Hälsningar :D

Re: All P1 Data Not Shown

Posted: Thursday 25 March 2021 8:23
by reneklomp
Is there a reason the Instantaneous Currents for L1, L2, L3 are not supported in Domoticz?
Is there a way to add these myself? Could you elaborate a bit more on the Node-Red and MQTT option for this?
I mean I know what they are but how can we use this to add more values coming from P1 port to Domoticz as you say?

Thanks, Rene.

Re: All P1 Data Not Shown

Posted: Thursday 25 March 2021 8:56
by waltervl
reneklomp wrote: Thursday 25 March 2021 8:23 Is there a reason the Instantaneous Currents for L1, L2, L3 are not supported in Domoticz?
Is there a way to add these myself? Could you elaborate a bit more on the Node-Red and MQTT option for this?
I mean I know what they are but how can we use this to add more values coming from P1 port to Domoticz as you say?

Thanks, Rene.
It depends on your meter protocol 4 or 5: https://www.domoticz.com/wiki/Dutch_DSM ... o_Domoticz

Edit: Sorry, did not read well. I suppose nobody made the change in the source code to add them...
Edit2: Looking at the code Amperage is available but i think @Firewizard is refering to the resolution of this Swedish implementation that appearantly is not supported..,

Re: All P1 Data Not Shown

Posted: Thursday 25 March 2021 10:33
by reneklomp
Oh really!? I have SMR5 meter for 1.5 year but got the P1 devices made when I added P1 to Domoticz when I had still an older meter - could that be the issue here? How can I have it recreate the Current devices now too without loosing all history on the others?

Re: All P1 Data Not Shown

Posted: Thursday 25 March 2021 10:41
by reneklomp
THese are the devices I have now...

Code: Select all

		114	Smart Meter	0001		1	Power		P1 Smart Meter	Energy
		115	Smart Meter	0001		2	Gas		P1 Smart Meter	Gas
		1034	Smart Meter	0000000		1	Usage L1	Usage		Electric
		1035	Smart Meter	0000000		4	Delivery L1	Usage		Electric
		1110	Smart Meter	00000001	1	Voltage L1	General		Voltage
		1111	Smart Meter	00000002	1	Voltage L2	General		Voltage
		1112	Smart Meter	00000003	1	Voltage L3	General		Voltage
		1113	Smart Meter	0000000		2	Usage L2	Usage		Electric
		1114	Smart Meter	0000000		3	Usage L3	Usage		Electric
		1115	Smart Meter	0000000		5	Delivery L2	Usage		Electric
		1116	Smart Meter	0000000		6	Delivery L3	Usage		Electric
Looking at the Idx it may be that the 1110-1116 were created after the meter swap. But no Current (Amperage) values... Any ideas?

Re: All P1 Data Not Shown

Posted: Thursday 25 March 2021 11:13
by waltervl
hmm, values are read but apparantly not used: viewtopic.php?p=254054#p254054
Ampere values in the P1 Smart meter are rounded to A (and not mA) and are therefore not accurate enough to be considered as reliable values.
Therefore they are not included in Domoticz.

Re: All P1 Data Not Shown

Posted: Thursday 25 March 2021 19:16
by FireWizard
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

Re: All P1 Data Not Shown

Posted: Friday 10 September 2021 23:13
by connectix
You can use this gateway for connecting Swedish Smart meters:
https://www.connectix.nl/swedish-smart- ... omey-mqtt/

Image

You can use basic telnet, mqtt or the api on the internal webserver.
It works with Home Assistant, Domoticz, Homey and DSMR-Reader. You can even use mqtt and use your own grafana dashboard with influxdb and node-red