Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 67 additions & 3 deletions blueprints/automation/awtrix_weatherflow.yaml
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add a toggle button to turn these effects on/off before I can merge

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's on me! I had completely forgotten about this PR. i'm away at the moment but i should be able to patch it up next week and resolve the conflicts + make the selection to turn the weather effect on/off!

Original file line number Diff line number Diff line change
Expand Up @@ -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 :)
#-----------------------------------------
Expand Down Expand Up @@ -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
#-----------
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -959,6 +1020,9 @@ action:
"lifetime": 120,
"lifetimeMode":1,
"weather": "{{current_condition}}"
{% if show_overlay %}
,"overlay": "{{overlay}}"
{% endif %}
}

- action: mqtt.publish
Expand Down