Skip to content

Weather notification through RGB light in Home Assistant and Node-RED

Recently while discussing the subject of home automation with my SO, she mentioned that she’d like a way to be notified what the weather was going to be when she’s getting ready.  The timing of this couldn’t be any better as I had just started playing around with an automation to do this very thing.

The best and worst part of this was that I already have all the hardware installed to make this happen. Our hallway has a receptacle where I’ve mounted the Xiaomi Hub (pronounced shaw-me) as well as a motion sensor in the ceiling fixture.  The has an RGB LED light ring that will be in the perfect location in front of the bathroom.  Luckily, because I live in San Francisco, we really only notification for abnormal weather of it being hot (above 72 degrees) or raining.  Yes, I know 72 isn’t hot if you are in many parts of the world, but for SF residents it’s hot.

Node-RED is my automation engine for all of my Home Assistant needs, so naturally, this is where it’s built.  Here is what the flow looks like. It is available here for you to import into your system.

Node-RED flow for weather notification via RGB light

This is a pretty basic flow:

  1. It’s triggered by the hall motion sensor
  2. If the time is between the set range, the flow continues
  3. The flow splits into two and checks each individual weather entity, and if it meets the requirement, the flow continues to trigger each light.
  4. If a weather flow continues, it also triggers a 60-minute timer to turn off the light

Some things to note:

  • There is a throttling node that limits the number of times this “runs” to once per half hour
  • A second delay helps spread out the requests to HA
  • Before turning off the light, I set it to white for a split second so that a future turn-on of the light will be white instead of the previously set red or blue
  • This can easily be expanded to multiple other weather entities and to include additional lights
Published inHome AssistantHome Automation

2 Comments

  1. Anonymous Anonymous

    Out of interest, do the blue and red objects relate to separate lights? If they are the same do I understand correctly that if it’s hot and raining you will see the light go red for 1 second and then turn blue?

  2. DK DK

    They are the same light. In my climate, it does not rain when it’s above my heat threshold, so I didn’t make the automation take that into account.

Leave a Reply

Your email address will not be published. Required fields are marked *