Just connected my smartmeter to my RPi with an USB to RJ11 cable. With the command
cat /dev/ttyUSB0"
I get some data from my meter and with
cat /dev/ttyUSB0 > stroom.log"
the data is written into a log file (/home/pi/stroom.log).
/XMX5LGBBFFB231329751
1-3:0.2.8(42)
0-0:1.0.0(160203113835W)
0-0:96.1.1(4530303034303033303130323930303135)
1-0:1.8.1(000576.986kWh)
1-0:2.8.1(000000.000kWh)
1-0:1.8.2(000453.861kWh)
1-0:2.8.2(000000.000kWh)
0-0:96.14.0(0002)
1-0:1.7.0(00.401kW)
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:32.36.0(00000)
0-0:96.13.1()
0-0:96.13.0()
1-0:31.7.0(002A)
1-0:21.7.0(00.401kW)
1-0:22.7.0(00.000kW)
0-1:24.1.0(003)
0-1:96.1.0(4730303139333430323434383839303135)
0-1:24.2.1(160203110000W)(00337.893m3)
!E602
In pimatic I created a new device just like the example in this threat:
{
"id": "energymeter",
"name": "Energy Meter",
"class": "LogWatcher",
"file": "/home/pi/stroom.log",
"attributes": [
{
"name": "tariff1",
"type": "number",
"unit": "kWh"
},
{
"name": "tariff2",
"type": "number",
"unit": "kWh"
}
],
"lines": [
{
"match": "1-0:1\\.8\\.1\\x28([0-9]+\\.[0-9]+)kWh\\x29",
"tariff1": "$1"
},
{
"match": "1-0:1\\.8\\.2\\x28([0-9]+\\.[0-9]+)kWh\\x29",
"tariff2": "$1"
}
]
},
But… pimatic shows “Unknown” twice:
Anyone with an idea what is going wrong?