Config changes for new HA version: KNX sensor "address" to "state_address"

This commit is contained in:
Martin Bauer 2019-10-20 17:41:30 +02:00
parent 243f6f1155
commit 93254b24b9
2 changed files with 15 additions and 15 deletions

View File

@ -68,7 +68,7 @@ def create_power_plug(device_info: List[DeviceInfo],
if counter_value: if counter_value:
result['sensor'].append({ result['sensor'].append({
'name': entry.display_name + " Betriebsstunden", 'name': entry.display_name + " Betriebsstunden",
'address': counter_value, 'state_address': counter_value,
'type': '2byte_unsigned', 'type': '2byte_unsigned',
}) })
counter_reset = csv_contents.get(entry.csv_name + postfix_counter_reset, None) 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: if consumption:
result['sensor'].append({ result['sensor'].append({
'name': entry.display_name + " Verbrauch mA", 'name': entry.display_name + " Verbrauch mA",
'address': consumption, 'state_address': consumption,
'type': 'DPT-9', 'type': 'DPT-9',
}) })
name = name_to_id(entry.display_name + " Verbrauch mA", 'sensor') 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: if consumption_sum:
result['sensor'].append({ result['sensor'].append({
'name': entry.display_name + " Verbrauch Summe", 'name': entry.display_name + " Verbrauch Summe",
'address': consumption_sum, 'state_address': consumption_sum,
'type': '4byte_unsigned', 'type': '4byte_unsigned',
}) })
consumption_reset = csv_contents.get(entry.csv_name + postfix_consumption_reset, None) consumption_reset = csv_contents.get(entry.csv_name + postfix_consumption_reset, None)

View File

@ -84,43 +84,43 @@ def add_knx_devices(devices, groups):
'sensor': [ 'sensor': [
# Brightness # Brightness
{'name': 'Gang Bewegungsmelder West Helligkeit', {'name': 'Gang Bewegungsmelder West Helligkeit',
'address': imported_csv['BewegungsmelderWest Helligkeit'], 'state_address': imported_csv['BewegungsmelderWest Helligkeit'],
'type': 'illuminance'}, 'type': 'illuminance'},
{'name': 'Gang Bewegungsmelder Mitte Helligkeit', {'name': 'Gang Bewegungsmelder Mitte Helligkeit',
'address': imported_csv['BewegungsmelderMitte Helligkeit'], 'state_address': imported_csv['BewegungsmelderMitte Helligkeit'],
'type': 'illuminance'}, 'type': 'illuminance'},
{'name': 'Gang Bewegungsmelder Ost Helligkeit', {'name': 'Gang Bewegungsmelder Ost Helligkeit',
'address': imported_csv['BewegungsmelderOst Helligkeit'], 'state_address': imported_csv['BewegungsmelderOst Helligkeit'],
'type': 'illuminance'}, 'type': 'illuminance'},
# Temperature # Temperature
{'name': 'Esszimmer Temperatur', {'name': 'Esszimmer Temperatur',
'address': imported_csv['TemperaturEsszimmer'], 'state_address': imported_csv['TemperaturEsszimmer'],
'type': 'temperature'}, 'type': 'temperature'},
{'name': 'Treppenhaus Oben Temperatur', {'name': 'Treppenhaus Oben Temperatur',
'address': imported_csv['TreppenhausObenTemperatur'], 'state_address': imported_csv['TreppenhausObenTemperatur'],
'type': 'temperature'}, 'type': 'temperature'},
{'name': 'Eingangsbereich Temperatur', {'name': 'Eingangsbereich Temperatur',
'address': imported_csv['TemperaturGang'], 'state_address': imported_csv['TemperaturGang'],
'type': 'temperature'}, 'type': 'temperature'},
{'name': 'Wohnzimmer Gang Temperatur', {'name': 'Wohnzimmer Gang Temperatur',
'address': imported_csv['TemperaturWohnzimmerGangTuer'], 'state_address': imported_csv['TemperaturWohnzimmerGangTuer'],
'type': 'temperature'}, 'type': 'temperature'},
{'name': 'Wohnzimmer Terassentür Temperatur', {'name': 'Wohnzimmer Terassentür Temperatur',
'address': imported_csv['TemperaturWohnzimmerAussenTuer'], 'state_address': imported_csv['TemperaturWohnzimmerAussenTuer'],
'type': 'temperature'}, 'type': 'temperature'},
], ],
'binary_sensor': [ 'binary_sensor': [
{'name': 'Gang Bewegungsmelder Schlafzimmer', {'name': 'Gang Bewegungsmelder Schlafzimmer',
'address': imported_csv['BewegungsmelderWest Motion Links'], 'state_address': imported_csv['BewegungsmelderWest Motion Links'],
'device_class': 'motion'}, 'device_class': 'motion'},
{'name': 'Gang Bewegungsmelder Wohnzimmer', {'name': 'Gang Bewegungsmelder Wohnzimmer',
'address': imported_csv['BewegungsmelderWest Motion Rechts'], 'state_address': imported_csv['BewegungsmelderWest Motion Rechts'],
'device_class': 'motion'}, 'device_class': 'motion'},
{'name': 'Gang Bewegungsmelder Mitte', {'name': 'Gang Bewegungsmelder Mitte',
'address': imported_csv['BewegungsmelderMitte Motion'], 'state_address': imported_csv['BewegungsmelderMitte Motion'],
'device_class': 'motion'}, 'device_class': 'motion'},
{'name': 'Gang Bewegungsmelder Ost', {'name': 'Gang Bewegungsmelder Ost',
'address': imported_csv['BewegungsmelderOst Motion'], 'state_address': imported_csv['BewegungsmelderOst Motion'],
'device_class': 'motion'}, 'device_class': 'motion'},
] ]
} }