Hi, I have not yet understood how the OpenWeatherMap forecast works.
The following example: When we leave the house for a few hours and I press e.g. a button on the front door, I want an automation or script to query if all windows are closed and if not, if it will rain or windy or hot in the next hours.
How can I determine the maximum temperature, wind speed, etc. in the next few hours to display a warning that a window is still open?
I’m not sure if this will work well, but this is my current solution.
alias: Fenster schließen
description: >-
Überprüft beim Verlassen des Hauses, wie das Wetter wird und ob man nicht
besser die Fenster schließen sollte.
trigger:
- device_id: 2ec3bda159fcdf60636518102354d2e1
domain: zha
platform: device
type: remote_button_short_press
subtype: turn_on
condition:
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.alle_fenster
state: "on"
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.openweathermap_forecast_temperature
above: 25
- condition: numeric_state
entity_id: sensor.openweathermap_forecast_wind_speed
above: 10
- condition: numeric_state
entity_id: sensor.openweathermap_forecast_precipitation_probability
above: 50
action:
- service: notify.mobile_app_pixel_7_mobil
data:
message: Es wäre besser, die Ferster zu schließen
mode: single
I use a helper group that includes all window sensors. If one or more of the windows are open AND one of the three condition matches I send a message to my phone.
Edit:
One factor to consider is how far into the future those sensors predict. My equivalent of your automation is to simply let me know if I have left any windows/doors open (and then I look at the sky).
Of course this is more of a toy automation that only works for some situations (one day), but it is not bullet proof. Looking to the sky is always recommend