Special thanks to shandoosheri for getting this to work on older versions of Home Assistant, which gave me an easy blueprint to follow. And thanks @kevinvincent for writing a nice
custom_componentreadme for me to fork.
This component is a straightfoward fork of the mainline generic_thermostat.
- Have HACS installed, this will allow you to easily update
- Add
https://github.com/zacs/ha-dualmodegenericas a custom repository as Type: Integration - Click install under "Dual Mode Generic Thermostat", restart your instance.
- Download this repository as a ZIP (green button, top right) and unzip the archive
- Copy
/custom_components/dualmode_genericto your<config_dir>/custom_components/directory- You will need to create the
custom_componentsfolder if it does not exist - On Hassio the final location will be
/config/custom_components/dualmode_generic - On Hassbian the final location will be
/home/homeassistant/.homeassistant/custom_components/dualmode_generic
- You will need to create the
Add the following to your configuration file
climate:
- platform: dualmode_generic
name: My Thermostat
unique_id: climate.my_thermostat
heater: switch.heater
cooler: switch.cooler
fan: switch.fan
fan_behavior: cooler
dryer: switch.dryer
dryer_behavior: cooler
target_sensor: sensor.temperature_sensor
reverse_cycle: cooler, heater
enable_heat_cool: True
min_temp: 16
max_temp: 30
cold_tolerance: 0.8
hot_tolerance: 0.4
min_cycle_duration:
minutes: 20fan_behavior: [cooler, neutral, heater] # <-- only one
dryer_behavior: [cooler, neutral, heater] # <-- only onereverse_cycle: cooler, heater, dryer, fan # <-- multiple are possible, (True/False) are still valid for backward compatibilityThe component shares the same configuration variables as the standard generic_thermostat, with some exceptions:
- A
coolervariable has been added where you can specify theentity_idof your switch for a cooling unit (AC, fan, etc). - A
fananddryervariable have been added where you can specify theentity_ids of your switches for a fan and/or dryer unit. - All the
switches/input_booleansare optional, so the user can decide which modes he wants to use (some HVAC only supportsCool,Dry,Fan_only). This together withtemplate_switchesmakes for a great way to make mobile HVACs controllable via IR. - If the your climate unit offers multiple modes (e.g. a reverse cycle air conditioner) setting
reverse_cycletocooler, heaterwill ensure the device isn't switched off entirely when switching modes - The
ac_modevariable has been removed, since it makes no sense for this use case. target_temp_highandtarget_temp_lowset the default value for the upper and lower setting for temperature range when inHEAT_COOLmode
Refer to the Generic Thermostat documentation for details on the rest of the variables. This component doesn't change their functionality.
-
For
HEATorCOOLmodes, the thermostat will follow standard mode-based behavior: if set to "cool," the only switch which can be activated is thecooler. This means if the target temperature is higher than the actual temperateure, theheaterwill not start. Vice versa is also true. -
For
HEAT_COOLmode, the thermostat will attempt to maintain the temperature within the set range, turning on the configured heater when the temperature drops below the bottom of the range bycold_toleranceand turning on the configured cooler when the temperature rises above the top of the set range by thehot_toleranceamount. When the measured temperature is within the configured range by(hot|cold)_tolerancethe thermostat will transition to idle mode and both heater and cooler will be turned off.- This mode needs to be enabled explicitly by setting
enable_heat_cooltoTrue! - Be careful with
min_cycle_duration! If you set it too high, your AC will bounce between too hot and too cold when usingheat_cool!
- This mode needs to be enabled explicitly by setting
-
Keepalive logic has been updated to be aware of the mode in current use, so should function as expected.
-
By default, the component will restore the last state of the thermostat prior to a restart.
-
While
heater/cooler/dryer/fanare documented to beswitches, they can also beinput_booleans if necessary. Note that these are assumed to be exclusively for the use of the thermostat - the thermostat will report its mode and change its behaviour based on the position of these switches.
- Setup your logger to print debug messages for this component using:
logger:
default: info
logs:
custom_components.dualmode_generic: debug- Restart HA
- Verify you're still having the issue
- File an issue in this Github Repository containing your HA log (Developer section > Info > Load Full Home Assistant Log)
- You can paste your log file at pastebin https://pastebin.com/ and submit a link.
- Please include details about your setup (Pi, NUC, etc, docker?, HASSOS?)
- The log file can also be found at
/<config_dir>/home-assistant.log