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

Error in getting auto mode to work, seems to only work in either heat, or cool mode

Open stevenmcastano opened this issue 2 years ago • 1 comments

Anytime I try to set the thermostat to auto to control both my AC unit and my heater is throws out an error:

Oct 18 02:08:44 1119n-ha-001 homeassistant[872]: #033[31m2022-10-17 22:08:44.566 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [2625121392] '>=' not supported between instances of 'NoneType' and 'float'
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]: Traceback (most recent call last):
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 202, in handle_call_service
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     await hass.services.async_call(
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/usr/src/homeassistant/homeassistant/core.py", line 1738, in async_call
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     task.result()
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/usr/src/homeassistant/homeassistant/core.py", line 1775, in _execute_service
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 207, in handle_service
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     await service.entity_service_call(
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     future.result()  # pop exception if have
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 931, in async_request_call
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     await coro
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     await result
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 613, in async_service_temperature_set
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     await entity.async_set_temperature(**kwargs)
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/config/custom_components/dual_smart_thermostat/climate.py", line 589, in async_set_temperature
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     await self._async_control_climate()
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/config/custom_components/dual_smart_thermostat/climate.py", line 662, in _async_control_climate
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     await self._async_control_heat_cool(time, force)
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/config/custom_components/dual_smart_thermostat/climate.py", line 793, in _async_control_heat_cool
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     too_cold = self._is_too_cold("_target_temp_low")
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/config/custom_components/dual_smart_thermostat/climate.py", line 988, in _is_too_cold
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     return target_temp >= self._cur_temp + self._cold_tolerance
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]: TypeError: '>=' not supported between instances of 'NoneType' and 'float'#033[0m

And here is my config that I'm using to try to drive it:

climate:
  - platform: dual_smart_thermostat
    unique_id: "c135dffc-8fae-4ef0-b3f8-0aa2c1af8c2f"
    name: Bedroom Thermostat
    ac_mode: false
    cooler: input_boolean.input_boolean_bedroom_fan
    heater: input_boolean.input_boolean_bedroom_convector
    target_sensor: sensor.bedroom
    target_temp: 72
    initial_hvac_mode: "heat_cool"
    min_cycle_duration:
      seconds: 5
    cold_tolerance: 0.3
    hot_tolerance: 0.3
    min_temp: 40
    max_temp: 85
    comfort_temp: 72

Any help would be MUCH appreciated... this is exactly the dual mode type of thermostat I need with separate heating and cooling units!

stevenmcastano avatar Oct 18 '22 02:10 stevenmcastano

It also does not work on my side, and the representation is strange

mat1990dj avatar Oct 31 '22 16:10 mat1990dj

Fixed by this perhaps? #35

sebastian-steinmann avatar Nov 05 '22 06:11 sebastian-steinmann

Seems to work if you specify target_temp_low and target_temp_high

sebastian-steinmann avatar Nov 05 '22 07:11 sebastian-steinmann

Did you set heat_cool_mode: true? I just realized I forgot to and it fixed my issues https://github.com/swingerman/ha-dual-smart-thermostat#heat_cool_mode

linuxdaemon avatar Mar 07 '23 22:03 linuxdaemon

For heat/cool mode, you need to set:

heat_cool_mode: true
target_temp_low: xx
target_tem_high: xx

swingerman avatar Mar 17 '24 14:03 swingerman