A few months ago I asked (again) for a priority installation for a new smartmeter. I did this before in my previous house and I want to have the old meters replaced here as well. A new Sagemcom T210D type is installed. More information about this meter can be see here.

This smartmeter has also the famous P1 port. The Plugwise Smile P1 can’t be used anymore with this newer type smartmeter, but the benefit here it that my home automation server is installed next to the smartmeter. In this case I’m able to use a P1-to-USB cable, and the exact type in my case is “NTA8130-P1 – P1 Converter Cable v2“, which can be bought in The Netherlands for around 20 euro.

My smartmeter send every ~3 seconds a telegram update. An example of the layour os such a telegram could be like this:

034C
/Ene5\T210-D ESMR5.0

1-3:0.2.8(50)
0-0:1.0.0(181103191550W)
0-0:96.1.1(123456789123456789123456789123465798)
1-0:1.8.1(000286.979*kWh)
1-0:1.8.2(000179.813*kWh)
1-0:2.8.1(000000.089*kWh)
1-0:2.8.2(000000.000*kWh)
0-0:96.14.0(0001)
1-0:1.7.0(00.261*kW)
1-0:2.7.0(00.000*kW)
0-0:96.7.21(00135)
0-0:96.7.9(00008)
1-0:99.97.0(3)(0-0:96.7.19)(180717122024S)(0000000479*s)(180717121129S)(0000003892*s)(180717110404S)(0000003869*s)
1-0:32.32.0(00005)
1-0:52.32.0(00003)
1-0:72.32.0(00003)
1-0:32.36.0(00000)
1-0:52.36.0(00000)
1-0:72.36.0(00000)
0-0:96.13.0()
1-0:32.7.0(225.0*V)
1-0:52.7.0(228.0*V)
1-0:72.7.0(226.0*V)
1-0:31.7.0(000*A)
1-0:51.7.0(000*A)
1-0:71.7.0(000*A)
1-0:21.7.0(00.102*kW)
1-0:41.7.0(00.005*kW)
1-0:61.7.0(00.152*kW)
1-0:22.7.0(00.000*kW)
1-0:42.7.0(00.000*kW)
1-0:62.7.0(00.000*kW)
0-1:24.1.0(003)
0-1:96.1.0(123456789123456789123456789123465799)
0-1:24.2.1(181103191500W)(00062.945*m3)

 

Representation of the P1 telegram

All OBIS (Object Identification System) objects in the telegram message having a code number, which correspont with a unique description, you can have easily ~50 codes in each telegram. All objects are based on the “P1 Companion Standard”, which is documented in the P1_Companion_Standard. I’ll explain an example from the telegram here:

1-0:1.7.0(00.261*kW)

  • 1-0:1.7.0 = “Actual electricity power delivered (+P) in 1 Watt resolution,”
  • (00.261*kW) = 0.261 kW = 261 Watt of realtime total power usage.

Some objects are not provided by the meter, so the values will be zero, like “1-0:2.7.0(00.000*kW)”. Because I don’t have solar panels, the smartmeter don’t receive power.

 

Define com port in Homeseer

Because the frequest telegram update, a stable connection is necessary. Check your device manager for the corresponding port number:

P1comports

For a stable connection to the P1 USB cable, I’ll keep the com port open all time. To arrange this a “open comport statement” has to be added to the “Startup.vb” file from Homeseer. The file will run at every start of Homeseer. The following line, has to be added at the bottom of the script, but before the “End Sub” statement:

hs.closecomport(3)
Dim e=hs.OpenComPortTerm(3,”115200,N,8,1″,1,”P1smartmeter.vb”, “Main”, “!”)

  • To be sure the comport is not already open, the comport will be closed first.
  • Where “3” is the number of the com port.
  • “P1smartmeter.vb” is the name of the script that can be downloaded at the bottom of the page
  • “Main” is the name of the Sub statement in the “P1smartmeter.vb” script.

Save the “Statup.vb” file.

If you want to doo it right, you should add a statement in “Shutdown.vb” script as well, corresponding to the earlier used com port:

hs.CloseComPort(3)

In this case the com port will be closed when Homeseer will be stopped.

To have the settings fired up, a restart of Homeseer is necessary. Read below text first, before restarting Homeseer.

 

Script explanation

In first place nothing has to be changed in the script. With the start of Homeseer the com port will be opened and with every telegram update from the smartmeter, the script will be run in Homeseer.

At lines 19-21 an extra comment is visible. It’s possible to save the telegram to a local file in the Homeseer html folder. This feature is not manadtory for running the script. it’s can be used tosee what data is in the actual telegram. It’s up to your to enable it:

My.Computer.FileSystem.WriteAllText(save_telegram, data & ControlChars.CrLf, False, System.Text.Encoding.Unicode)

Be aware of the comment to add the mentioned “ScriptingReferences”:

  • “System.Web.Extensions;System.Web.Extensions.dll”

When this is done, Homeseer need a restart as well.

With the first script run, the virtual devices will be created automatically and can be shown like this:

 

Downloads: