saberone / pimatic-smartmeter

Read energy usage data from a "smartmeter" through it's P1 port
MIT License
0 stars 6 forks source link

gastotalusage not filled #20

Open HenriMatthijssen opened 7 years ago

HenriMatthijssen commented 7 years ago

I have an Itron smartmeter for Gas. It looks like it transfers its data to the my Landis+Gyr smartmeter for Electra (which is connected to Raspberry Pi with Pimatic). Electra readings are correctly populated, however I miss the gas readings. When checking the output I do see it appearing:

1-3:0.2.8(42) 0-0:1.0.0(170224182239W) 0-0:96.1.1(4530303330303033373236343938353136) 1-0:1.8.1(000014.005kWh) 1-0:1.8.2(000036.177kWh) 1-0:2.8.1(000000.000kWh) 1-0:2.8.2(000000.000kWh) 0-0:96.14.0(0002) 1-0:1.7.0(00.886kW) 1-0:2.7.0(00.000kW) 0-0:96.7.21(00002) 0-0:96.7.9(00000) 1-0:99.97.0(0)(0-0:96.7.19) 1-0:32.32.0(00000) 1-0:52.32.0(00000) 1-0:72.32.0(00001) 1-0:32.36.0(00000) 1-0:52.36.0(00000) 1-0:72.36.0(00000) 0-0:96.13.1() 0-0:96.13.0() 1-0:31.7.0(002A) 1-0:51.7.0(000A) 1-0:71.7.0(003A) 1-0:21.7.0(00.349kW) 1-0:41.7.0(00.011kW) 1-0:61.7.0(00.526kW) 1-0:22.7.0(00.000kW) 1-0:42.7.0(00.000kW) 1-0:62.7.0(00.000kW) 0-1:24.1.0(003) 0-1:96.1.0(4730303139333430333231303838373136) 0-1:24.2.1(170224180000W)(00026.135m3) !B184 /XMX5LGBBFG1012751414

Next line from above looks like my gas reading:

0-1:24.2.1(170224180000W)(00026.135*m3)

Can you check or tell me how I can make sure that it is populated into the gasmeter2.gastotalusage attribute.

HenriMatthijssen commented 7 years ago

It looks like I need to change something in p1meterdata.js. I changed it to next and this works for me

var gasTotalUsage = returnRegExResult(data, /^0-1:24\.2\.1\(\d{12}W\)\(0+(\d+\.\d+)\*m3\)/m);