Sunday, September 14, 2025

Weather Alerting System for Home Assistant

When we last left off 2 years ago, my huge project was baking weather alerting features into the HA system. Sure, we have a couple of NOAA weather radios and messages on our phones, but if we have an HA system in the house - why not do some cool stuff with it?

So - that's what I did.

Over the next 2 years, I fine tuned things, found what worked and what didn't, and have a system now that I think works really well.

For starters: my ideas for using a flashing red pattern for tornado & severe thunderstorm warnings had to go away. Both Meross and Govee block all attempts to flash their lights as I wanted (think: Star Trek red alert), warning that it exceeds their API access limits. Thus, no more flashing red; steady red was going to be the way it worked.

I made a lot of tweaks and changes over the next two years. I had a strip of lights outside, wrapped around the pole that holds my outside light. It eventually died in a blistering heat wave, so it's gone.

I added a Govee can light in one room to change colors as necessary. I added that to a Wyze color bulb in an old table lamp fixture; one of the old original Meross strips; and then a Govee dual-LED fixture. All of these ended up being my "alert lights" which, more or less, worked OK. I also had conditional cards that would pop up on most of the wall-mounted tablets around the house.

The logic for making all of that work was insanely complex, though. Making one change (like, adding logic to turn the lights red if a smoke detector activated) was very touchy and prone to a cascading unintentional error. So, with the help of AI, I blew up the entire system and started over. I now have a system that, so far, has been stable and easy to modify as necessary.

An important tip that I can add is to USE PACKAGES. Don't put everything in configuration.yaml. I ended up making a package for each of the subroutines that I added to HA. Doing so means that I can make changes to a small section of my system A) without having to restart the whole system, and B)  minimizing the risk of collateral damage unrelated parts of the system.

Honestly, I wish I'd broken things out into packages a long, long time ago. If I could go back in time and tell the "younger HA me" some tips, this would easily be one of them. 

Moving forward (and in use now) are decluttering templates. By making templates up in the raw configuration editor, I can reuse those templates anywhere in my setup and the cards will always look the same. Another great feature is that the cards can be built with a minimal amount of code on the actual dashboard. I bring this up because for my Lovelace conditional cards that appear under certain conditions, I no longer have to define every card as a conditional card on every dashboard or view! I define it once like this:

type: custom:decluttering-card
template: critical_alerts_block
variables:
  - header: CRITICAL ALERTS

Then, with every type of card already defined in the template critical_alerts_block, they'll all always show up the same on every display. For example: 

 

or

 

Those 4 lines of code above are included on every display. If any other condition were triggered, such as a smoke detector activation, blizzard warning, freezer high temperature alarm... anything that I want to know about in a hurry, those would also show up here; and again, using just those 4 lines of code. By itself, that was a HUGE way to simplify the process. Set it once as a decluttering template and forget about it. Under the old conditional card system, I had to touch every dashboard and make a modification.

 I have my alerts broken down into these categories: 

RED LEVEL – these alerts turn all alerting lights red; display a card on all wall displays; display a message on all display matrices; and produce a sound on all Amazon Echo devices. This level is activated when any of the following actions take place on the HA system:
    • Tornado Warning
    • Severe Thunderstorm Warning
    • Smoke Alarm Activated
    • Boiler Over Temperature
    • Security Alert
    • General Alert
    • Major Solar Storm (wall display card only)

PURPLE LEVEL - these alerts turn all alerting lights purple; display a card on all wall displays; display a message on all display matrices; and produce a sound on all Amazon Echo devices. This level is activated when any of the following actions take place on the HA system:

    • Freezer Over Temperature

ORANGE LEVEL - these alerts turn all alerting lights orange and display a card on all wall displays. This level is activated when any of the following actions take place on the HA system:

    • Flash Flood Warning
    • Excessive Heat Warning
    • Dust Storm Warning
    • Moderate Solar Storm (wall display card only)

BLUE LEVEL - these alerts turn all alerting lights blue and display a card on all wall displays. This level is activated when any of the following actions take place on the HA system:

    • Blizzard Warning
    • Winter Storm Warning
    • Ice Storm Warning
    • Wind Chill Warning

YELLOW LEVEL - these alerts turn all alerting lights yellow and display a card on all wall displays. This level is activated when any of the following actions take place on the HA system:

    • Tornado Watch
    • Severe Thunderstorm Watch
    • Internet Down Condition
    • Minor Solar Storm (wall display card only)

There is a lot here to still unpack and talk about in the blog. For example, the use of 32x64 LED display matrices throughout the house. My goal with this entry is to catch readers up on the changes I've made in the overall alerting system. I'll keep expanding on that, and all other aspects of my system, as we go on. 

 

No comments:

Post a Comment

So Long Microsoft! Hello Pi!

Another one of the most stable things I did was ditching the VM I was using to run HA and go to a Raspberry Pi. I was using Microsoft Window...