Merge pull request #44 from dupondje/master
Add support for Belgian and Smarty meters
This commit is contained in:
commit
09614860a6
@ -26,6 +26,9 @@ def create_dsmr_protocol(dsmr_version, telegram_callback, loop=None):
|
|||||||
elif dsmr_version == '5':
|
elif dsmr_version == '5':
|
||||||
specification = telegram_specifications.V5
|
specification = telegram_specifications.V5
|
||||||
serial_settings = SERIAL_SETTINGS_V5
|
serial_settings = SERIAL_SETTINGS_V5
|
||||||
|
elif dsmr_version == '5B':
|
||||||
|
specification = telegram_specifications.BELGIUM_FLUVIUS
|
||||||
|
serial_settings = SERIAL_SETTINGS_V5
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError("No telegram parser found for version: %s",
|
raise NotImplementedError("No telegram parser found for version: %s",
|
||||||
dsmr_version)
|
dsmr_version)
|
||||||
|
@ -60,3 +60,8 @@ ELECTRICITY_DELIVERED_TARIFF_ALL = (
|
|||||||
ELECTRICITY_DELIVERED_TARIFF_1,
|
ELECTRICITY_DELIVERED_TARIFF_1,
|
||||||
ELECTRICITY_DELIVERED_TARIFF_2
|
ELECTRICITY_DELIVERED_TARIFF_2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Alternate codes for foreign countries.
|
||||||
|
BELGIUM_HOURLY_GAS_METER_READING = r'\d-\d:24\.2\.3.+?\r\n' # Different code, same format.
|
||||||
|
LUXEMBOURG_ELECTRICITY_USED_TARIFF_GLOBAL = r'\d-\d:1\.8\.0.+?\r\n' # Total imported energy register (P+)
|
||||||
|
LUXEMBOURG_ELECTRICITY_DELIVERED_TARIFF_GLOBAL = r'\d-\d:2\.8\.0.+?\r\n' # Total exported energy register (P-)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
from copy import deepcopy
|
||||||
|
|
||||||
from dsmr_parser import obis_references as obis
|
from dsmr_parser import obis_references as obis
|
||||||
from dsmr_parser.parsers import CosemParser, ValueParser, MBusParser
|
from dsmr_parser.parsers import CosemParser, ValueParser, MBusParser
|
||||||
@ -128,3 +129,18 @@ V5 = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ALL = (V2_2, V3, V4, V5)
|
ALL = (V2_2, V3, V4, V5)
|
||||||
|
|
||||||
|
|
||||||
|
BELGIUM_FLUVIUS = deepcopy(V5)
|
||||||
|
BELGIUM_FLUVIUS['objects'].update({
|
||||||
|
obis.BELGIUM_HOURLY_GAS_METER_READING: MBusParser(
|
||||||
|
ValueParser(timestamp),
|
||||||
|
ValueParser(Decimal)
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
LUXEMBOURG_SMARTY = deepcopy(V5)
|
||||||
|
LUXEMBOURG_SMARTY['objects'].update({
|
||||||
|
obis.LUXEMBOURG_ELECTRICITY_USED_TARIFF_GLOBAL: CosemParser(ValueParser(Decimal)),
|
||||||
|
obis.LUXEMBOURG_ELECTRICITY_DELIVERED_TARIFF_GLOBAL: CosemParser(ValueParser(Decimal)),
|
||||||
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user