This automation might be quite useful for me. I have attached Shelly 2.5 to my roller shutters. They are controlled by the Shelly via Home Assistant, or old school via two buttons (Up, Down).
The buttons return to their original possition, when released (off). Currently the buttons are connected to the relais of the Shelly, but they can be configured as detached buttons. Then they would not trigger anyhting in the Shelly directly, but the state of the button can be read by home assistant and home assistant can trigger actions.
I would like to use this to for example control the roller shutter (cover) in a normal manner on a single click (e.g. call close cover when down is pressed once, call stop cover, when pressed again). But if a double click is detected, close cover for all covers in the room could be triggered. I think this blueprint will help me to get there.
I tried to import the blueprint into my configuration, but received an error.
Is there a way to manually copy the automation? If not using the blueprint itself, where would the input definitions be defined?
I have now tried the following:
- alias: Test - Office Cover Down Pressed
id: 'test_office_cover_down_pressed'
trigger:
- platform: state
entity_id: binary_sensor.office_shutter_button_down
to: 'on'
action:
- variables:
button_id: binary_sensor.office_shutter_button_down
- wait_template: "{{ is_state(button_id, 'off') }}"
timeout: 0.3
continue_on_timeout: true
- choose:
- conditions: "{{ not wait.completed }}" # long click
service: notify.mobile_app_oneplus_6t
data:
title: 'Down Button Pressed'
message: 'Long Click Detected'
default:
- wait_template: "{{ is_state(button_id, 'on') }}" # second click?
timeout: 0.3
continue_on_timeout: true
- choose:
- conditions: "{{ not wait.completed }}" #single click
service: notify.mobile_app_oneplus_6t
data:
title: 'Down Button Pressed'
message: 'Short Click Detected'
default:
service: notify.mobile_app_oneplus_6t
data:
title: 'Down Button Pressed'
message: 'Double Click Detected'
But the service call at that position seems to be wrong.