Skip to content

Instantly share code, notes, and snippets.

@jandolejs
Created May 26, 2023 17:09
Show Gist options
  • Save jandolejs/062f41aff34d0d4d7cfed19f509f4d82 to your computer and use it in GitHub Desktop.
Save jandolejs/062f41aff34d0d4d7cfed19f509f4d82 to your computer and use it in GitHub Desktop.
blueprint:
name: Switch Aqara D1
domain: automation
input:
switch:
name: Button switch Device
selector:
entity:
domain: sensor
multiple: true
single:
name: Single
default: []
selector:
action: {}
double:
name: Double
default: []
selector:
action: {}
hold:
name: Hold
default: []
selector:
action: {}
mode: queued
max_exceeded: silent
trigger:
- platform: state
entity_id: !input 'switch'
action:
- variables:
command: '{{ trigger.to_state.state }}'
- choose:
- conditions:
- '{{ command == ''single'' }}'
sequence: !input single
- conditions:
- '{{ command == ''double'' }}'
sequence: !input double
- conditions:
- '{{ command == ''hold'' }}'
sequence: !input hold
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment