spacemanspiff2007 / sml2mqtt

Sml to MQTT Bridge
GNU General Public License v3.0
25 stars 8 forks source link

0100020800ff (1-0:2.8.0*255) not reported to MQTT Broker #13

Closed baiti closed 2 years ago

baiti commented 2 years ago

My device reports (via -a option):

[2022-06-30 15:45:58,026] [sml.serial0            ] INFO     |     val_list:
[2022-06-30 15:45:58,026] [sml.serial0            ] INFO     |       <SmlListEntry>
[2022-06-30 15:45:58,027] [sml.serial0            ] INFO     |         obis           : 010060320101 (1-0:96.50.1*1)
[2022-06-30 15:45:58,027] [sml.serial0            ] INFO     |         status         : None
[2022-06-30 15:45:58,027] [sml.serial0            ] INFO     |         val_time       : None
[2022-06-30 15:45:58,028] [sml.serial0            ] INFO     |         unit           : None
[2022-06-30 15:45:58,028] [sml.serial0            ] INFO     |         scaler         : None
[2022-06-30 15:45:58,029] [sml.serial0            ] INFO     |         value          : ISK
[2022-06-30 15:45:58,029] [sml.serial0            ] INFO     |         value_signature: None
[2022-06-30 15:45:58,030] [sml.serial0            ] INFO     |       <SmlListEntry>
[2022-06-30 15:45:58,030] [sml.serial0            ] INFO     |         obis           : 0100600100ff (1-0:96.1.0*255)
[2022-06-30 15:45:58,030] [sml.serial0            ] INFO     |         status         : None
[2022-06-30 15:45:58,031] [sml.serial0            ] INFO     |         val_time       : None
[2022-06-30 15:45:58,031] [sml.serial0            ] INFO     |         unit           : None
[2022-06-30 15:45:58,031] [sml.serial0            ] INFO     |         scaler         : None
[2022-06-30 15:45:58,032] [sml.serial0            ] INFO     |         value          : 0a0149534b0005020de2
[2022-06-30 15:45:58,032] [sml.serial0            ] INFO     |         value_signature: None
[2022-06-30 15:45:58,032] [sml.serial0            ] INFO     |       <SmlListEntry>
[2022-06-30 15:45:58,033] [sml.serial0            ] INFO     |         obis           : 0100010800ff (1-0:1.8.0*255)
[2022-06-30 15:45:58,033] [sml.serial0            ] INFO     |         status         : 1835268
[2022-06-30 15:45:58,033] [sml.serial0            ] INFO     |         val_time       : None
[2022-06-30 15:45:58,033] [sml.serial0            ] INFO     |         unit           : 30
[2022-06-30 15:45:58,034] [sml.serial0            ] INFO     |         scaler         : -1
[2022-06-30 15:45:58,034] [sml.serial0            ] INFO     |         value          : 7335755
[2022-06-30 15:45:58,034] [sml.serial0            ] INFO     |         value_signature: None
[2022-06-30 15:45:58,035] [sml.serial0            ] INFO     |         -> 733575.5Wh (Zählerstand Total)
[2022-06-30 15:45:58,035] [sml.serial0            ] INFO     |       <SmlListEntry>
[2022-06-30 15:45:58,035] [sml.serial0            ] INFO     |         obis           : 0100020800ff (1-0:2.8.0*255)
[2022-06-30 15:45:58,036] [sml.serial0            ] INFO     |         status         : None
[2022-06-30 15:45:58,036] [sml.serial0            ] INFO     |         val_time       : None
[2022-06-30 15:45:58,036] [sml.serial0            ] INFO     |         unit           : 30
[2022-06-30 15:45:58,037] [sml.serial0            ] INFO     |         scaler         : -1
[2022-06-30 15:45:58,037] [sml.serial0            ] INFO     |         value          : 0
[2022-06-30 15:45:58,037] [sml.serial0            ] INFO     |         value_signature: None
[2022-06-30 15:45:58,037] [sml.serial0            ] INFO     |         -> 0.0Wh
[2022-06-30 15:45:58,038] [sml.serial0            ] INFO     |       <SmlListEntry>
[2022-06-30 15:45:58,038] [sml.serial0            ] INFO     |         obis           : 0100100700ff (1-0:16.7.0*255)
[2022-06-30 15:45:58,038] [sml.serial0            ] INFO     |         status         : None
[2022-06-30 15:45:58,039] [sml.serial0            ] INFO     |         val_time       : None
[2022-06-30 15:45:58,039] [sml.serial0            ] INFO     |         unit           : 27
[2022-06-30 15:45:58,039] [sml.serial0            ] INFO     |         scaler         : 0
[2022-06-30 15:45:58,039] [sml.serial0            ] INFO     |         value          : 433
[2022-06-30 15:45:58,040] [sml.serial0            ] INFO     |         value_signature: None
[2022-06-30 15:45:58,040] [sml.serial0            ] INFO     |         -> 433W (aktuelle Wirkleistung)

however, I never see: obis : 0100020800ff (1-0:2.8.0*255) being sent to mqtt

my config has defined the following under "devices":

devices:
  /dev/serial0:

    mqtt:
      topic: myTopic

    skip:
      - '010060320101'
      - '0100600100ff'

    values:

      0100100700ff:
        mqtt:
          topic: power
        filters:
          - diff: 500
          - every: 60

      0100010800ff:
        mqtt:
          topic: energy
        filters:
          - diff: 1
          - every: 300

      0100020800ff:
        mqtt:
          topic: outbound
        filters:
          - diff: 1
          - every: 300
spacemanspiff2007 commented 2 years ago

Energy meters with

value          : 0

are ignored. I think there's a config option to switch it off but imho doesn't it make much sense to report these meters.

baiti commented 2 years ago

Since I plan to install a PV array, this meter will matter as it counts what is sent to the grid. If it is possible for you, could you research which option needs to be set to enable the zero counters to be included in the mqtt message? I assume that power will report negative values in such a scenario, can anybody confirm?

spacemanspiff2007 commented 2 years ago

As soon as the meter has a value it will automatically be reported.

But I think there is a misconception: Energy meters count the total energy sent to grid (Wh or kWh). Once it has started to send energy into the grid it will not go back to 0 (and thus always be reported). You are thinking probably about power (W) which will indeed be negative but it could be that you need to activate a workaround depending on your device.

baiti commented 2 years ago

Thx much for sharing your insight. In this case there isn't a misconception. I am well aware that both counters only count "upwards". However, I'd be interested to learn more about the workaround you mentioned.

spacemanspiff2007 commented 2 years ago

Check the workarounds section in the example config in the readme. Currently there is only one.

baiti commented 2 years ago

workarounds:

  • negative on energy meter status: true # activate this workaround

I would need that workaround on power, not on energy as energy is never negative ... as discussed before.

spacemanspiff2007 commented 2 years ago

How do you even know you kneed a workaround and that this workaround is the wrong one? Have you already sent energy into the grid and power did not turn negative?

baiti commented 2 years ago

Good point. At this time, I don't. Will wait patiently until the gear is installed and see how it goes. If all else fails I'd need to install my own metereing device downstream from the authoritative one. I am in the process of wiring up test setup on the lab bench to see what works and what doesn't.

Thanks much for providing sml2mqtt

baiti commented 1 year ago

Update: Now that I indeed have delivered something into the grid the 0100020800ff topic indeed shows up in my influxdb, posted via telegraf. Again .. thx much! Great work and very useful.