Esphome example delay: Difference between revisions
Jump to navigation
Jump to search
(Created page with "==delay== This example toggles the LED <i>when the physical button is pressed</i>, then 2 seconds later toggles it back.<br> The virtual button on the Home Assistant card is not effected. <nowiki># Physical Button on D1 (GPIO5) binary_sensor: - platform: gpio pin: number: D1 inverted: False mode: INPUT_PULLUP name: "Wemos Test Button" on_press: then: - switch.toggle: led - delay: 2s - switch.toggle: led</nowik...") |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
= | <div id="Index"></div> | ||
This example toggles the LED <i>when the physical button is pressed</i>, then 2 seconds later toggles it back.<br> | This example toggles the LED <i>when the physical button is pressed</i>, then 2 seconds later toggles it back.<br> | ||
The virtual button on the Home Assistant card is not effected. | The virtual button on the Home Assistant card is not effected. | ||
Line 18: | Line 18: | ||
{{template:top}} | {{template:top}} | ||
=Navigation= | |||
[[ESPHome|Return to the ESPHome page]]<br> |
Latest revision as of 22:05, 27 August 2023
This example toggles the LED when the physical button is pressed, then 2 seconds later toggles it back.
The virtual button on the Home Assistant card is not effected.
# Physical Button on D1 (GPIO5) binary_sensor: - platform: gpio pin: number: D1 inverted: False mode: INPUT_PULLUP name: "Wemos Test Button" on_press: then: - switch.toggle: led - delay: 2s - switch.toggle: led