diff --git a/blueprints/automation/awtrix_weatherflow.yaml b/blueprints/automation/awtrix_weatherflow.yaml index e5c822e..211194a 100644 --- a/blueprints/automation/awtrix_weatherflow.yaml +++ b/blueprints/automation/awtrix_weatherflow.yaml @@ -415,6 +415,40 @@ blueprint: unit_of_measurement: "sec" default: 30 + + show_overlay: + name: Show overlay animation + description: > + + Choose to show an animated overlay depicting the weather conditions. The following mappings are used: + + - **Clear**: `clear-night`, `cloudy`, `exceptional`, `fog`, `partlycloudy`, `sunny`, `windy`, `windy-variant` + → No animation, off + + - **Frost**: `hail` + → Light frost effect on the display + + - **Thunder**: `lightning`, `lightning-rainy` + → Rain animation with thunder flashes + + - **Storm**: `pouring` + → Heavy rain animation + + - **Drizzle**: `rainy` + → Light rain animation + + - **Snow**: `snowy`, `snowy-rainy` + → Snow falls vertically + + selector: + select: + options: + - label: Show weather overlay animation + value: "true" + - label: Do not show weather overlay animation + value: "false" + default: "true" + #----------------------------------------- # This was really annoying to generate :) #----------------------------------------- @@ -805,6 +839,33 @@ variables: {%- else %} {{ icon_dict[current_condition] }} {%- endif %} + + #-------------- + # Weather Overlay + #-------------- + overlay_dict: >- + {{ dict({'clear-night': 'clear', + 'cloudy': 'clear', + 'exceptional': 'clear', + 'fog': 'clear', + 'hail': 'frost', + 'lightning': 'thunder', + 'lightning-rainy': 'thunder', + 'partlycloudy': 'clear', + 'pouring': 'storm', + 'rainy': 'drizzle', + 'rain': 'rain', + 'snowy': 'snow', + 'snowy-rainy': 'snow', + 'sunny': 'clear', + 'windy': 'clear', + 'windy-variant': 'clear'})}} + overlay: > + {{ overlay_dict[current_condition] }} + show_overlay_input: !input show_overlay + show_overlay: > + {{ (show_overlay_input) == 'true' }} + #----------- # Moon Icon #----------- @@ -846,9 +907,9 @@ variables: {%- endif -%} trigger: - - trigger: time_pattern - seconds: /5 - - trigger: state + - platform: time_pattern + minutes: /1 + - platform: state entity_id: !input forecast_var id: Changes enabled: true @@ -959,6 +1020,9 @@ action: "lifetime": 120, "lifetimeMode":1, "weather": "{{current_condition}}" + {% if show_overlay %} + ,"overlay": "{{overlay}}" + {% endif %} } - action: mqtt.publish