I have some dash buttons that I have successfully configured using daher and would like to use one of them as a garage door opener. Since the dash button can only be configured to respond to a single press, I am trying to figure out the best way to toggle my garage doors (from open to close or vice versa). I would use garageio to send the open and close command through IFTTT, and I do know the current state of the garage door (open or closed). How do I make a press of my dash button send the appropriate command - do I create some sort of logical toggle switch using a template?? I’m lost
Here’s what I tried (just putting a bogus trigger in the automation - I only ever want it triggered manually from the Dash button - I’m sure there is a better way to do this!):
- alias: Open/Close Sue's Garage Door
initial_state: 'on'
trigger:
platform: state
entity_id: group.garage_stall_doors
from: 'off'
to: 'onxxxx'
action:
service: ifttt.trigger
data_template:
data: >
{% if is_state('binary_sensor.door_window_sensor_158d00019e0db4', 'off') %}
{"event":"Garage_sue_open"}
{% else %}
{"event":"Garage_sue_shut"}
{% endif %}
I get this error in the log:
2017-08-13 14:30:08 ERROR (MainThread) [homeassistant.core] Invalid service data for ifttt.trigger: extra keys not allowed @ data['data']. Got '{"event":"Garage_sue_open"}'
required key not provided @ data['event']. Got None
Thank you for your help …better - no more error message in the log, but I am not seeing any action on the door. Have confirmed that the two events are working when I manually run them from the Services panel:
perhaps the “garage_sue_shut” and “Garage_sue_open” need to be in quotes? Sorry for stabbing in the dark, there’s no way for me to test this for the right answer.