diff --git a/blueprints/automation/homeassistant/button_action.yaml b/blueprints/automation/homeassistant/button_action.yaml new file mode 100644 index 0000000..6b6e312 --- /dev/null +++ b/blueprints/automation/homeassistant/button_action.yaml @@ -0,0 +1,61 @@ +blueprint: + name: Action on a button + description: TEST button action + domain: automation + author: Tiziano Trabattoni + input: + # button_target: + # name: Button + # selector: + # target: + # entity: + # domain: input_button + light_target: + name: Light + selector: + target: + entity: + domain: light + +triggers: + - trigger: mqtt + topic: zigbee2mqtt/Pulsante-01 + payload: single + value_template: "{{ value_json['action'] }}" + id: Pulsante1-single + - trigger: mqtt + topic: zigbee2mqtt/Pulsante-01 + payload: double + value_template: "{{ value_json['action'] }}" + id: Pulsante1-double + +conditions: [] + +actions: + - choose: + - conditions: + - condition: trigger + id: + - Pulsante1-single + sequence: + - action: light.turn_on + metadata: {} + data: + rgb_color: + - 255 + - 0 + - 0 + brightness_pct: 100 + transition: 10 + target: !input light_target + + - conditions: + - condition: trigger + id: + - Pulsante1-double + sequence: + - action: light.turn_off + metadata: {} + data: + transition: 10 + target: !input light_target