From 93254b24b9b12e3e8696d4c2f58a1411cafe1dc7 Mon Sep 17 00:00:00 2001 From: Martin Bauer Date: Sun, 20 Oct 2019 17:41:30 +0200 Subject: [PATCH] Config changes for new HA version: KNX sensor "address" to "state_address" --- config_creation/knx_conf.py | 6 +++--- config_creation/main.py | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/config_creation/knx_conf.py b/config_creation/knx_conf.py index 6966129..415c9c9 100644 --- a/config_creation/knx_conf.py +++ b/config_creation/knx_conf.py @@ -68,7 +68,7 @@ def create_power_plug(device_info: List[DeviceInfo], if counter_value: result['sensor'].append({ 'name': entry.display_name + " Betriebsstunden", - 'address': counter_value, + 'state_address': counter_value, 'type': '2byte_unsigned', }) counter_reset = csv_contents.get(entry.csv_name + postfix_counter_reset, None) @@ -83,7 +83,7 @@ def create_power_plug(device_info: List[DeviceInfo], if consumption: result['sensor'].append({ 'name': entry.display_name + " Verbrauch mA", - 'address': consumption, + 'state_address': consumption, 'type': 'DPT-9', }) name = name_to_id(entry.display_name + " Verbrauch mA", 'sensor') @@ -99,7 +99,7 @@ def create_power_plug(device_info: List[DeviceInfo], if consumption_sum: result['sensor'].append({ 'name': entry.display_name + " Verbrauch Summe", - 'address': consumption_sum, + 'state_address': consumption_sum, 'type': '4byte_unsigned', }) consumption_reset = csv_contents.get(entry.csv_name + postfix_consumption_reset, None) diff --git a/config_creation/main.py b/config_creation/main.py index 625d991..0e17a39 100644 --- a/config_creation/main.py +++ b/config_creation/main.py @@ -84,43 +84,43 @@ def add_knx_devices(devices, groups): 'sensor': [ # Brightness {'name': 'Gang Bewegungsmelder West Helligkeit', - 'address': imported_csv['BewegungsmelderWest Helligkeit'], + 'state_address': imported_csv['BewegungsmelderWest Helligkeit'], 'type': 'illuminance'}, {'name': 'Gang Bewegungsmelder Mitte Helligkeit', - 'address': imported_csv['BewegungsmelderMitte Helligkeit'], + 'state_address': imported_csv['BewegungsmelderMitte Helligkeit'], 'type': 'illuminance'}, {'name': 'Gang Bewegungsmelder Ost Helligkeit', - 'address': imported_csv['BewegungsmelderOst Helligkeit'], + 'state_address': imported_csv['BewegungsmelderOst Helligkeit'], 'type': 'illuminance'}, # Temperature {'name': 'Esszimmer Temperatur', - 'address': imported_csv['TemperaturEsszimmer'], + 'state_address': imported_csv['TemperaturEsszimmer'], 'type': 'temperature'}, {'name': 'Treppenhaus Oben Temperatur', - 'address': imported_csv['TreppenhausObenTemperatur'], + 'state_address': imported_csv['TreppenhausObenTemperatur'], 'type': 'temperature'}, {'name': 'Eingangsbereich Temperatur', - 'address': imported_csv['TemperaturGang'], + 'state_address': imported_csv['TemperaturGang'], 'type': 'temperature'}, {'name': 'Wohnzimmer Gang Temperatur', - 'address': imported_csv['TemperaturWohnzimmerGangTuer'], + 'state_address': imported_csv['TemperaturWohnzimmerGangTuer'], 'type': 'temperature'}, {'name': 'Wohnzimmer Terassentür Temperatur', - 'address': imported_csv['TemperaturWohnzimmerAussenTuer'], + 'state_address': imported_csv['TemperaturWohnzimmerAussenTuer'], 'type': 'temperature'}, ], 'binary_sensor': [ {'name': 'Gang Bewegungsmelder Schlafzimmer', - 'address': imported_csv['BewegungsmelderWest Motion Links'], + 'state_address': imported_csv['BewegungsmelderWest Motion Links'], 'device_class': 'motion'}, {'name': 'Gang Bewegungsmelder Wohnzimmer', - 'address': imported_csv['BewegungsmelderWest Motion Rechts'], + 'state_address': imported_csv['BewegungsmelderWest Motion Rechts'], 'device_class': 'motion'}, {'name': 'Gang Bewegungsmelder Mitte', - 'address': imported_csv['BewegungsmelderMitte Motion'], + 'state_address': imported_csv['BewegungsmelderMitte Motion'], 'device_class': 'motion'}, {'name': 'Gang Bewegungsmelder Ost', - 'address': imported_csv['BewegungsmelderOst Motion'], + 'state_address': imported_csv['BewegungsmelderOst Motion'], 'device_class': 'motion'}, ] }