Advertisement
penright

Untitled

Apr 20th, 2022
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.01 KB | None | 0 0
  1. input_boolean:
  2.   shop_lock:
  3.     name: 'Shop is Lock'
  4.  
  5. automation:
  6.   - alias: Shop Unlock From Click
  7.     id: Shop Unlock From Click
  8.     trigger:
  9.     - platform: mqtt
  10.       topic: "zigbee2mqtt/0x00124b00xxxx"
  11.     condition:
  12.       - condition: template
  13.         value_template: "{{ trigger.payload_json['action'] == 'single' }}"
  14.     action:
  15.     - wait_for_trigger:
  16.       - platform: mqtt
  17.         topic: "zigbee2mqtt/0x00124b0xxxx"
  18.     - choose:
  19.       - condition: template
  20.         value_template: "{{ trigger.payload_json['action'] == 'double' }}"
  21.       timeout:
  22.         seconds: 5
  23.       continue_on_timeout: false
  24.     - service: input_boolean.turn_off
  25.       entity_id: input_boolean.shop_lock
  26.  
  27.   - alias: Shop lock From Click
  28.     id: Shop Lock From Click
  29.     trigger:
  30.     - platform: mqtt
  31.       topic: "zigbee2mqtt/0x00124bxxxxx"
  32.     condition:
  33.       - condition: template
  34.         value_template: "{{ trigger.payload_json['action'] == 'long' }}"
  35.     action:
  36.     - service: input_boolean.turn_on
  37.       entity_id: input_boolean.shop_lock
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement