Turn off garden lights on event close cover

Hello guys,

i am stuck with a very simple automation and i have dig into many exemple configuration or topic and i don’t see what i am doing wrong :frowning:
it’s very simple like the title say, when i close my cover (somfy with no state) and want to turn off the garden lights.
So i went for trigger on event call_service close cover but can’t make it works.

Event :

{
    "event_type": "call_service",
    "data": {
        "domain": "cover",
        "service": "close_cover",
        "service_data": {
            "entity_id": "cover.volet_salon_droite"
        }
    },

Automation :

trigger:
  - platform: event
    event_type: call_service
    event_data:
      domain: cover
      service: close_cover
      entity_id: cover.volet_salon_droite
condition: []
action:
  - service: light.turn_off
    target:
      entity_id:
        - light.jardin_avant
        - light.bureau
mode: single

Try this version (note how entity_id is defined in the trigger):

trigger:
  - platform: event
    event_type: call_service
    event_data:
      domain: cover
      service: close_cover
      service_data:
        entity_id: cover.volet_salon_droite
condition: []
action:
  - service: light.turn_off
    target:
      entity_id:
        - light.jardin_avant
        - light.bureau
mode: single

1 Like

Dear lord it works, it felt like i did all the combinaison but obviously not. Thanks for your time :slight_smile:

1 Like

You’re welcome! Glad to hear it solved the problem.

Please consider marking my post (above) with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals that this topic has an accepted solution. This helps other users find answers to similar questions.

1 Like