@@ -293,12 +293,13 @@ def sync_zones(self, zones_data: List[Dict[str, Any]], home_id: int) -> bool:
293293
294294 def sync_zone_states_data (self , zone_states_data : List [Dict [str , Any ]], home_id : int , tado_api : TadoLocalAPI ) -> bool :
295295 """
296- Sync zone states from Tado Cloud API to update temperature and humidity.
296+ Sync zone states from Tado Cloud API to update humidity.
297297
298- The zoneStates endpoint provides authoritative sensor data that supplements
299- HomeKit readings. Standalone accessories (e.g. Smart AC Control V3+) may
300- not fire HomeKit temperature events reliably, so cloud values act as a
301- correction layer.
298+ Tado devices only fire HomeKit humidity events when the delta exceeds
299+ ~5%, so cloud values fill the gap between those infrequent updates.
300+ Temperature is intentionally excluded here -- always-on HomeKit polling
301+ (every 60-120s) provides timely local reads without the precision
302+ mismatch that cloud values would introduce.
302303
303304 Args:
304305 zone_states_data: Zone state response from Tado Cloud API
@@ -313,7 +314,7 @@ def sync_zone_states_data(self, zone_states_data: List[Dict[str, Any]], home_id:
313314 conn = sqlite3 .connect (self .db_path )
314315 cursor = conn .cursor ()
315316
316- sensor_updates = 0
317+ humidity_updates = 0
317318
318319 zones = zone_states_data .get ('zoneStates' , {})
319320 for zone_id , zone_state in zones .items ():
@@ -324,35 +325,27 @@ def sync_zone_states_data(self, zone_states_data: List[Dict[str, Any]], home_id:
324325
325326 sensor_data = zone_state .get ('sensorDataPoints' , {})
326327 humidity = sensor_data .get ('humidity' , {}).get ('percentage' )
327- temperature = sensor_data .get ('insideTemperature' , {}).get ('celsius' )
328328
329- if humidity is None and temperature is None :
329+ if humidity is None :
330330 continue
331331
332- logger .debug (f"Cloud sensor data for zone { zone_id } : temp= { temperature } , hum= { humidity } " )
332+ logger .debug (f"Cloud humidity for zone { zone_id } : { humidity } % " )
333333 cursor .execute ("SELECT aid FROM devices WHERE tado_zone_id = ?" , (str (zone_id ),))
334334
335335 for device in cursor .fetchall ():
336336 aid = device [0 ]
337337 if not aid :
338338 continue
339339
340- if humidity is not None :
341- iid = tado_api .get_iid_from_characteristics (aid , "CurrentRelativeHumidity" )
342- if iid :
343- asyncio .create_task (tado_api .handle_change (aid , iid , {'value' : humidity }, source = "POLLING" ))
344- sensor_updates += 1
345-
346- if temperature is not None :
347- iid = tado_api .get_iid_from_characteristics (aid , "CurrentTemperature" )
348- if iid :
349- asyncio .create_task (tado_api .handle_change (aid , iid , {'value' : temperature }, source = "POLLING" ))
350- sensor_updates += 1
340+ iid = tado_api .get_iid_from_characteristics (aid , "CurrentRelativeHumidity" )
341+ if iid :
342+ asyncio .create_task (tado_api .handle_change (aid , iid , {'value' : humidity }, source = "POLLING" ))
343+ humidity_updates += 1
351344
352345 conn .commit ()
353346 conn .close ()
354347
355- logger .info (f"Cloud zone states: { sensor_updates } sensor updates applied" )
348+ logger .info (f"Cloud zone states: { humidity_updates } humidity updates applied" )
356349 return True
357350
358351 except Exception as e :
0 commit comments