Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rrooding/57f8f3f02b3a870c5cbcd63c6cca9bde to your computer and use it in GitHub Desktop.
Save rrooding/57f8f3f02b3a870c5cbcd63c6cca9bde to your computer and use it in GitHub Desktop.
Handle iOS Actions Blueprint
blueprint:
name: Handle iOS Actions
description: Catch event ios.action_fired that is fired when you press an companion application action, and choose an action based on the actionName.
domain: automation
input:
choose_1:
name: First button identifier
default: []
action_1:
name: Action for first button
default: []
selector:
action: {}
choose_2:
name: Second button identifier
default: []
action_2:
name: Action for second button
default: []
selector:
action: {}
choose_3:
name: Third button identifier
default: []
action_3:
name: Action for third button
default: []
selector:
action: {}
choose_4:
name: Fourth button identifier
default: []
action_4:
name: Action for fourth button
default: []
selector:
action: {}
trigger:
- platform: event
event_type: ios.action_fired
variables:
choose_1: !input 'choose_1'
choose_2: !input 'choose_2'
choose_3: !input 'choose_3'
choose_4: !input 'choose_4'
action:
- choose:
- conditions:
- condition: template
value_template: '{{trigger.event.data["actionName"] == choose_1}}'
sequence: !input 'action_1'
- conditions:
- condition: template
value_template: '{{trigger.event.data["actionName"] == choose_2}}'
sequence: !input 'action_2'
- conditions:
- condition: template
value_template: '{{trigger.event.data["actionName"] == choose_3}}'
sequence: !input 'action_3'
- conditions:
- condition: template
value_template: '{{trigger.event.data["actionName"] == choose_4}}'
sequence: !input 'action_4'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment