Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - trigger:
- - platform: time_pattern
- hours: "17"
- minutes: "5"
- action:
- - service: weather.get_forecasts
- target:
- entity_id: weather.forecast_otthon
- data:
- type: hourly
- response_variable: hourly
- sensor:
- - name: "forecasted_min_temp_next_16h"
- unique_id: 9de810c8-9b93-4413-9451-988b4c9c8f72
- icon: mdi:thermometer-chevron-down
- unit_of_measurement: °C
- state: >
- {% set fc = hourly['weather.forecast_otthon'] %}
- {% set ns = namespace() %}
- {% set ns.min_temp = 40 %}
- {% for hour in range(0, 15) %}
- {% set temp = fc.forecast[hour].temperature %}
- {% if temp < ns.min_temp %}
- {% set ns.min_temp = temp %}
- {% endif %}
- {% endfor %}
- {{ ns.min_temp |float(0) | round(2) }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement