Skip to content

Commit 43fde0f

Browse files
committed
rainviewer: fix raw formatting
1 parent 368a8d4 commit 43fde0f

File tree

1 file changed

+10
-4
lines changed
  • showcase/animated-or-static-rainviewer-layer

1 file changed

+10
-4
lines changed

showcase/animated-or-static-rainviewer-layer/README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ I just wanted to share my config after creating a rainviewer overlay, and correc
1111
I'll lay out the code first, then mention some hurdles I had, and how I worked around them.
1212

1313
Firstly, in your configuration.yaml, you'll need rest sensors to get the current frame, and previous frames from rainviewer:
14+
1415
{% raw %}
1516
```yaml
1617
rest:
@@ -23,12 +24,13 @@ rest:
2324
value_template: "{{ value_json.radar.past[-10:] | map(attribute='path') | join(',') }}"
2425
```
2526
{% endraw %}
26-
Adjust the value_json.radar.past[-10:] to suit your needs. I left it at -10 even though I only animate 5 frames (for resource purposes.)
2727
28+
Adjust the value_json.radar.past[-10:] to suit your needs. I left it at -10 even though I only animate 5 frames (for resource purposes.)
2829
2930
Next, you'll need two helpers:
3031
3132
First, one that is the frame number index that will be changed via an automation:
33+
3234
{% raw %}
3335
```
3436
input_number.rainviewer_frame_index
@@ -38,16 +40,17 @@ Step size: 1
3840
Display Mode: Slider
3941
```
4042
{% endraw %}
41-
Second, you'll need a template sensor
4243
43-
sensor.rainviewer_current_frame
44+
Second, you'll need a template sensor: `sensor.rainviewer_current_frame`:
45+
4446
{% raw %}
4547
```jinja
4648
{% set frames = states('sensor.rainviewer_frames').split(',') %}
4749
{% set idx = states('input_number.rainviewer_frame_index')|int(0) %}
4850
{{ frames[idx] if frames|length > idx else frames[-1] }}
4951
```
5052
{% endraw %}
53+
5154
Now, We need to create an automation to cycle the frames on the map:
5255

5356
{% raw %}
@@ -86,6 +89,7 @@ actions:
8689
{% endraw %}
8790

8891
Lastly, the card itself. This is a stripped down anonymized version:
92+
8993
{% raw %}
9094
```yaml
9195
type: custom:map-card
@@ -132,6 +136,7 @@ Some of my lower end clients aren't super happy with the map with the animation
132136
I'm running homeassistant OS as a VM on a healthily configured Dell R730XD running proxmox and I was still experiencing some lag on the map until I added the purge to the automation.
133137

134138
If you don't want or need animation, All you would need to overlay the latest radar images is the first rest sensor:
139+
135140
{% raw %}
136141
```yaml
137142
rest:
@@ -143,7 +148,8 @@ rest:
143148
```
144149
{% endraw %}
145150

146-
then adjust the card yaml and add this:
151+
Then adjust the card yaml and add this:
152+
147153
{% raw %}
148154
```yaml
149155
tile_layers:

0 commit comments

Comments
 (0)