diff --git a/fritz_temp_sync/sync_ha_fb.py b/fritz_temp_sync/sync_ha_fb.py index 7230d0c..d33e8cc 100755 --- a/fritz_temp_sync/sync_ha_fb.py +++ b/fritz_temp_sync/sync_ha_fb.py @@ -22,13 +22,14 @@ async def handle_event(idx: int): if entity_id in sensor_mappings.keys() or entity_id in thermostate_mappings.keys(): state = await ha.get_device_state(entity_id) new_state = event["data"]["new_state"] - logging.debug(f"received changed state from {entity_id}") + logging.info(f"received changed state from {entity_id} {entity_id in thermostate_mappings.keys()} {state['state']}") if entity_id in thermostate_mappings.keys() and state["state"] != "unavailable": therm_temp = new_state["attributes"]["current_temperature"] therm_name = new_state["attributes"]["friendly_name"] sensor = thermostate_mappings[entity_id] sensor_state = await ha.get_device_state(sensor) sensor_temp = round(float(sensor_state["attributes"]["temperature"]) * 2) / 2 + logger.info(f"temps: {therm_temp} {sensor_temp}") if therm_temp != sensor_temp: logging.info(f"{therm_name}: {therm_temp}\n{sensor}: {sensor_state['attributes']['temperature']} ({sensor_temp})") fb.correct_offset(therm_name, sensor_temp)