08-01-2024, 11:23 PM
ok, if you use ESPHome for home assistant, just config for "binary_sensor",
Automations:
on_press (Optional, Automation): An automation to perform when the button is pressed. See on_press.
on_release (Optional, Automation): An automation to perform when the button is released. See on_release.
on_state (Optional, Automation): An automation to perform when a state change is published. See on_state.
on_click (Optional, Automation): An automation to perform when the button is held down for a specified period of time. See on_click.
on_double_click (Optional, Automation): An automation to perform when the button is pressed twice for specified periods of time. See on_double_click.
on_multi_click (Optional, Automation): An automation to perform when the button is pressed in a specific sequence. See on_multi_click.
here is details:
https://esphome.io/components/binary_sensor/index.html
Automations:
on_press (Optional, Automation): An automation to perform when the button is pressed. See on_press.
on_release (Optional, Automation): An automation to perform when the button is released. See on_release.
on_state (Optional, Automation): An automation to perform when a state change is published. See on_state.
on_click (Optional, Automation): An automation to perform when the button is held down for a specified period of time. See on_click.
on_double_click (Optional, Automation): An automation to perform when the button is pressed twice for specified periods of time. See on_double_click.
on_multi_click (Optional, Automation): An automation to perform when the button is pressed in a specific sequence. See on_multi_click.
here is details:
https://esphome.io/components/binary_sensor/index.html