Allow configuring DSMR5 protocol. (#7535)

* Allow configuring DSMR5 protocol.

* Give good example.

* Using dev branch until released upstream.

* Update to dsmr_parser supporting v5 arguments.
This commit is contained in:
Johan Bloemberg authored and Pascal Vizeli committed 2017-05-29 16:19:50 +02:00
1 parent a7277db4d7
commit 5e5c0daa87
3 files changed
+6 -5

No files matched your search

+4 -3
View File
@@ -40,7 +40,8 @@ import voluptuous as vol
_LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ['dsmr_parser==0.8']
REQUIREMENTS = ['dsmr_parser==0.9']
CONF_DSMR_VERSION = 'dsmr_version'
CONF_RECONNECT_INTERVAL = 'reconnect_interval'
@@ -60,7 +61,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.string,
vol.Optional(CONF_HOST, default=None): cv.string,
vol.Optional(CONF_DSMR_VERSION, default=DEFAULT_DSMR_VERSION): vol.All(
cv.string, vol.In(['4', '2.2'])),
cv.string, vol.In(['5', '4', '2.2'])),
vol.Optional(CONF_RECONNECT_INTERVAL, default=30): int,
})
@@ -93,7 +94,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
devices = [DSMREntity(name, obis) for name, obis in obis_mapping]
# Protocol version specific obis
if dsmr_version == '4':
if dsmr_version in ('4', '5'):
gas_obis = obis_ref.HOURLY_GAS_METER_READING
else:
gas_obis = obis_ref.GAS_METER_READING