psy0rz / p1_dsmr_to_influxdb

Stuurt ALLE nederlandse slimme meter data uit de P1 poort naar InfluxDB
17 stars 14 forks source link

No Gas data on Belgian DSMR5 sagemcom meter #5

Closed bucovaina closed 2 years ago

bucovaina commented 2 years ago

I'm using this script to my content in my home setup. The only thing missing for me is that it does not output gas data. Can someone let me know how I can do this on a Belgian DSMR meter?

This is what a data frame looks like to me:


0-0:96.1.4(50216)
0-0:96.1.1(37464A33F4838911492374513020)
0-0:1.0.0(220828092543S)
1-0:1.8.1(002366.594*kWh)
1-0:1.8.2(003564.839*kWh)
1-0:2.8.1(004364.675*kWh)
1-0:2.8.2(001715.353*kWh)
0-0:96.14.0(0002)
1-0:1.7.0(00.000*kW)
1-0:2.7.0(00.951*kW)
1-0:21.7.0(00.000*kW)
1-0:22.7.0(00.951*kW)
1-0:32.7.0(240.4*V)
1-0:31.7.0(004.35*A)
0-0:96.3.10(1)
0-0:17.0.0(999.9*kW)
1-0:31.4.0(999*A)
0-0:96.13.0()
0-1:24.1.0(003)
0-1:96.1.1(37464A33F4838911492374513020)
0-1:24.4.0(1)
0-1:24.2.3(220828092503S)(02594.804*m3)
!5C4B
psy0rz commented 2 years ago

Try looking in telegram.items() to see if there's something its missing. Try coping pasting the output of the script here.

Its also possible that the dsmr_parser library doesnt support it or needs a newer version.

bucovaina commented 2 years ago

Hi @psy0rz : thanks for your help and time!

Sorry to ask this noob question, how do I look at telegram.items() ?

This is the output of the script:

{'fields': {'CURRENT_ELECTRICITY_DELIVERY': 0.663,
            'CURRENT_ELECTRICITY_USAGE': 0.0,
            'DEVICE_TYPE': 3.0,
            'ELECTRICITY_DELIVERED_TARIFF_1': 4394.839,
            'ELECTRICITY_DELIVERED_TARIFF_2': 1745.826,
            'ELECTRICITY_USED_TARIFF_1': 2367.968,
            'ELECTRICITY_USED_TARIFF_2': 3569.697,
            'INSTANTANEOUS_ACTIVE_POWER_L1_NEGATIVE': 0.663,
            'INSTANTANEOUS_ACTIVE_POWER_L1_POSITIVE': 0.0,
            'INSTANTANEOUS_CURRENT_L1': 3.25},
 'measurement': 'P1 values'}
root@stats:~# pip index versions dsmr-parser
WARNING: pip index is currently an experimental command. It may be removed/changed in a future release without prior warning.
dsmr-parser (0.33)
Available versions: 0.33, 0.32, 0.31, 0.30, 0.29, 0.28, 0.27, 0.26, 0.25, 0.24, 0.23, 0.22, 0.21, 0.18, 0.17, 0.16, 0.15, 0.14, 0.13, 0.12, 0.11, 0.10, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1
  INSTALLED: 0.33
  LATEST:    0.33
root@stats:~# 
psy0rz commented 2 years ago

Ah i see!

It will only send the differences of the gas reading, so it can take up to an hour before it sends the first value to influxdb.

Try adding this to the HOURLY_GAS_METER_READING if-statement to see it: print(name, value.value)

bucovaina commented 2 years ago

I've been running it for months now. So if it only updates after a few hours, I should at least have a field key with gas data in them (since it's been running for months)

This is a look at the influxdb structure:

> show field keys from "P1 values"
name: P1 values
fieldKey                               fieldType
--------                               ---------
CURRENT_ELECTRICITY_DELIVERY           float
CURRENT_ELECTRICITY_USAGE              float
DEVICE_TYPE                            float
ELECTRICITY_DELIVERED_TARIFF_1         float
ELECTRICITY_DELIVERED_TARIFF_2         float
ELECTRICITY_USED_TARIFF_1              float
ELECTRICITY_USED_TARIFF_2              float
INSTANTANEOUS_ACTIVE_POWER_L1_NEGATIVE float
INSTANTANEOUS_ACTIVE_POWER_L1_POSITIVE float
INSTANTANEOUS_CURRENT_L1               float
> 
psy0rz commented 2 years ago

ah ok..i'll reopen it, maybe someone else knows.

bucovaina commented 2 years ago

@psy0rz: thanks.

Just a wild guess, could it be that the script trips on the star (*) symbol? There are 22 "fields" in the input but only 10 fields are picked up by the script.

bucovaina commented 2 years ago

I finally found it. I'm from Belgium using a Fluvius meter. That should be reflected in the script:

        serial_reader = SerialReader(
            device=config.serial_port,
            serial_settings=SERIAL_SETTINGS_V4,
            telegram_specification=telegram_specifications.BELGIUM_FLUVIUS # <<<<<======
        )

It was telegram_specifications.V4 by default. One needs to look here for all the available options: https://github.com/ndokter/dsmr_parser/blob/master/dsmr_parser/telegram_specifications.py .

Can this perhaps be added to the README? :) and/or maybe added to the config.py?

psy0rz commented 2 years ago

i'll add it to the readme for now :)

psy0rz commented 2 years ago

and thanks!