Trigger open close from Apple Watch

Hi all

I have put together a garage opener based on this receipt [GarHAge - a Home-Automation-friendly ESP8266-based MQTT Garage Door Controller]

Everything works perfectly…What I want to do is to execute one action from the apple watch to either open or close the port. I have got it to open with one action and close with another.

So this is what I’m trying to do

Automation

- alias: "Apple Watch open or close garage left"
  trigger:
    - platform: event
      event_type: ios.action_fired
      event_data:
        actionName: left_garage
  action:
    - service: script.turn_on
      entity_id: script.garage_door

and the script:

garage_door:
  sequence:
    - service_template: >
        {% if (states.cover.venstre_port.state) == "open" -%}
          cover.close_cover
        {% if (states.cover.venstre_port.state) == "closed" -%}
          cover.open_cover
        {% endif %}

So if the port is open it gets closed, and is it open well then the next time I push the action it closes.

Any idea?

Thanks! :slight_smile:

- alias: "Apple Watch open or close garage left"
  trigger:
    - platform: event
      event_type: ios.action_fired
      event_data:
        actionName: left_garage
  action:
    - service: cover.toggle
      entity_id: cover.venstre_port
1 Like

Haha that simple :slight_smile: works like a charm!

Thanks allot tom_l

1 Like

No problem. If you mark the post solved it may help others when searching.