ebaauw / homebridge-p1

Homebridge plugin for DSMR end-consumer (P1) interface
Apache License 2.0
53 stars 11 forks source link

Fix warning about always empty value #43

Closed RobBuijs closed 3 years ago

RobBuijs commented 3 years ago

P1 on my slimme meter is always complaining

[P1] warning: 1-0:99.97.0: ignoring unknown value ()

With this simple patch it isn't anymore.

ebaauw commented 3 years ago

Sorry, that’s like taking the the warning light.

What does this value mean? Is there any unit associated with it? What DSMR version does your meter support?

RobBuijs commented 3 years ago

Haha, valid points.

OBIS Reference "1-0:99.97.0.255" has value "Power Failure Event Log (long power failures)". Not sure how to figure out the DSMR version. It's a new slimme meter, placed a couple of weeks ago. Could also explain why the field is empty - no power failures yet.

It's a bit verbose, but this is a sample telegram.

ISK5\2M550E-1013
1-3:0.2.8(50)
0-0:1.0.0(201126123723W)
0-0:96.1.1(4530303533303037353134323331343139)
1-0:1.8.1(000056.179*kWh)
1-0:1.8.2(000083.425*kWh)
1-0:2.8.1(000000.000*kWh)
1-0:2.8.2(000000.000*kWh)
0-0:96.14.0(0002)
1-0:1.7.0(00.759*kW)
1-0:2.7.0(00.000*kW)
0-0:96.7.21(00008)
0-0:96.7.9(00002)
1-0:99.97.0()
1-0:32.32.0(00003)
1-0:32.36.0(00001)
0-0:96.13.0()
1-0:32.7.0(239.4*V)
1-0:31.7.0(003*A)
1-0:21.7.0(00.742*kW)
1-0:22.7.0(00.000*kW)
!85C4
ebaauw commented 3 years ago

Not sure how to figure out the DSMR version 1-3:0.2.8(50)

That’s DSMR v5.0. Same version as the meter they installed in my home.

OBIS Reference "1-0:99.97.0.255" has value "Power Failure Event Log (long power failures)".

Indeed, Homerbridge P1 already supports that. https://github.com/ebaauw/homebridge-p1/blob/af6ab812da0bbadfaf044ac4e7645e2a392b07d3/lib/P1Client.js#L180

1-0:99.97.0()

However, I haven't seen an empty value before. I think it should report at least (0) to indicate the number of power failures. "My" meter reports:

1-0:99.97.0(0)(0-0:96.7.19)

From another user, I got:

1-0:99.97.0(2)(0-0:96.7.19)(180327064111S)(0000000180*s)(190108105923W)(0000002603*s)

Looking at the code, it doesn't like a completely empty value, treating it as unknown. Commit below should fix this.

RobBuijs commented 3 years ago

Yes, That's much cleaner. And it works fine.

I'm curious what my meter will report if there is a power event failure. Can't simulate (or cause) one, so I'll have to wait for that.