Climate: Dual Mode Generic Thermostat

I have similar problem. Auto works well, except minimum on and off. But if I switch to heat or cool. It will never shut off as well.

Hi all,

I also had an issue on startup. Can someone help me?

Error doing job: Exception in callback DualModeGenericThermostat.async_added_to_hass.<locals>._async_startup(<Event homeassistant_start[L]>) at /config/custom_components/dualmode_generic/
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/", line 80, in _run, *self._args)
  File "/usr/src/homeassistant/homeassistant/", line 835, in _onetime_listener
    self._hass.async_run_job(listener, event)
  File "/usr/src/homeassistant/homeassistant/", line 452, in async_run_job
    return self.async_run_hass_job(HassJob(target), *args)
  File "/usr/src/homeassistant/homeassistant/", line 433, in async_run_hass_job*args)
TypeError: _async_startup() takes 0 positional arguments but 1 was given

Looks like a related (but opposite) error to the one reported above. What version of HA are you running? I’m guessing the old code needs to be updated so that _async_startup behaves in a more modern way, but I haven’t looked at the docs. I have a test HA instance I can use to debug sometime in the next week or so.

Hi Zacs,

Thats my setup:

dual_generic: last files on github

  - platform: dualmode_generic
    name: DTH1_LIVING
    unique_id: climate.DTH1
    heater: input_boolean.contact_dth1_heat
    cooler: input_boolean.contact_dth1_cool
#    fan:
#    fan_behavior: neutral
#    dryer: switch.dryer
#    dryer_behavior: cooler
    target_sensor: sensor.shelly_h_t_956332_temperature
#    reverse_cycle: cooler, heater
#    enable_heat_cool: false
    min_temp: 16
    max_temp: 30
    cold_tolerance: 0.1
    hot_tolerance: 0.2
        minutes: 15
#    initial_hvac_mode: "off"
#    away_temp: 16
#    precision: 0.1

@zacs I’ve been using your component for a little while, and I’m very happy with it. Thank you.

I’m having a problem I wonder if you can advise me on. For context, I’m dealing with a separate integration that crashes a lot, so I have to reboot Home Assistant on a fairly regular basis. Hopefully this will settle down soon, but…

When HASS reboots and loads the dualmode generic thermostat, I notice that it does not set the heater and cooler switches based on the current temperature state. I use input binary helpers as my on-off switches, which remember their state across reboots.

So for instance, if the heat was on when HASS crashed, but a few minutes pass before the reboot with the heat running, then the temperature might be above the heat set point at reboot. The heat switch doesn’t get set to off during restart and the heat keeps running, getting warmer and warmer. I wake up at 3 am with my bedroom at 90 degrees F.

I’ve considered some sort of automation to try to bump the thermostat up and down after restart to make sure it sets the heater switch to off, but I wonder if there is an initialize step in the thermostat that could set the switch to the correct state based on the current temperature.

Yah you definitely shouldn’t have to write an automation to deal with that. Does the switch ever correct itself (like a minute or five after reboot)?

I am considering taking a fresh fork of generic_thermostat and re-applying all the patches here. I originally forked it over two years ago, so I expect your issue may also be related to the async_startup item mentioned above.

I will of course post here if I am able to make the time to update it. Time is hard to come by these days :slight_smile:.

@zacs I made similar project with better functionality:

Take a look on it. May be don’t need to spend time on dualmode_generic:wink:


Hello zacs and thank you for your great work !

Since the hot season i’m struggling with one parameter.

In the winter the away_temp is set to 18°C and the target temp to 22 In the summer the target temp is still ok with 22, but an higher away temp is expected, as in this configuration :
Before leaving the house the AC is off with a 21°C temp, and then leaving the AC is on as the away temp is 18°C !

Is there any misconfiguration ?