Forked from agdamsbo/ESPhome switch SDTH blueprint
Last active
December 22, 2022 18:39
-
-
Save DirkTas67/124c3dcf20e4b3d2a5062505b3dbcd1d to your computer and use it in GitHub Desktop.
Blueprint with different multi click actions based on text_sensor in ESPhome switch. Controls single, double and triple click as well as hold.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: ESPhome switch SDTH | |
description: | | |
Different actions for different clicks. | |
Based on text_sensor in ESPhome switch. | |
ESPhome configuration example: https://gist.github.com/agdamsbo/819c27a5b986c38327d4b19057cbfb6d | |
## Inspiration ## | |
ESPhome decoupled approach: https://www.esphome-devices.com/devices/Shelly-1/ | |
ESPhome text_sensor approach: https://gist.github.com/albertnis/f33066b0b3623a9839a3429c8f19f4d4 | |
Blueprint: https://community.home-assistant.io/t/trigger-different-actions-on-a-single-double-or-double-click-on-a-binary-sensor/255902/15 | |
domain: automation | |
input: | |
text_sensor_id: | |
name: Binary sensor entity | |
description: The text sensor used to trigger the automation | |
selector: | |
entity: | |
domain: sensor | |
single_action: | |
name: Single click action | |
description: The action(s) to launch for a single short click | |
default: [] | |
selector: | |
action: {} | |
double_action: | |
name: Double click action | |
description: The action(s) to launch for a double click | |
default: [] | |
selector: | |
action: {} | |
triple_action: | |
name: Triple click action | |
description: The action(s) to launch for a triple click | |
default: [] | |
selector: | |
action: {} | |
hold_action: | |
name: Hold action | |
description: The action(s) to launch for a long hold | |
default: [] | |
selector: | |
action: {} | |
source_url: https://gist.github.com/DirkTas67/124c3dcf20e4b3d2a5062505b3dbcd1d | |
trigger: | |
- platform: state | |
entity_id: !input 'text_sensor_id' | |
to: 'single' | |
- platform: state | |
entity_id: !input 'text_sensor_id' | |
to: 'double' | |
- platform: state | |
entity_id: !input 'text_sensor_id' | |
to: 'triple' | |
- platform: state | |
entity_id: !input 'text_sensor_id' | |
to: 'hold' | |
action: | |
- choose: | |
- conditions: | |
- condition: state | |
entity_id: !input 'text_sensor_id' | |
state: 'single' | |
sequence: !input 'single_action' | |
- conditions: | |
- condition: state | |
entity_id: !input 'text_sensor_id' | |
state: 'double' | |
sequence: !input 'double_action' | |
- conditions: | |
- condition: state | |
entity_id: !input 'text_sensor_id' | |
state: 'triple' | |
sequence: !input 'triple_action' | |
- conditions: | |
- condition: state | |
entity_id: !input 'text_sensor_id' | |
state: 'hold' | |
sequence: !input 'hold_action' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment