ha-dual-smart-thermostat icon indicating copy to clipboard operation
ha-dual-smart-thermostat copied to clipboard

Error setting up dual_smart_thermostat at boot

Open override80 opened this issue 2 years ago • 3 comments

Hi!

The integration is working perfectly, but at boot I have this error logged by home assistant:

2022-04-07 10:40:35 ERROR (MainThread) [homeassistant.components.climate] Error while setting up dual_smart_thermostat platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 257, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 614, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 798, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/dual_smart_thermostat/climate.py", line 272, in async_added_to_hass
    async_track_state_change_event(
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 251, in async_track_state_change_event
    if not (entity_ids := _async_string_to_lower_list(entity_ids)):
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 524, in _async_string_to_lower_list
    return [mstr.lower() for mstr in instr]
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 524, in <listcomp>
    return [mstr.lower() for mstr in instr]
AttributeError: 'NoneType' object has no attribute 'lower'

Could it be due to the fact that some entities are not yet available (e.g. heater, target_sensor or openings)? Is thre any workaround?

Thanks!

override80 avatar Apr 07 '22 08:04 override80

Hi @swingerman I'm still seeing this in the latest version, is it supposed to be fixed? Can I provide any additional detail?

override80 avatar Jul 04 '22 13:07 override80

This should be fixed by now. Could you please paste your yaml of the thermostat?

swingerman avatar Jul 04 '22 13:07 swingerman

Of course, here it is! I tried also commenting out initial_hvac_mode, nothing changed:

- platform: dual_smart_thermostat
  name: Heater Up
  heater: switch.sonoffriscsopra
  target_sensor: sensor.temperature_up
  away_temp: 16
  min_temp: 10
  max_temp: 22
  target_temp: 19
  cold_tolerance: 0.1
  hot_tolerance: 1
  min_cycle_duration:
    seconds: 5
  precision: 0.5
  initial_hvac_mode: "off"
  openings:
    - binary_sensor.window_bathroom_up
    - binary_sensor.window_bedroom_1
    - binary_sensor.window_bedroom_2
- platform: dual_smart_thermostat
  name: Heater Ground
  heater: switch.sonoffriscterra
  target_sensor: sensor.temperature_ground
  away_temp: 16
  min_temp: 10
  max_temp: 22
  target_temp: 18
  cold_tolerance: 0.1
  hot_tolerance: 1
  min_cycle_duration:
    seconds: 5
  precision: 0.5
  initial_hvac_mode: "off"
  openings:
    - binary_sensor.window_bathroom_ground
    - binary_sensor.window_kitchen
    - binary_sensor.window_living_room
    - binary_sensor.window_sliding
    - binary_sensor.main_door
- platform: dual_smart_thermostat
  name: Heater Down
  heater: switch.sonoffriscsotto
  target_sensor: sensor.temperature_down
  away_temp: 6
  min_temp: 6
  max_temp: 20
  target_temp: 6
  cold_tolerance: 0.1
  hot_tolerance: 1
  min_cycle_duration:
    seconds: 5
  precision: 0.5
  initial_hvac_mode: "off"
  openings:
    - binary_sensor.window_bathroom_down
    - binary_sensor.window_basement_1
    - binary_sensor.window_basement_2

override80 avatar Jul 05 '22 13:07 override80