State of weather as condition or trigger

I would like to set up an automation where one of the triggers is the current state of the weather but I’m a complete noob. This is probably the most basic knowledge of coding which I don’t have I guess…
Here’s the config:

condition:
  - condition: state
    entity_id: weather.home
    state: fog; hail; lightning; lightning-rainy; pouring; rainy; snowy; snowy-rainy

Is this how you say the state has to be either fog or hail or … … Or does the way I currently have it written say that the state has to be all of those attributes at the same time in order for the automation to start?
Thanks for any replies!

This this:

condition:
  - condition: state
    entity_id: weather.home
    state: 
      - fog
      - hail
      - lightning
      - lightning-rainy
      - pouring
      - rainy
      - snowy
      - snowy-rainy

Neither. The way you had it is invalid. Single line lists are separated with comas not semi-colons. The way Andy has it above (multi-line list) is OR. If the state matches an any of the listed values the condition will pass.

Thanks a lot to the two of you for your quick help! Keep up your great support. :slight_smile:

1 Like