Month 4 Box - Smart Home

Lesson 6 - Climate Control

Climate Control: Temperature and Humidity Automation

Now your home can sense how it feels. The Zigbee temperature and humidity sensor reports the conditions in a room in real time, and you will use it to act automatically, turning on a fan when it gets too warm and off when it cools down, plus alerting you when humidity gets uncomfortable. This gives you simple, fully self-hosted thermostat-like behavior.

What the sensor measures

The sensor gives you two readings: temperature, in Celsius or Fahrenheit, and relative humidity, how much moisture is in the air. Humidity matters more than people expect; a room can feel oppressive at a moderate temperature if the humidity is high, and sustained high humidity can encourage mold. With both numbers, your home can respond to how a space actually feels, not just how warm it is.

Placing it for honest readings

Where you put the sensor determines whether its data is meaningful. Keep it away from a vent, a heater, or a window, because those create local hot or cold spots that skew the reading. You want the general feel of the room, so mount it in an open spot at a normal height. Give it a minute after pairing and you will see live values updating every few seconds, which you can also graph over time to spot patterns like an afternoon warm-up.

Threshold automations and why two thresholds

You control a fan with numeric thresholds. One automation turns the fan on when the temperature rises above a value, say 75 degrees Fahrenheit; another turns it off when the temperature falls below a lower value, say 72. Using two different thresholds rather than one is deliberate: if the on and off points were identical, the fan would flick on and off rapidly every time the temperature hovered right at that number. The gap between the two, on high, off lower, gives stable, thermostat-like behavior. This gap is called hysteresis.

Working through it

Pair the sensor. Add it through ZHA using its reset button or battery tab, name it, and assign the room it will monitor.

Place it well. Mount it away from vents, heaters, and windows so it reads the room's real conditions, and wait a minute for live values.

View and graph the data. Open the sensor to see temperature and humidity updating, and view the history graph to spot patterns.

Automate the fan on. Create an automation with a numeric-state trigger on the temperature above your high threshold, action turn on the fan plug.

Automate the fan off. Create a second automation triggered when the temperature drops below a lower threshold, action turn off the fan plug.

Fan on above 75F, off below 72F (with hysteresis)

# Automation 1: fan ON when it gets warm
alias: Fan on when hot
trigger:
  - platform: numeric_state
    entity_id: sensor.bedroom_temperature
    above: 75            # degrees F
action:
  - service: switch.turn_on
    target: { entity_id: switch.fan_plug }

# Automation 2: fan OFF once it cools down
alias: Fan off when cool
trigger:
  - platform: numeric_state
    entity_id: sensor.bedroom_temperature
    below: 72            # a few degrees lower than the on point
action:
  - service: switch.turn_off
    target: { entity_id: switch.fan_plug }

The fan turns on above 75 and off below 72. The 3-degree gap is the hysteresis that stops the fan from rapidly cycling when the temperature sits near a single threshold. Adjust both numbers to your comfort.

Common mistakes and troubleshooting

Readings look wrong or jumpy. Move the sensor away from vents, heaters, and windows so it measures the room, not a local hot or cold spot.

The fan rapidly cycles on and off. Use different on and off thresholds (hysteresis) instead of the same value, so it does not toggle at the boundary.

Confusing temperature units. Set your preferred unit in Home Assistant and use matching numbers in your thresholds.

No humidity awareness. Add an automation that alerts when humidity is high; sustained high humidity is uncomfortable and can cause mold.

Next: Next you will pack control into a single Zigbee smart button that can trigger anything.