Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error setting up dual_smart_thermostat at boot #7

Closed
override80 opened this issue Apr 7, 2022 · 3 comments · Fixed by #15
Closed

Error setting up dual_smart_thermostat at boot #7

override80 opened this issue Apr 7, 2022 · 3 comments · Fixed by #15
Assignees

Comments

@override80
Copy link

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!

swingerman pushed a commit that referenced this issue May 13, 2022
- adds off, cool heat, heat_cool hvac modes
- remembers last hvac_mode after restart (only if initial_hvac_mode is not set)
- no platfrom setup error on startup

Fixes #8
Fixes #7
Fixes #5
swingerman pushed a commit that referenced this issue May 13, 2022
- adds off, cool heat, heat_cool hvac modes
- remembers last hvac_mode after restart (only if initial_hvac_mode is not set)
- no platfrom setup error on startup

Fixes #8
Fixes #7
Fixes #5
@override80
Copy link
Author

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

@swingerman
Copy link
Owner

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

@override80
Copy link
Author

override80 commented Jul 5, 2022

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

@swingerman swingerman reopened this Jul 17, 2022
@swingerman swingerman pinned this issue Jul 17, 2022
@swingerman swingerman self-assigned this Jul 17, 2022
@swingerman swingerman unpinned this issue Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants