Jonathan's Blog
Creating Home Assistant automated alerts for high humidity and temperature

Creating Home Assistant automated alerts for high humidity and temperature

Published

I haven't been motivated for the last several months due to some work stress, but that is changing, and it's a new year. Time to come back to do some blogging.

Back in June of '24, I wrote an article about using humidity sensors around my house and integrating them with Home Assistant. I intended to follow that up with this article on getting some alerting going when the humidity got too high.

AcuRite 06044M
AcuRite 06044M
AcuRite 06044M wireless temperature and humidity sensors
Buy on Amazon

Shortly after I wrote that post, the freezer got left open just enough to cause a problem. I found that AcuRite also has refrigerator and freezer sensors. Now, in total, I have 6 humidity sensors around the house and a pair of frig/freezer sensors.

AcuRite 00523M
AcuRite 00523M
AcuRite 00523M wireless Fridge and Freezer Thermometer
Buy on Amazon

Prep work

I'm using the built-in HTML5 push notifications to get my alerts. My desktop and phones use the PWA version of the app.

You'll need to follow HA's instructions for enabling the push notifications .

Setting Up the Alerts

There are two ways you can set up the automation. You can either do it from the UI (which is probably easier) or you can add the code to the automation.yaml file.

  1. From your HA instance, you'll want to go to Settings → Automations & scenes → Create Automation → Create new automation.
  2. Click the "Add Trigger" button, select Entity, and then select "Numeric state".
    new home assistant automation screen

  3. You'll want to populate the Entity section with one or more sensors. For my setup, I have all of my humidity sensors listed in one automation.
  4. For the Attribute, select "Humidity". You could also create an alert for temperature or battery level.
  5. I set the lower limit to a "Fixed number" of above 60. That means that if any sensor reaches a humidity of 61 or more, this automation will trigger.
  6. In the "For" box, I set mine to 15 minutes. The added condition will help avoid excessive alerting. The humidity has to be 61 or more for at least 15 minutes before the automation will trigger.
  7. Under "Then do" click "Add Action".
    1. Search for "html5" and select "Notifications: Send a notification with html5".
  8. Click on the kebab menu and select "Edit in YAML". Because this automation uses templates, you can't use the visual editor.
    edit template as yaml

  9. Add the code below and save.
data:
  message: |
    {{ trigger.to_state.name }} too high for {{ trigger.for }}
  title: |
    Humidity sensor is high at {{ now().strftime('%m/%d %I:%M%p') }}
  url: https://ha.jonathanpeterson.dev:8123/lovelace/monitoring
action: notify.html5

Here's an example of what this alert would look like.

humidity alert

I did the same thing for both the fridge and freezer. Find what numbers work for you.

Here's what the automation looks like in the UI.

completed automation

I hope that was helpful to you. Let me know if you have any questions in the comments or would be interested in other HA topics!

Home Assistantautomationhome automationacurite

Remember to share this post!

X LinkedIn

Jonathan Peterson

Fifteen years of web development experience on the Microsoft tech stack creating both internal enterprise applications and public-facing websites.