Debian Codegraph @

intents/responses/pl/HassGetWeather.yaml

raw
1 language: pl
2 responses:
3 intents:
4 HassGetWeather:
5 # https://developers.home-assistant.io/docs/core/entity/weather/
6 default: >
7 {% set weather_condition = {
8 'clear': 'bez zachmurzenia',
9 'clear-night': 'bez zachmurzenia',
10 'cloudy': 'i pochmurnie',
11 'exceptional': 'i wyjątkowo',
12 'fog': 'z mgłą',
13 'hail': 'z gradem',
14 'lightning': 'z piorunami',
15 'lightning-rainy': 'z deszczem i piorunami',
16 'partlycloudy': 'z częściowym zachmurzeniem',
17 'pouring': 'i leje deszcz',
18 'rainy': 'i pada deszcz',
19 'snowy': 'i pada śnieg',
20 'snowy-rainy': 'z deszczem i śniegiem',
21 'sunny': 'i słonecznie',
22 'windy': 'i wietrznie',
23 'windy-variant': 'i wietrznie z zachmurzeniem'
24 } %}
25 {% set temperature = state.attributes.get('temperature') %}
26 {% set temperature_unit = state.attributes.get('temperature_unit') %}
27 {% set temperature_pl = (temperature | string).replace(".", ",") %}
28 {% set temperature_decmal = (temperature | float - temperature | int) | round(2) %}
29 {% set negative_name = "" %}
30 {% if temperature | float < 0 %}
31 {% set negative_name = "minus " %}
32 {% endif %}
33 {% if temperature_decmal == 0 %}
34 {% if temperature | int | abs == 1 %}
35 {% set degree_name = 'stopień' %}
36 {% elif temperature | int | abs in [2, 3, 4] %}
37 {% set degree_name = 'stopnie' %}
38 {% elif temperature | int | abs in [12, 13, 14] %}
39 {% set degree_name = 'stopni' %}
40 {% elif (temperature | int | string)[-1] | int | abs in [2, 3, 4] %}
41 {% set degree_name = 'stopnie' %}
42 {% else %}
43 {% set degree_name = 'stopni' %}
44 {% endif %}
45 {% else %}
46 {% set degree_name = "stopnia" %}
47 {% endif %}
48 {% if temperature_unit == "°F" %}
49 {% set temperature_unit = degree_name ~ " farenhajta" %}
50 {% else %}
51 {% set temperature_unit = degree_name ~ " celsjusza" %}
52 {% endif %}
53 {{ negative_name }}{{ temperature_pl.replace("-", "") }} {{ temperature_unit }} {{ weather_condition.get((state.state | string).lower(), "") }}
54
55 detailed_weather: >
56 {% set report = [] %}
57
58 {% set temperature = state.attributes.get('temperature') %}
59 {% set temperature_unit = state.attributes.get('temperature_unit') %}
60 {% if temperature is not none %}
61 {% set temperature_pl = (temperature|string).replace(".", ",") %}
62 {% set temperature_decmal = (temperature | float - temperature | int) | round(2) %}
63 {% set negative_name = '' %}
64 {% if temperature | float < 0 %}
65 {% set negative_name = 'minus ' %}
66 {% endif %}
67 {% if temperature_decmal == 0 %}
68 {% if temperature | int | abs == 1 %}
69 {% set degree_name = 'stopień' %}
70 {% elif temperature | int | abs in [2, 3, 4] %}
71 {% set degree_name = 'stopnie' %}
72 {% elif temperature | int | abs in [12, 13, 14] %}
73 {% set degree_name = 'stopni' %}
74 {% elif (temperature | int | string)[-1] | int | abs in [2, 3, 4] %}
75 {% set degree_name = 'stopnie' %}
76 {% else %}
77 {% set degree_name = 'stopni' %}
78 {% endif %}
79 {% else %}
80 {% set degree_name = "stopnia" %}
81 {% endif %}
82 {% if temperature_unit == "°F" %}
83 {% set temperature_unit = degree_name ~ " farenhajta" %}
84 {% else %}
85 {% set temperature_unit = degree_name ~ " celsjusza" %}
86 {% endif %}
87 {% set report = report + ['Obecna temperatura wynosi '~ negative_name ~ temperature_pl.replace("-", "") ~ ' ' ~ temperature_unit ~ ' '] %}
88 {% endif %}
89
90 {% set weather_condition_dict = {
91 'clear': 'bez zachmurzenia',
92 'clear-night': 'bez zachmurzenia',
93 'cloudy': 'i jest pochmurnie',
94 'exceptional': 'i jest wyjątkowo',
95 'fog': 'z mgłą',
96 'hail': 'z gradem',
97 'lightning': 'z piorunami',
98 'lightning-rainy': 'z deszczem i piorunami',
99 'partlycloudy': 'z częściowym zachmurzeniem',
100 'pouring': 'i leje deszcz',
101 'rainy': 'i pada deszcz',
102 'snowy': 'i pada śnieg',
103 'snowy-rainy': 'z deszczem i śniegiem',
104 'sunny': 'i słonecznie',
105 'windy': 'i wietrznie',
106 'windy-variant': 'i wietrznie z zachmurzeniem'
107 } %}
108 {% set weather_condition = weather_condition_dict.get(state.state, '') %}
109 {% if weather_condition %}
110 {% set report = report + [weather_condition] %}
111 {% endif %}
112
113 {% set humidity = state.attributes.get('humidity') %}
114 {% if humidity is not none %}
115 {% set report = report + [', wilgotność to ' ~ humidity ~ ' procent'] %}
116 {% endif %}
117
118 {% set pressure = state.attributes.get('pressure') %}
119 {% if pressure is not none %}
120 {% set pressure_unit = state.attributes.get('pressure_unit', '') %}
121 {% if pressure_unit == 'Pa' %}
122 {% set pressure_unit = 'paskali' %}
123 {% elif pressure_unit == 'hPa' %}
124 {% set pressure_unit = 'hektopaskali' %}
125 {% elif pressure_unit == 'bar' %}
126 {% set pressure_unit = 'barów' %}
127 {% elif pressure_unit == 'mbar' %}
128 {% set pressure_unit = 'milibarów' %}
129 {% endif %}
130 {% set report = report + [' natomiast ciśnienie atmosferyczne jest na poziomie ' ~ ((pressure|string).replace(".", ",")) ~ ' ' ~ pressure_unit] %}
131 {% endif %}
132
133 {% set wind_speed = state.attributes.get('wind_speed') %}
134 {% set wind_gust_speed = state.attributes.get('wind_gust_speed') %}
135 {% if wind_speed is not none %}
136 {% set wind_speed_unit = state.attributes.get('wind_speed_unit', 'km/h') %}
137 {% if wind_speed_unit == 'm/s' %}
138 {% set wind_speed_unit = 'metrów na sekundę' %}
139 {% elif wind_speed_unit == 'km/h' %}
140 {% set wind_speed_unit = 'kilometrów na godzinę' %}
141 {% elif wind_speed_unit == 'mi/h' %}
142 {% set wind_speed_unit = 'mil na godzinę' %}
143 {% elif wind_speed_unit == 'ft/s' %}
144 {% set wind_speed_unit = 'stóp na sekundę' %}
145 {% elif wind_speed_unit == 'kn' %}
146 {% set wind_speed_unit = 'węzłów' %}
147 {% endif %}
148
149 {% set wind_speed_text = '' %}
150 {% if wind_speed < 1 %}
151 {% set wind_speed_text = 'jest bezwietrznie' %}
152 {% elif 1 <= wind_speed < 6 %}
153 {% set wind_speed_text = 'jest lekki wiaterek' %}
154 {% elif 6 <= wind_speed < 12 %}
155 {% set wind_speed_text = 'jest delikatny wietrzyk' %}
156 {% elif 12 <= wind_speed < 20 %}
157 {% set wind_speed_text = 'jest umiarkowany wiatr' %}
158 {% elif 20 <= wind_speed < 29 %}
159 {% set wind_speed_text = 'jest silny wiatr' %}
160 {% elif 29 <= wind_speed < 39 %}
161 {% set wind_speed_text = 'jest wichura' %}
162 {% elif 39 <= wind_speed < 50 %}
163 {% set wind_speed_text = 'jest silna wichura' %}
164 {% else %}
165 {% set wind_speed_text = 'jest niezwykle silny wiatr' %}
166 {% endif %}
167 {% set report = report + [', prędkość wiatru wynosi ' ~ ((wind_speed|string).replace(".", ",")) ~ ' ' ~ wind_speed_unit ~ ', ' ~ wind_speed_text ~ ', '] %}
168
169 {% if wind_gust_speed != None %}
170 {% set report = report + ['jednak w porywach może wynieść nawet ' ~ wind_gust_speed | string | replace('.', ',') ~ ' ' ~ wind_speed_unit] %}
171 {% endif %}
172 {% endif %}
173
174 {% set cloud_coverage = state.attributes.get('cloud_coverage') %}
175 {% if wind_speed is not none %}
176 {% set report = report + ['. Zachmurzenie osiąga ' ~ cloud_coverage ~ ' procent '] %}
177 {% endif %}
178
179 {% set uv_index = state.attributes.get('uv_index') %}
180 {% if uv_index is not none %}
181 {% set uv_category = 'niski' %}
182 {% if uv_index <= 2 %}
183 {% set uv_category = 'niski' %}
184 {% elif 3 <= uv_index <= 4 %}
185 {% set uv_category = 'średni' %}
186 {% elif 5 <= uv_index <= 7 %}
187 {% set uv_category = 'wysoki' %}
188 {% elif 8 <= uv_index <= 10 %}
189 {% set uv_category = 'bardzo wysoki' %}
190 {% elif uv_index >= 11 %}
191 {% set uv_category = 'ekstremalny' %}
192 {% endif %}
193 {% set report = report + ['a aktualny indeks UV jest ' ~ uv_category ~ ' i wynosi ' ~ uv_index ~ '.'] %}
194 {% endif %}
195
196 {{ report | join('') }}
197
198 temperature: >
199 {% set temperature = state.attributes.get('temperature') %}
200 {% set temperature_unit = state.attributes.get('temperature_unit') %}
201 {% if temperature is not none %}
202 {% set temperature_pl = (temperature | string).replace(".", ",") %}
203 {% set temperature_decmal = (temperature | float - temperature | int) | round(2) %}
204 {% set negative_name = "" %}
205 {% if temperature | float < 0 %}
206 {% set negative_name = "minus " %}
207 {% endif %}
208 {% if temperature_decmal == 0 %}
209 {% if temperature | int | abs == 1 %}
210 {% set degree_name = 'stopień' %}
211 {% elif temperature | int | abs in [2, 3, 4] %}
212 {% set degree_name = 'stopnie' %}
213 {% elif temperature | int | abs in [12, 13, 14] %}
214 {% set degree_name = 'stopni' %}
215 {% elif (temperature | int | string)[-1] | int | abs in [2, 3, 4] %}
216 {% set degree_name = 'stopnie' %}
217 {% else %}
218 {% set degree_name = 'stopni' %}
219 {% endif %}
220 {% else %}
221 {% set degree_name = "stopnia" %}
222 {% endif %}
223 {% if temperature_unit == "°F" %}
224 {% set temperature_unit = degree_name ~ " farenhajta" %}
225 {% else %}
226 {% set temperature_unit = degree_name ~ " celsjusza" %}
227 {% endif %}
228 Temperatura wynosi {{ negative_name }}{{ temperature_pl.replace("-", "") }} {{ temperature_unit }}
229 {% else %}
230 Brak danych temperatury
231 {% endif %}
232
233 humidity: >
234 {% set humidity = state.attributes.get('humidity') %}
235 {% set humidity_pl = (humidity|string).replace(".", ",") %}
236 {% if humidity != "" %}
237 Wilgotność powietrza wynosi {{ humidity_pl }} procent
238 {% else %}
239 Brak danych wilgotności powietrza
240 {% endif %}
241
242 dew_point: >
243 {% set dew_point = state.attributes.get('dew_point') %}
244 {% set temperature_unit = state.attributes.get('temperature_unit') %}
245 {% if dew_point is not none %}
246 {% set dew_point_pl = (dew_point | string).replace(".", ",") %}
247 {% set dew_point_decmal = (dew_point | float - dew_point | int) | round(2) %}
248 {% set negative_name = "" %}
249 {% if dew_point < 0 %}
250 {% set negative_name = "minus " %}
251 {% endif %}
252 {% if dew_point_decmal == 0 %}
253 {% if dew_point | int | abs == 1 %}
254 {% set degree_name = 'stopień' %}
255 {% elif dew_point | int | abs in [2, 3, 4] %}
256 {% set degree_name = 'stopnie' %}
257 {% elif dew_point | int | abs in [12, 13, 14] %}
258 {% set degree_name = 'stopni' %}
259 {% elif (dew_point | int | string)[-1] | int | abs in [2, 3, 4] %}
260 {% set degree_name = 'stopnie' %}
261 {% else %}
262 {% set degree_name = 'stopni' %}
263 {% endif %}
264 {% else %}
265 {% set degree_name = "stopnia" %}
266 {% endif %}
267 {% if temperature_unit == "°F" %}
268 {% set temperature_unit = degree_name ~ " farenhajta" %}
269 {% else %}
270 {% set temperature_unit = degree_name ~ " celsjusza" %}
271 {% endif %}
272 Punkt rosy wynosi {{ negative_name }}{{ dew_point_pl.replace("-", "") }} {{ temperature_unit }}
273 {% else %}
274 Brak danych punktu rosy
275 {% endif %}
276
277 pressure: >
278 {% set pressure = state.attributes.get('pressure') %}
279 {% set pressure_pl = (pressure|string).replace(".", ",") %}
280 {% set pressure_unit = state.attributes.get('pressure_unit') %}
281 {% if pressure != "" %}
282 {% set pressure_unit_name = '' %}
283 {% if pressure_unit == 'Pa' %}
284 {% set pressure_unit_name = 'paskali' %}
285 {% elif pressure_unit == 'hPa' %}
286 {% set pressure_unit_name = 'hektopaskali' %}
287 {% elif pressure_unit == 'bar' %}
288 {% set pressure_unit_name = 'barów' %}
289 {% elif pressure_unit == 'mbar' %}
290 {% set pressure_unit_name = 'milibarów' %}
291 {% endif %}
292 Ciśnienie atmosferyczne wynosi {{ pressure_pl }} {{ pressure_unit_name }}
293 {% else %}
294 Brak danych ciśnienia atmosferycznego
295 {% endif %}
296
297 wind_speed: >
298 {% set wind_bearing = state.attributes.get('wind_bearing') %}
299 {% set wind_gust_speed = state.attributes.get('wind_gust_speed') %}
300 {% set wind_speed = state.attributes.get('wind_speed') %}
301 {% set wind_speed_unit = state.attributes.get('wind_speed_unit') %}
302 {% set wind_bearing_text = '' %}
303
304 {% if wind_bearing is not none %}
305 {% if 0 <= wind_bearing < 45 %}
306 {% set wind_bearing_text = 'północnego kierunku' %}
307 {% elif 45 <= wind_bearing < 90 %}
308 {% set wind_bearing_text = 'północno wschodniego kierunku' %}
309 {% elif 90 <= wind_bearing < 135 %}
310 {% set wind_bearing_text = 'wschodniego kierunku' %}
311 {% elif 135 <= wind_bearing < 180 %}
312 {% set wind_bearing_text = 'południowo wschodniego kierunku' %}
313 {% elif 180 <= wind_bearing < 225 %}
314 {% set wind_bearing_text = 'południowego kierunku' %}
315 {% elif 225 <= wind_bearing < 270 %}
316 {% set wind_bearing_text = 'południowo zachodniego' %}
317 {% elif 270 <= wind_bearing < 315 %}
318 {% set wind_bearing_text = 'zachodniego kierunku' %}
319 {% elif 315 <= wind_bearing <= 360 %}
320 {% set wind_bearing_text = 'północno zachodniego kierunku' %}
321 {% else %}
322 {% set wind_bearing_text = 'nieznanego kierunku' %}
323 {% endif %}
324 {% endif %}
325
326 {% set wind_report = [] %}
327 {% set wind_speed_unit_name = 'kilometrów na godzinę' %}
328 {% if wind_speed_unit == 'm/s' %}
329 {% set wind_speed_unit_name = 'metrów na sekundę' %}
330 {% elif wind_speed_unit == 'km/h' %}
331 {% set wind_speed_unit_name = 'kilometrów na godzinę' %}
332 {% elif wind_speed_unit == 'mi/h' %}
333 {% set wind_speed_unit_name = 'mil na godzinę' %}
334 {% elif wind_speed_unit == 'ft/s' %}
335 {% set wind_speed_unit_name = 'stóp na sekundę' %}
336 {% elif wind_speed_unit == 'kn' %}
337 {% set wind_speed_unit_name = 'węzłów' %}
338 {% endif %}
339
340 {% if wind_speed != None %}
341 {% set wind_report = wind_report + ['Prędkość wiatru wynosi ' ~ wind_speed | string | replace('.', ',') ~ ' ' ~ wind_speed_unit_name] %}
342 {% endif %}
343
344 {% if wind_bearing_text %}
345 {% set wind_report = wind_report + [', z ' ~ wind_bearing_text] %}
346 {% endif %}
347
348 {% if wind_gust_speed != None %}
349 {% set wind_report = wind_report + [', w porywach może wynosić nawet ' ~ wind_gust_speed | string | replace('.', ',') ~ ' ' ~ wind_speed_unit_name] %}
350 {% endif %}
351
352 {{ wind_report | join('') }}
353
354 ozone: >
355 {% set ozone = state.attributes.get('ozone') %}
356 {% set ozone_pl = (ozone|string).replace(".", ",") %}
357 {% if ozone != "" %}
358 Poziom ozonu wynosi {{ ozone_pl }}
359 {% else %}
360 Brak danych poziomu ozonu
361 {% endif %}
362
363 cloud_coverage: >
364 {% set cloud_coverage = state.attributes.get('cloud_coverage') %}
365 {% if cloud_coverage != "" %}
366 Zachmurzenie wynosi {{ cloud_coverage }} procent
367 {% else %}
368 Brak danych zachmurzenia
369 {% endif %}
370
371 visibility: >
372 {% set visibility = state.attributes.get('visibility') %}
373 {% set visibility_pl = (visibility|string).replace(".", ",") %}
374 {% set visibility_unit = state.attributes.get('visibility_unit') %}
375 {% if visibility != "" %}
376 {% set visibility_unit_name = 'kilometrów' %}
377 {% if visibility_unit == 'km' %}
378 {% set visibility_unit_name = 'kilometrów' %}
379 {% elif visibility_unit == 'mi' %}
380 {% set visibility_unit_name = 'mil' %}
381 {% endif %}
382 Widoczność wynosi {{ visibility_pl }} {{ visibility_unit_name }}
383 {% else %}
384 Brak danych widoczności
385 {% endif %}
386
387 uv_index: >
388 {% set uv_index = state.attributes.get('uv_index') %}
389 {% if uv_index != None %}
390 {% set uv_index = uv_index | round %}
391 {% set uv_category = '' %}
392 {% set uv_comment = '' %}
393 {% if uv_index <= 2 %}
394 {% set uv_category = 'niski' %}
395 {% set uv_comment = '' %}
396 {% elif 3 <= uv_index <= 4 %}
397 {% set uv_category = 'średni' %}
398 {% set uv_comment = 'Zaleca się używanie kremu z filtrem UV, okularów przeciwsłonecznych oraz nakrycia głowy.' %}
399 {% elif 5 <= uv_index <= 7 %}
400 {% set uv_category = 'wysoki' %}
401 {% set uv_comment = 'Wskazane jest unikanie przebywania na słońcu w godzinach o najwyższym nasłonecznieniu (zwykle około południa) oraz korzystanie z odpowiedniej ochrony przed słońcem.' %}
402 {% elif 8 <= uv_index <= 10 %}
403 {% set uv_category = 'bardzo wysoki' %}
404 {% set uv_comment = 'Należy unikać słońca w godzinach największego nasłonecznienia i korzystać z efektywnej ochrony przed promieniowaniem UV.' %}
405 {% elif uv_index >= 11 %}
406 {% set uv_category = 'ekstremalny' %}
407 {% set uv_comment = 'Zdecydowanie zaleca się jak największe ograniczenie kontaktu ze słońcem oraz zastosowanie efektywnej ochrony przed promieniowaniem UV.' %}
408 {% endif %}
409 Aktualny indeks UV jest {{ uv_category }} i wynosi {{ uv_index }}. {{ uv_comment }}
410 {% else %}
411 Brak danych indeksu UV
412 {% endif %}