Automation: Close blinds when forecast rain


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

- 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:


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

Please learn to format your pasted code.

Yes you could do something like this:

  - 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