using this input_boolean
input_boolean:
shop_lock:
name: 'Shop is Lock'
There are a lot of examples of using MQTT as a trigger. I have a button that action is “single”, “double”, and “long”.
This one will turn on the boolean.
automation:
- alias: Shop Lock From Click
id: Shop Lock From Click
trigger:
- platform: mqtt
topic: "zigbee2mqtt/0x00xxxxx"
condition:
- condition: template
value_template: "{{ trigger.payload_json['action'] == 'single' }}"
action:
- service: input_boolean.turn_on
entity_id: input_boolean.shop_lock
What I would like is some sort of combination of single and double
For example, a ‘single’ a ‘double’ then a ‘single’
How do you get it to read mqtt in a wait_template?
I am guessing I need a different way, since I guessing the json is loaded off of the first trigger.
automation:
- alias: Shop Lock From Click
id: Shop Lock From Click
trigger:
- platform: mqtt
topic: "zigbee2mqtt/0x00124xxxxxx"
condition:
- condition: template
value_template: "{{ trigger.payload_json['action'] == 'single' }}"
action:
- wait_template: "{{ trigger.payload_json['action'] == 'double' }}"
timeout:
seconds: 5
continue_on_timeout: false
- wait_template: "{{ trigger.payload_json['action'] == 'single' }}"
timeout:
seconds: 5
continue_on_timeout: false
- service: input_boolean.turn_on
entity_id: input_boolean.shop_lock
1 post - 1 participant