mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-09 18:36:51 +00:00
Event entity: Add automation triggered by button press (#34937)
* Add button automation * Move example from Matter page to event entity * Move images to event integration * Rephrase * Add extra info on state * Add pushbutton module as example * Make it more obvious that fields need to be left empty * Fix typo * Matter page: link to tutorial * Add step to add second option
This commit is contained in:
parent
334b29799e
commit
ae69855cef
@ -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.
|
||||

|
||||
- Under **Name**, enter the new friendly name.
|
||||

|
||||
2. Go to {% my automations title="**Settings** > **Automations & scenes**" %} and select **Create Automation**.
|
||||
|
||||

|
||||
|
||||
- Then, select **Create new automation**. This brings up an empty automation page.
|
||||
|
||||

|
||||
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**.
|
||||

|
||||
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.
|
||||

|
||||
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.
|
||||

|
||||
7. **Save** the automation.
|
||||
|
||||
## Device class
|
||||
|
||||
{% include integrations/device_class_intro.md %}
|
||||
|
@ -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
|
||||
</p>
|
||||
|
||||
## 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.
|
||||
|
BIN
source/images/integrations/event/matter_button_event_entity.png
Normal file
BIN
source/images/integrations/event/matter_button_event_entity.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 70 KiB |
BIN
source/images/integrations/event/matter_button_option_2.png
Normal file
BIN
source/images/integrations/event/matter_button_option_2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 46 KiB |
BIN
source/images/integrations/event/matter_button_rename.png
Normal file
BIN
source/images/integrations/event/matter_button_rename.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 130 KiB |
Binary file not shown.
After Width: | Height: | Size: 38 KiB |
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
Loading…
x
Reference in New Issue
Block a user