Skip to content

Commit

Permalink
Update weather-display.md
Browse files Browse the repository at this point in the history
Looks like I added to the old 2023.9 branch.  Adding here, too!  Also, recently discovered 'continue_on_error' which is pretty awesome!
  • Loading branch information
trip5 authored Mar 7, 2024
1 parent 07c3143 commit c755e92
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions wiki/weather-display.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,27 @@ action:
g: 192
b: 192
```
### Add error-checking to sensors which may go offline (note the continue_on_error bit too!)
```
- service: esphome.pixelclock_icon_screen
data:
default_font: true
icon_name: >-
weather_{{ states('sensor.openweathermap_condition')|replace("-",
"_") }}
text: >
{% set state = states('sensor.openweathermap_temperature') %} {% if
is_number(state) %}
{{ state|round(1) }}°
{% else %}
{{ "error" }}
{% endif %}
lifetime: 5
screen_time: 3
r: 192
g: 192
b: 192
continue_on_error: true
```

0 comments on commit c755e92

Please sign in to comment.