Hi There!
I’m trying to create a Toggle Button for our Garage Door.
The setup is as following:
- Switchbot Door Sensor
- Switchbot Button
I have both the Botton and the sensor successfully implemented into HA using IFTTT.
What I’m not trying to do, is to create a custom Toggle Button for Lovelace, where I can open and close the Garage Door, and the status of the Switchbot Sensor, will determine if the toggle stays “Toggled” or not. Furthermore, I’d like a small piece of text below the Toggle Button to state “Garage Door Status: Open/Closed/Left Open” (These are the states I can pull using IFTTT.
Here’s my question. How do I create a button like this?
Currently, when the Switchbot Sensor detects that the door is “Opened”, IFTTT triggers an Automation which looks like this:
- id: 'xxxxxxxxxxxxxxx'
alias: IFTT GARAGE SENSOR
trigger:
- platform: event
event_type: ifttt_webhook_received
event_data:
action: Garage_Door_Sensor
condition: []
action:
- service: '{{ trigger.event.data.service }}'
target:
entity_id: '{{ trigger.event.data.entity_id }}'
When I open the garage door, I can see that this Automation gets triggered.
So the data is coming through from IFTTT.
However, I don’t know how to use this data, to create a new toggle button.
The button for opening the Garage door is currently set up as a script:
alias: Open Garage Door
sequence:
- event: GarageOpen
- service: ifttt.trigger
data:
event: GarageOpen
mode: single
I looked into the Template Button, but didn’t get far at all. My main issue, is that I don’t know how to use the Status of an Aumation (Whenever its triggered), as a type of Sensor, to determine whether a Toggle should be On or Off.