So earlier this month, in my review of the ThermoPro Bluetooth Thermometer, I mentioned some ‘additional functionality’ in Home Assistant that I would write about. Well, later is now, and I’m going to talk about how I have a temperature-controlled fan in our bedroom, powered by Home Assistant and its Generic Thermostat integration.
Generic Thermostat is one of the older Home Assistant integrations, having been around for several years. It allows you to take any temperature sensor, and any smart switch, and automatically turn the switch on and off in response to temperature fluctuations. In essence, Home Assistant itself provides the thermostat functionality.
The switch should power something that can either heat up or cool down a space – for example, a plug-in heater, or an air-conditioning unit. In my case, I’ve hooked it up to a standard pedestal fan, and used a smart socket to turn the fan on or off at the plug.
Enabling the integration
Note: within days of publishing this blog post, Home Assistant 2024.7.1 was released, which allows you to configure the Generic Thermostat through the Lovelace UI, so you don’t need to add the YAML code anymore.
I mentioned that it’s an old integration, and sadly it’s not one that has been updated much since it was implemented. This means that you can’t add it using the Home Assistant interface (Lovelace), and instead you’ll need to add it to your configuration.yaml file.
Here’s mine:
# Generic thermostat
climate:
- platform: generic_thermostat
name: Bedroom thermostat
heater: switch.bedroom_fan_socket
target_sensor: sensor.tp357s_55ab_temperature
min_temp: 15
max_temp: 30
ac_mode: true
target_temp: 19
cold_tolerance: 0.5
hot_tolerance: 0.5
min_cycle_duration:
minutes: 20
away_temp: 19
precision: 0.1Here’s what each variable refers to:
- Platform specifies the integration, and the Name is the friendly name of the device.
- Heater is the name of the entity that controls the smart socket that the fan is attached to.
- Target_sensor is the name of the thermostat entity that provides the temperature.
- Min_temp and Max_temp set the minimum and maximum temperatures that you’ll see on the Climate card in Lovelace – I’ve set these to 15°C and 30°C respectively.
- AC_mode is set to ‘true’ because we’re using a device that’s supposed to cool down the room. If this were a heater, I would leave this line out.
- Target_temp is the temperature that I want the thermostat to achieve, which is 19°C.
- Cold_tolerance and Hot_tolerance mean that Home Assistant will only turn on the fan when the room reaches 19.5°C, and will only turn it off when it reaches 18.5°C.
- Min_cycle_duration means that if Home Assistant turns the fan on, it should stay on for at least 20 minutes, and vice-versa, so it’s not constantly cycling on and off.
- Precision is how much precision I want when setting the temperature; at 0.1, this means I can set it to 1/10th a degree.
Once you’ve added or amended the settings for your thermostat, you’ll need restart Home Assistant.
How it works in practice
So, once set up, if the temperature in our bedroom reaches 19.5°C, the fan will come on. It’ll then stay on until the room reaches 18.5°C, or 20 minutes, whichever happens first.
You can also control the thermostat like you would with, say, a Nest thermostat through Home Assistant. It will create an entity which you can add a card for on your dashboard. So, although you may have set a target temperature in the initial configuration, you can change this without editing your configuration file. However, if you re-start Home Assistant, it may forget this.
If you also use Google Assistant or Alexa, then you can also make them see and interact with your generic thermostat, if you have integrated these with Home Assistant.
Whilst I use a fan and a smart switch, if you have an air conditioning unit with an RF control, you could use an RF bridge to allow General Thermostat to control it.
Fans vs air conditioning
If you do use a fan with Generic Thermostat, you’ll notice that your fan may stay on for a long time. That’s because fans don’t actually cool the air; they move air around which helps sweat evaporate more quickly. That makes you cooler, but not the air around you. It’s a bit like a hot day at the seaside, where the breeze takes the edge off the heat.
Air conditioning systems actually cool the air down, but are much more expensive and need an outlet for the hot air to be pumped out. Most British homes don’t have air conditioning, including ours – most of the year, it’s too cold, and our houses are designed to retain heat.

