diff --git a/source/_integrations/event.markdown b/source/_integrations/event.markdown index b0bcb54b9c9..f300023f924 100644 --- a/source/_integrations/event.markdown +++ b/source/_integrations/event.markdown @@ -89,6 +89,50 @@ action: When creating automations in the automation editor in the UI, the event types are available as a dropdown list, depending on the event entity you are using. This means you don't have to remember the different event types and can easily select them. +## Automating on a button press + +This section shows a similar example to the example automation shown above in YAML. It's an automation that is triggered by an event state change, but shows how to implement it in the UI. To start an automation triggered by a button press (or a button press pattern), follow these steps. + +### Prerequisites + +- You have a device that takes button presses as inputs, such as a Tuo Smart Button, VTM31SN dimmer by Inovelli, or the Matter Pushbutton Module by Innovation Matters +- The device has been added to Home Assistant + +### To automate on a button press + +1. If you like, give your button event entity a friendly name. + - Under {% my integrations title="**Settings** > **Devices & services**" %}, select the **Matter** integration card and select the device. + - On the **Events** card, select the button entity. + ![Select the button entity](/images/integrations/event/matter_button_event_entity.png) + - Under **Name**, enter the new friendly name. + ![Change the entity name](/images/integrations/event/matter_button_rename.png) +2. Go to {% my automations title="**Settings** > **Automations & scenes**" %} and select **Create Automation**. + + ![The automation editor.](/images/getting-started/automation-editor.png) + + - Then, select **Create new automation**. This brings up an empty automation page. + + ![The start of a new automation.](/images/getting-started/new-automation.png) +3. Define what should {% term trigger %} the automation to run. + - Select **Add trigger**, then, select **Entity** > **State**. + - Type `event` and select your button entity. + - **Important**: Leave the other fields **empty**. + ![Select button event as trigger](/images/integrations/event/matter_trigger_on_button_event.png) +4. Define the condition when something should happen. + - Under **Then do**, select **Add action**. + - Type `choose` and select **Add condition**. + - Select **Entity** > **State** and select your button event entity from the list. + - Under **Attribute**, select **Event type**. + - Under **State**, select the state change you want to act as trigger, for example **Pressed once**. + - **Pressed once** is the event type. But the state of this event is the timestamp of when the button was pressed. This is why we automate on the state change so that it is triggered every time the button is pressed. + ![Condition - button pressed](/images/integrations/event/matter_condition_button_pressed.png) +5. Define what should happen when your automation is triggered (when the button is pressed, for example). + - Select **Add action** and define your action. +6. Repeat these steps for each event type you want to monitor. + - In this example, we want to do something else when the button was pressed twice. + ![Condition - add another option when the button is pressed twice](/images/integrations/event/matter_button_option_2.png) +7. **Save** the automation. + ## Device class {% include integrations/device_class_intro.md %} diff --git a/source/_integrations/matter.markdown b/source/_integrations/matter.markdown index 1255b1fce9b..a5307674301 100644 --- a/source/_integrations/matter.markdown +++ b/source/_integrations/matter.markdown @@ -333,6 +333,10 @@ The CSA operates a Distributed Compliance Ledger (DCL) which provides metadata f Notification of an OTA update for a Matter device

+## Automate on a button press + +You have a device that takes button presses as inputs (such as a Tuo Smart Button, VTM31SN dimmer by Inovelli, or the Matter Pushbutton Module by Innovation) and now want to trigger an automation based on that button press. To learn how to create an automation triggered by a button press, refer to this [tutorial](/integrations/event/#automating-on-a-button-press). + ## Experiment with Matter using a ESP32 dev board You do not yet have any Matter-compatible hardware but you do like to try it out or maybe create your own DIY Matter device? We have [prepared a page for you](https://nabucasa.github.io/matter-example-apps/) where you can easily flash Matter firmware to a supported ESP32 development board. We recommend the M5 Stamp C3 device running the Lighting app. diff --git a/source/images/integrations/event/matter_button_event_entity.png b/source/images/integrations/event/matter_button_event_entity.png new file mode 100644 index 00000000000..63514c7175e Binary files /dev/null and b/source/images/integrations/event/matter_button_event_entity.png differ diff --git a/source/images/integrations/event/matter_button_option_2.png b/source/images/integrations/event/matter_button_option_2.png new file mode 100644 index 00000000000..b2e4a262853 Binary files /dev/null and b/source/images/integrations/event/matter_button_option_2.png differ diff --git a/source/images/integrations/event/matter_button_rename.png b/source/images/integrations/event/matter_button_rename.png new file mode 100644 index 00000000000..6a640aa3428 Binary files /dev/null and b/source/images/integrations/event/matter_button_rename.png differ diff --git a/source/images/integrations/event/matter_condition_button_pressed.png b/source/images/integrations/event/matter_condition_button_pressed.png new file mode 100644 index 00000000000..dc823873099 Binary files /dev/null and b/source/images/integrations/event/matter_condition_button_pressed.png differ diff --git a/source/images/integrations/event/matter_trigger_on_button_event.png b/source/images/integrations/event/matter_trigger_on_button_event.png new file mode 100644 index 00000000000..4328a903149 Binary files /dev/null and b/source/images/integrations/event/matter_trigger_on_button_event.png differ