Weather Light

So I’m from the same county as Flint, MI and love sharing my weather ball. Plus in a community of Smart Home entusiasts you’re not easy to impress as my family and friends. :stuck_out_tongue:

Flint has a weather ball which has a jingle with it. When The Weatherball Is Red…

I actually started this several years back on ST. However, it’s very well improved on Home Assistant.

I have a weather station outside my house and a Hue Lilly Light pointed at it.

I have one template sensor that keeps track of my Weather Station’s High throughout the day.

      - name: "Actual High Sensor"
        state: >
          {% if states('sensor.weather_pws') | float > states('input_number.actualhigh') | float %}
            true
          {% else %}
            false
          {% endif %} 

I then have two sensors (really four but only because of NWS time switches not matching sunset/sunrise lol) that compare the Weather’s stations high throughout the day. After the light turns on post-sunset it checks this sensor to determine it’s color based off my nearest NWS forecasted temp.

  - sensor:
      - name: "Weather Light Colors"
        state: >
          {% if state_attr('weather.kfnt_daynight', 'forecast').1.temperature | float < states('input_number.actualhigh') | float -5 %}
            blue
          {% else%}
          {% if state_attr('weather.kfnt_daynight', 'forecast').1.temperature | float > states('input_number.actualhigh') | float +5 %}
            red
          {% else %}
            yellow
          {% endif %} 
          {% endif %}    

I then have another sensor that looks for trigger words to flash the light periodically throughout the night to signal preciption in the forecast.

  - sensor:
      - name: "Weather Light Flash"
        state: >   
          {% if 'flurry' in state_attr('weather.kfnt_daynight', 'forecast').1.detailed_description | string or 'thunderstorm' in state_attr('weather.kfnt_daynight', 'forecast').1.detailed_description | string or 'rain' in state_attr('weather.kfnt_daynight', 'forecast').1.detailed_description | string or 'snow' in state_attr('weather.kfnt_daynight', 'forecast').1.detailed_description | string or 'preciption' in state_attr('weather.kfnt_daynight', 'forecast').1.detailed_description | string or 'shower' in state_attr('weather.kfnt_daynight', 'forecast').1.detailed_description | string or 'blizzard' in state_attr('weather.kfnt_daynight', 'forecast').1.detailed_description | string or 'snowfall' in state_attr('weather.kfnt_daynight', 'forecast').1.detailed_description | string or state_attr('weather.kfnt_daynight', 'forecast').1.precipitation_probability | int > 60 %}
            true
          {% else %}
            false
          {% endif %}

I have several automations built around this to make sure the time and the NWS match. They aren’t exactly elagant and get long-winded so I won’t share them here lol but you get the idea.

I also put my own twist on it. The red color is the Hex colors of the Detroit Red Wings, the blue color is the Hex colors of the Flint Firebirds and the yellow color is the Hex colors of The Simpsons.

1 Like