-
Notifications
You must be signed in to change notification settings - Fork 1
/
smhi_template.yaml
125 lines (121 loc) · 10.7 KB
/
smhi_template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
- platform: template
sensors:
smhi_vindriktning_text:
friendly_name: 'SMHI Vindriktning'
value_template: >-
{%if states.sensor.smhi_vindriktning.state | float<=11 %}Nord
{% elif states.sensor.smhi_vindriktning.state | float>348 %}Nord
{% elif states.sensor.smhi_vindriktning.state | float<=34 | float>11 %}Nord Nord Öst
{% elif states.sensor.smhi_vindriktning.state | float<=56 | float>34 %}Nord Öst
{% elif states.sensor.smhi_vindriktning.state | float<=79 | float>56 %}Öst Nord Öst
{% elif states.sensor.smhi_vindriktning.state | float<=101 | float>79 %}Öst
{% elif states.sensor.smhi_vindriktning.state | float<=124 | float>101 %}Öst Syd Öst
{% elif states.sensor.smhi_vindriktning.state | float<=146 | float>124 %}Syd Öst
{% elif states.sensor.smhi_vindriktning.state | float<=169 | float>146 %}Syd Syd Öst
{% elif states.sensor.smhi_vindriktning.state | float<=191 | float>169 %}Syd
{% elif states.sensor.smhi_vindriktning.state | float<=214 | float>191 %}Syd Syd Väst
{% elif states.sensor.smhi_vindriktning.state | float<=236 | float>214 %}Syd Väst
{% elif states.sensor.smhi_vindriktning.state | float<=259 | float>236 %}Väst Syd Väst
{% elif states.sensor.smhi_vindriktning.state | float<=281 | float>259 %}Väst
{% elif states.sensor.smhi_vindriktning.state | float<=304 | float>281 %}Väst Nord Väst
{% elif states.sensor.smhi_vindriktning.state | float<=326 | float>304 %}Väst Nord Väst
{% elif states.sensor.smhi_vindriktning.state | float<=348 | float>326 %}Nord Nord Väst
{%- endif %}
smhi_vadersymboler_text:
friendly_name: 'SMHI Vädersymboler'
value_template: >-
{%if states.sensor.smhi_vadersymboler.state | int==1 %}Klart himmel
{% elif states.sensor.smhi_vadersymboler.state | int==2 %}Molntussar
{% elif states.sensor.smhi_vadersymboler.state | int==3 %}Uppsprucket molntäcke
{% elif states.sensor.smhi_vadersymboler.state | int==4 %}Nästan mulet
{% elif states.sensor.smhi_vadersymboler.state | int==5 %}Mulet
{% elif states.sensor.smhi_vadersymboler.state | int==6 %}Riktigt tokigenmulet
{% elif states.sensor.smhi_vadersymboler.state | int==7 %}Dimma
{% elif states.sensor.smhi_vadersymboler.state | int==8 %}Lätta Regnskurar
{% elif states.sensor.smhi_vadersymboler.state | int==9 %}Medel Regnskurar
{% elif states.sensor.smhi_vadersymboler.state | int==10 %}Kraftiga Regnskurar
{% elif states.sensor.smhi_vadersymboler.state | int==11 %}Åskoväder
{% elif states.sensor.smhi_vadersymboler.state | int==12 %}Lätt Snöblandade regnskurar
{% elif states.sensor.smhi_vadersymboler.state | int==13 %}Medel Snöblandade regnskurar
{% elif states.sensor.smhi_vadersymboler.state | int==14 %}Kraftiga Snöblandade regnskurar
{% elif states.sensor.smhi_vadersymboler.state | int==15 %}Lätta Snöbyar
{% elif states.sensor.smhi_vadersymboler.state | int==16 %}Medel Snöbyar
{% elif states.sensor.smhi_vadersymboler.state | int==17 %}Kraftligta Snöbyar
{% elif states.sensor.smhi_vadersymboler.state | int==18 %}Lätt Regn
{% elif states.sensor.smhi_vadersymboler.state | int==19 %}Medel Regn
{% elif states.sensor.smhi_vadersymboler.state | int==20 %}Kraftligt Regn
{% elif states.sensor.smhi_vadersymboler.state | int==21 %}Åska
{% elif states.sensor.smhi_vadersymboler.state | int==22 %}Lätt Snöblandat regn
{% elif states.sensor.smhi_vadersymboler.state | int==23 %}Medel Snöblandat regn
{% elif states.sensor.smhi_vadersymboler.state | int==24 %}Kraftigt Snöblandat regn
{% elif states.sensor.smhi_vadersymboler.state | int==25 %}Lätt Snöfall
{% elif states.sensor.smhi_vadersymboler.state | int==26 %}Medel Snöfall
{% elif states.sensor.smhi_vadersymboler.state | int==27 %}Kraftlig Snöfall
{% elif states.sensor.smhi_vadersymboler.state | int>=28 %}Error
{%- endif %}
smhi_nederbordstyp_text:
friendly_name: 'SMHI Nederbördstyp'
value_template: >-
{%if states.sensor.smhi_typ_av_nederbord.state | int==0 %}Ingen nederbörd
{% elif states.sensor.smhi_typ_av_nederbord.state | int==1 %}Snö
{% elif states.sensor.smhi_typ_av_nederbord.state | int==2 %}Snöblandat Regn
{% elif states.sensor.smhi_typ_av_nederbord.state | int==3 %}Regn
{% elif states.sensor.smhi_typ_av_nederbord.state | int==4 %}Duggregn
{% elif states.sensor.smhi_typ_av_nederbord.state | int==5 %}Underkylt Regn
{% elif states.sensor.smhi_typ_av_nederbord.state | int==6 %}Underkylt Duggregn
{% elif states.sensor.smhi_typ_av_nederbord.state | int>=7 %}Error
{%- endif %}
smhi_sno_min:
friendly_name: 'SMHI Snö min'
unit_of_measurement: "cm"
icon_template: mdi:weather-snowy
value_template: >-
{%if states.sensor.smhi_temperatur.state | float>-1 | float<=0 %}{{ states.sensor.smhi_min_nederbord.state | float * 1 }}
{% elif states.sensor.smhi_temperatur.state | float>-2 | float<=-1 %}{{ states.sensor.smhi_min_nederbord.state | float * 1.2 }}
{% elif states.sensor.smhi_temperatur.state | float>-3 | float<=-2 %}{{ states.sensor.smhi_min_nederbord.state | float * 1.3 }}
{% elif states.sensor.smhi_temperatur.state | float>-4 | float<=-3 %}{{ states.sensor.smhi_min_nederbord.state | float * 1.4 }}
{% elif states.sensor.smhi_temperatur.state | float>-5 | float<=-4 %}{{ states.sensor.smhi_min_nederbord.state | float * 1.5 }}
{% elif states.sensor.smhi_temperatur.state | float>-6 | float<=-5 %}{{ states.sensor.smhi_min_nederbord.state | float * 1.7 }}
{% elif states.sensor.smhi_temperatur.state | float>-7 | float<=-6 %}{{ states.sensor.smhi_min_nederbord.state | float * 1.8 }}
{% elif states.sensor.smhi_temperatur.state | float>-8 | float<=-7 %}{{ states.sensor.smhi_min_nederbord.state | float * 2 }}
{% elif states.sensor.smhi_temperatur.state | float>-9 | float<=-8 %}{{ states.sensor.smhi_min_nederbord.state | float * 2.2 }}
{% elif states.sensor.smhi_temperatur.state | float>-10 | float<=-9 %}{{ states.sensor.smhi_min_nederbord.state | float * 2.4 }}
{% elif states.sensor.smhi_temperatur.state | float>-11 | float<=-10 %}{{ states.sensor.smhi_min_nederbord.state | float * 2.7 }}
{% elif states.sensor.smhi_temperatur.state | float>-12 | float<=-11 %}{{ states.sensor.smhi_min_nederbord.state | float * 3 }}
{% elif states.sensor.smhi_temperatur.state | float>-13 | float<=-12 %}{{ states.sensor.smhi_min_nederbord.state | float * 3.4 }}
{% elif states.sensor.smhi_temperatur.state | float>-14 | float<=-13 %}{{ states.sensor.smhi_min_nederbord.state | float * 3.7 }}
{% elif states.sensor.smhi_temperatur.state | float>-15 | float<=-14 %}{{ states.sensor.smhi_min_nederbord.state | float * 4.2 }}
{% elif states.sensor.smhi_temperatur.state | float>-16 | float<=-15 %}{{ states.sensor.smhi_min_nederbord.state | float * 4.6 }}
{% elif states.sensor.smhi_temperatur.state | float>-17 | float<=-16 %}{{ states.sensor.smhi_min_nederbord.state | float * 5.1 }}
{% elif states.sensor.smhi_temperatur.state | float>-18 | float<=-17 %}{{ states.sensor.smhi_min_nederbord.state | float * 5.5 }}
{% elif states.sensor.smhi_temperatur.state | float>-19 | float<=-18 %}{{ states.sensor.smhi_min_nederbord.state | float * 5.9 }}
{% elif states.sensor.smhi_temperatur.state | float>-20 | float<=-19 %}{{ states.sensor.smhi_min_nederbord.state | float * 6.2 }}
{% elif states.sensor.smhi_temperatur.state | float<=-20 %}{{ states.sensor.smhi_min_nederbord.state | float * 6.4 }}
{%- endif %}
smhi_sno_max:
friendly_name: 'SMHI Snö max'
unit_of_measurement: "cm"
icon_template: mdi:weather-snowy
value_template: >-
{%if states.sensor.smhi_temperatur.state | float>-1 | float<=0 %}{{ states.sensor.smhi_max_nederbord.state | float * 1 }}
{% elif states.sensor.smhi_temperatur.state | float>-2 | float<=-1 %}{{ states.sensor.smhi_max_nederbord.state | float * 1.2 }}
{% elif states.sensor.smhi_temperatur.state | float>-3 | float<=-2 %}{{ states.sensor.smhi_max_nederbord.state | float * 1.3 }}
{% elif states.sensor.smhi_temperatur.state | float>-4 | float<=-3 %}{{ states.sensor.smhi_max_nederbord.state | float * 1.4 }}
{% elif states.sensor.smhi_temperatur.state | float>-5 | float<=-4 %}{{ states.sensor.smhi_max_nederbord.state | float * 1.5 }}
{% elif states.sensor.smhi_temperatur.state | float>-6 | float<=-5 %}{{ states.sensor.smhi_max_nederbord.state | float * 1.7 }}
{% elif states.sensor.smhi_temperatur.state | float>-7 | float<=-6 %}{{ states.sensor.smhi_max_nederbord.state | float * 1.8 }}
{% elif states.sensor.smhi_temperatur.state | float>-8 | float<=-7 %}{{ states.sensor.smhi_max_nederbord.state | float * 2 }}
{% elif states.sensor.smhi_temperatur.state | float>-9 | float<=-8 %}{{ states.sensor.smhi_max_nederbord.state | float * 2.2 }}
{% elif states.sensor.smhi_temperatur.state | float>-10 | float<=-9 %}{{ states.sensor.smhi_max_nederbord.state | float * 2.4 }}
{% elif states.sensor.smhi_temperatur.state | float>-11 | float<=-10 %}{{ states.sensor.smhi_max_nederbord.state | float * 2.7 }}
{% elif states.sensor.smhi_temperatur.state | float>-12 | float<=-11 %}{{ states.sensor.smhi_max_nederbord.state | float * 3 }}
{% elif states.sensor.smhi_temperatur.state | float>-13 | float<=-12 %}{{ states.sensor.smhi_max_nederbord.state | float * 3.4 }}
{% elif states.sensor.smhi_temperatur.state | float>-14 | float<=-13 %}{{ states.sensor.smhi_max_nederbord.state | float * 3.7 }}
{% elif states.sensor.smhi_temperatur.state | float>-15 | float<=-14 %}{{ states.sensor.smhi_max_nederbord.state | float * 4.2 }}
{% elif states.sensor.smhi_temperatur.state | float>-16 | float<=-15 %}{{ states.sensor.smhi_max_nederbord.state | float * 4.6 }}
{% elif states.sensor.smhi_temperatur.state | float>-17 | float<=-16 %}{{ states.sensor.smhi_max_nederbord.state | float * 5.1 }}
{% elif states.sensor.smhi_temperatur.state | float>-18 | float<=-17 %}{{ states.sensor.smhi_max_nederbord.state | float * 5.5 }}
{% elif states.sensor.smhi_temperatur.state | float>-19 | float<=-18 %}{{ states.sensor.smhi_max_nederbord.state | float * 5.9 }}
{% elif states.sensor.smhi_temperatur.state | float>-20 | float<=-19 %}{{ states.sensor.smhi_max_nederbord.state | float * 6.2 }}
{% elif states.sensor.smhi_temperatur.state | float<=-20 %}{{ states.sensor.smhi_max_nederbord.state | float * 6.4 }}
{%- endif %}