Created
October 1, 2023 21:04
-
-
Save GuySie/9e536ba167d8fe66d9f296628e9d29c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{%- set raindata = state_attr("sensor.nodered_rain_buienalarm","data")["precip"] %} | |
{%- for fifteenminutes in raindata|batch(3) %} | |
{%- if loop.index > 8 %}{{""}} | |
{%- else %} | |
{%- set rainintensity = fifteenminutes|max %} | |
{%- if rainintensity < 0.1 %}{{"▁"}} | |
{%- elif 0.1 <= rainintensity < 0.5 %}{{"▂"}} | |
{%- elif 0.5 <= rainintensity < 1 %}{{"▃"}} | |
{%- elif 1 <= rainintensity < 1.5 %}{{"▄"}} | |
{%- elif 1.5 <= rainintensity < 2 %}{{"▅"}} | |
{%- elif 2 <= rainintensity < 3.5 %}{{"▆"}} | |
{%- elif 3.5 <= rainintensity < 5 %}{{"▇"}} | |
{%- elif 5 <= rainintensity < 10 %}{{"█"}} | |
{%- else %}{{"▓"}} | |
{%- endif %} | |
{%- endif %} | |
{%- endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment