Afternoon all!
I have a Fibaro button that I would like to press once and this then change an input select I have created ( ‘Alarm_On’ with 1x press and ‘Alarm_Off’ with 2x presses).
I been trying to figure out how to accomplish this and failing hard!
Here is a screen shot of what I am trying to do and hopefully someone can let me know where I am going wrong. Just so this fits in to a single screen shot, I have taken out the choose options and just set it up direct to what I thought would have worked with 1x press, Select Alarm_On option within the input select.
First, please follow Question Guideline #11 and share your automation configuration as properly formatted text and not an image.
How Do I do that?
You can access it by clicking the 3-dot expansion menu button at the top right in the automation editor and choose “Edit in YAML”. Then, select and copy everything from the YAML editor. Paste the copied text into your post.
Be sure to format it properly by adding 3 back-ticks (```
) on the lines above and below the pasted configuration
https://community.home-assistant.io/t/how-to-format-your-code-in-forum-posts/702762
If your button doesn’t natively support multi-press events then you will have to emulate them by using a Wait for Trigger action in your automation.
In general this would look like:
triggers:
- trigger: state
entity_id: sensor.x
to: y
conditions: []
actions:
- wait_for_trigger:
- platform: state
entity_id: sensor.x
to: y
timeout:
seconds: 2
continue_on_timeout: true
- choose:
- conditions:
- condition: template
value_template: "{{ wait.trigger is none }}"
sequence:
- #ACTIONS FOR SINGLE PRESS
default:
- #ACTIONS FOR DOUBLE PRESS