Automation: Close blinds when forecast rain

G’day,

I’d like to create an automation rule when e.g. 3 hours weather forcast is rain, then close blinds. I did install openweathermap and did found out, that there are many weather conditions possible: Weather Conditions - OpenWeatherMap from thunderstorm , drizzle, rain, snow and so on.

How do I create an automation to be sure, that my blinds wil not get wet?
Is that possible?

Many thanks
chris

- trigger:
    - platform: template
      value_template: "{{ states('sensor.your_sensor_here') in ['one condition here', 'and another here', 'and also here', 'as many as you want'] }}"

to minimze it, that I do not have to set to many parameters, can I use the weather code group type? e.g. 2XX which then covers all states from 200–232? Is that working?

code looks like this:

trigger:

  • platform: state
    entity_id:
    • sensor.openweathermap_weather_code
      attribute: 2XX,3XX,5XX,6XX,7XX
      condition:

Please learn to format your pasted code. https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

Yes you could do something like this:

trigger:
  - platform: numeric_state
    entity_id: sensor.openweathermap_weather_code
    above: 199
    below: 400
  - platform: numeric_state
    entity_id: sensor.openweathermap_weather_code
    above: 499
    below: 800