Ok, I think I got the idea of blueprints.
I have several automations that are almost identical that link a Aqara Zigbee button to a group of lights. When I do a single click on it, the light toggles state, like this:
- id: '1607725222698'
alias: Quarto do Murilo -- mudar o estado do lustre
description: ''
trigger:
- platform: mqtt
topic: zigbee2mqtt/BTQuartoMurilo/action
payload: single
action:
- service: light.toggle
entity_id: light.lustre_do_quarto_do_murilo
mode: single
I believe that the input
elements will be the MQTT topic and the light entity, right?
How can I do a bluprint for this? I think in something like this:
blueprint:
name: Muda estado de luzes com botao Aqara
domain: automation
input:
botao:
lustre:
trigger:
platform: mqtt
topic: zigbee2mqtt/{{!input botao}}/action
payload: single
action:
service: light.toggle
entity_id: !input lustre
What is the right way of using a MQTT topic as a trigger for a blueprint?
Thanks!