Sending POST from IFTTT

Hi Guys, I’m a recent addition to the Hass world, and I must admit it has become an addictive hobby.
I have a Garageio garage opener and it doesn’t have great integration with much except ifttt, I can send open and close requests pretty easily, however its quite important to know the state of the door in case its opened manually.
Ifttt has an integration with Garageio to start an action once the door is either opened or closed through any method. Now I can do a ‘that’ with Webhooks to Hass, but really struggling to set it up. The garage door is currently setup as an input_boolean and when its triggered, I send a on/off value to its state

  • alias: open when door closed
    hide_entity: true
    trigger:
    - platform: state
    entity_id: input_boolean.garage_door
    to: ‘on’
    action:
    - service: ifttt.trigger
    data: {“event”:“open_garage”, “value1”:“on”}
    - alias: close door when open
    hide_entity: true
    trigger:
    - platform: state
    entity_id: input_boolean.garage_door
    to: ‘off’
    action:
    - service: ifttt.trigger
    data: {“event”:“close_garage”, “value1”:“off”}

on ifttt, there is an option to send the door state as the variable which is necessary to determine the state at which the input_boolean should be set, ifttt sends a ‘closed’ or ‘open’ state in the json, I presume I have to change that state value to ‘on’ or ‘off’ for the input_boolean to accept the value, not sure how to do that either or even what url I should send the http POST to, I’m guessing “http://my.hass.add:8123/api/events/call_service?api_password=my_password”?

Any help is appreciated, thanks!

Disclaimer: I don’t use cover entities, and I haven’t integrated a garage door with HA, but I have used IFTTT with HA, so hopefully the following suggestions might at least point you in the right direction.

First, I would suggest using a Template Cover instead of an input_boolean to represent the garage door. Use the open_cover and close_cover configuration variables to call the corresponding ifttt.trigger services (as you had in the action of your two existing automations.)

Next, I would suggest using an HTTP Sensor to accept the state of the door from IFTTT.

Lastly, in the template cover, use the value_template configuration variable to get the state of the door from the HTTP Sensor. You’ll probably need the template to take into account the fact that, after a HA restart, the HTTP Sensor will not exist in the HA State Machine (i.e., the sensor entity won’t exist) until the first time IFTTT sends the door position update.

Let me know if you need more help with the details.

Hi,
Sorry for taking so long to get back to you, and thank you for your suggestions.
I couldn’t quite use it in this way, because of issues with IFTTT and the api working with HTTP sensor, but your idea definitely guided me in the right direction, and I managed to solve it!
I ended up going with the input_boolean because I could pass the state using the ifttt_webhook trigger, then I used that state value from the input_boolean in the value_template in cover, and its working perfectly.

Again, thanks so much for your help with this!

Hi Ali, any chance you could help with this please.

I am simply wanting to create a ifttt rule that if the nest temp rises above 22c (in IFTTT) it writes out to a state in HA via the webhook, bearing in mind this doesn’t work with states I am interested how this is achieved using a webhook to a input_boolean.

Thanks in advance