Guide 8 : How to Integrate a Temperature and Humidity Sensor into Home Assistant

Adding a temperature and humidity sensor to your Home Assistant setup can provide valuable data for climate control, automation, and monitoring. Sensors can be used to trigger actions such as turning on fans, adjusting thermostats, or alerting you if the temperature or humidity exceeds certain thresholds.

What You Will Need:

  • A compatible temperature and humidity sensor, we recommend the Zigbee Temperature Humidity Sensor, though there are many alternatives (e.g., Xiaomi Aqara, Sonoff TH16, etc.)
  • A Zigbee hub (see previous guides))
  • Home Assistant running on a Raspberry Pi, virtual machine, or server (see previous guides)
  • The Home Assistant Zigbee integration (if you’re using Zigbee) (see previous guides)

Step 1: Prepare Your Sensor

Ensure that your sensor is powered on and ready to pair with your Zigbee hub or directly with Home Assistant. Most sensors will need to be in pairing mode for this process to work. Refer to the instructions that came with your device to ensure it is properly prepared for pairing.

Step 2: Pair the Temperature and Humidity Sensor

Let’s pair your temperature and humidity sensor.

  1. Go to Configuration > Devices & Services in Home Assistant.
  2. Click Add Device under the Zigbee integration.
  3. Your Home Assistant will start searching for available Zigbee devices. Put your temperature and humidity sensor into pairing mode. Refer to the device’s manual for how to do this (usually a button press or reset procedure).
  4. Once the sensor is detected, follow the prompts to add the device to Home Assistant.
  5. After pairing, you will see the sensor listed under Devices.

Step 3: Verify the Sensor in Home Assistant

After successful pairing, check that your sensor is reporting data:

  1. Navigate to Configuration > Devices & Services.
  2. Under Zigbee, find your sensor and click on it.
  3. You should see the temperature and humidity readings in the Entity list. The entities are usually named something like sensor.living_room_temperature and sensor.living_room_humidity.

Step 4: Add the Sensor to Your Dashboard

Once the sensor is detected, it’s time to add it to your Home Assistant dashboard for easy access.

  1. Go to your Home Assistant Overview (Dashboard).
  2. Click on the three dots in the top right corner and select Edit Dashboard.
  3. Click Add Card and choose a card that suits your needs. For temperature and humidity, the Sensor Card or Gauge Card would be ideal.
  4. Select your temperature and humidity sensors from the list of available entities.
  5. Save the card, and now you’ll have a live reading of your sensor on the dashboard.

Step 5: Create Automations Based on Sensor Readings

With your sensor data available, you can create automations to trigger actions based on the temperature or humidity.

Example: Turn on a Fan When the Temperature Exceeds 25°C

  1. Go to Configuration > Automations.
  2. Click Add Automation and choose Start with an empty automation.
  3. Under Trigger, select State and choose your temperature sensor (sensor.living_room_temperature).
  4. Set the condition to above 25.
  5. Under Action, select Device and choose the fan or smart plug to turn on the fan.
  6. Click Save to activate the automation.

Step 6: Test Your Setup

Test your sensor’s functionality by either manipulating the environment (changing the temperature or humidity) or checking its data in Home Assistant.

  1. Check that the sensor values are updating in the Entities section.
  2. Verify the automation works by triggering it manually or waiting for the conditions to be met.

Optional: Customize the Sensor’s Settings

Many sensors allow for advanced configurations, such as:

  • Reporting intervals: Adjust how often the sensor reports data.
  • Thresholds: Set high and low temperature or humidity thresholds.
  • State change notifications: Set up notifications when a significant change in temperature or humidity occurs.

You can adjust these settings in Developer Tools or through the device’s configuration page in Home Assistant.


Conclusion

You’ve now successfully added a temperature and humidity sensor to your Home Assistant setup! With the data provided by the sensor, you can create automations to optimize your home environment, improve comfort, and enhance energy efficiency. If you have multiple sensors around your home, you can further build out more complex automations to monitor and adjust different rooms or areas of your home.

Stay tuned for future guides where we’ll cover more sensor types and advanced use cases to maximize your Home Assistant setup.

Bonjour, il semble que vous visitez depuis la France.
En France, le nom commercial Smarthome-Europe est protégé, et utilisé par une société B2B qui n'est pas liée à ce site Smart Home Europe.
Leur site est : smarthome-europe.com