Weather state change to turn on light

Looking for an automation that is something like:
If weather status:rain
Turn on light
Else

trigger:
  - platform: state
    entity_id: weather.your_weather_entity_here
    to: "rain" # check developer tools -> states for the actual state,  "Rain" and "rain" are not the same. 
action:
  - service: light.turn_on
    target:
      entity_id: light.your_light_entity_here
1 Like

@tom_l With customization to service and entity_id, I should be able to add this in as an automation, correct?

Also, anytime I add to: β€œrain” and save it, it changes the yaml code to to: rain without the β€œβ€

Bumping this for any help. Thanks