@Koktail, I managed to get the script running with some adjustments to the original script. I changed the init code for the serial port according to an example on GitHub - reneklootwijk/node-dsmr: Parser for the DSMR protocol used on the P1 port of smart meters
Now I receive readable values instead of rubbish.
I will open a pull request on Github for the changes as soon as everything is working.
Now I get data visible in my Homey device, but not all. See screendump:
All 3 ‘current’ readings are missing, but the values are available in the data send to the Homey.
Note: I don’t have a connection to the gas network at my home.
Below the logging of the script with debug logging enabled (I added a few by myself)
pi@raspberrypi:/home/pi/com.p1.smartmeter-dsmr.reader/src# node p1.js
{“message”:{“_events”:{},“_eventsCount”:0,“_connection”:{“_events”:{},“_eventsCount”:0,“_port”:“/dev/ttyUSB0”,“_baudrate”:9600,“_parity”:“even”,“_databits”:7,“_connection”:null,“_connected”:false},“_currentValues”:{}},“level”:“info”}
{“message”:“Connection.connect: Entering”,“level”:“debug”}
{“message”:“Connected using serial connection”,“level”:“debug”}
{“message”:“p1 smartmeter is connected!”,“level”:“info”}
/ISk5\2MT382-10030-0:96.1.1(5A424556303035303933373337313132)
1-0:1.8.1(11223.242kWh)
1-0:1.8.2(11337.393kWh)
1-0:2.8.1(00998.707kWh)
1-0:2.8.2(02222.431kWh)
0-0:96.14.0(0001)
1-0:1.7.0(0000.35kW)
1-0:2.7.0(0000.00kW)
0-0:17.0.0(0999.00kW)
0-0:96.3.10(1)
0-0:96.13.1()
0-0:96.13.0()
!
,0-0:96.13.0())9.00kW)h)5303933373337313132)
{“message”:“SmartMeter: Telegram {"power":{"equipmentId":"ZBEV005093737112","totalConsumed1":11223.242,"totalConsumed2":11337.393,"totalProduced1":998.707,"totalProduced2":2222.431,"activeTariff":1,"actualConsumed":0.35,"actualProduced":0,"switchPosition":1},"gas":{},"meterModel":"ISk5\\2MT382-1003"}”,“level”:“debug”}
{ power:
{ equipmentId: ‘ZBEV005093737112’,
totalConsumed1: 11223.242,
totalConsumed2: 11337.393,
totalProduced1: 998.707,
totalProduced2: 2222.431,
activeTariff: 1,
actualConsumed: 0.35,
actualProduced: 0,
switchPosition: 1 },
gas: {},
meterModel: ‘ISk5\2MT382-1003’ }
{“message”:“p1 smartmeter update gas or power”,“level”:“info”}
{“message”:{“meterType”:“ISk5\2MT382-1003”,“electricity”:{“received”:{“tariff1”:{“reading”:11223.242,“unit”:“kWh”},“tariff2”:{“reading”:11337.393,“unit”:“kWh”},“actual”:{“reading”:0.35,“unit”:“kW”}},“delivered”:{“tariff1”:{“reading”:998.707,“unit”:“kWh”},“tariff2”:{“reading”:2222.431,“unit”:“kWh”},“actual”:{“reading”:0,“unit”:“kW”}},“tariffIndicator”:1,“switchPosition”:1,“voltageSags”:{},“voltageSwell”:{},“instantaneous”:{“current”:{“L1”:{“unit”:“A”},“L2”:{“unit”:“A”},“L3”:{“unit”:“A”}},“power”:{“positive”:{“L1”:{“unit”:“kW”},“L2”:{“unit”:“kW”},“L3”:{“unit”:“kW”}},“negative”:{“L1”:{“unit”:“kW”},“L2”:{“unit”:“kW”},“L3”:{“unit”:“kW”}}}}},“gas”:{“deviceType”:“003”,“unit”:“m3”}},“level”:“debug”}
{“message”:“SmartMeter: Updates {"power":{"equipmentId":"ZBEV005093737112","totalConsumed1":11223.242,"totalConsumed2":11337.393,"totalProduced1":998.707,"totalProduced2":2222.431,"activeTariff":1,"actualConsumed":0.35,"actualProduced":0,"switchPosition":1},"meterModel":"ISk5\\2MT382-1003"}”,“level”:“debug”}
{“message”:“posted successfully to: https://*******.connect.athom.com/api/app/com.p1/update”,“level”:“info”}