OpenGarage Forums Comments, Suggestions, Requests Check to see door is open before closing with IFTTT and apilio.io

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #529

    bgnome
    Participant

    So I was wondering how to set up independent open and close functions for OG and incorporate them into IFTTT. Instead of just operating like a button, the open command would make sure that the door was closed before attempting to open and vice versa for the close command. For example, this would allow us to check and make sure that the door was closed at 10pm without accidentally opening it instead. This functionality may be baked in to OG in the future but right now I have it working using apilio.io.

    Apilio.io is an extension of IFTTT that serves to use webhooks as a method of incorporating logic. This allows for the use of multiple and complex conditions for trigger and a sequence of actions. Unfortunately it is not particularly user friendly at the moment. I will post a follow up with a walkthrough.

    #530

    bgnome
    Participant

    You will need to have IFTTT already set up with your OG.
    Ray has a write up on this thread:

    “Alexa, open my garage door” — Using IFTTT with OpenGarage


    I also have an alternative method using Blynk:

    IFTTT through Blynk

    You will also need to sign up at apilio.io and input your IFTTT key:
    http://www.apilio.io

    The idea is to have OG send status changes through IFTTT to a variable stored on apilio.io. Whenever an open or close request is received through IFTTT, it is checked against this variable, and then sent back to IFTTT.

    #531

    bgnome
    Participant

    Ok, now on to the meat and potatoes. I apologize in advance as I have the programming skills of a room full of monkeys with laptops.

    On apilio.io I have the following set up:

    String Variable
    Name: Opengarage_status
    Value: blank

    Conditions
    Name: Garage_door_already_closed
    Variable: Opengarage_status
    String contains: closed
    Name: Garage_door_already_open
    Variable: Opengarage_status
    String contains: left OPENED

    Logicblocks
    Name: open_door
    Conditions: Garage_door_already_closed
    Actions for positive result: Click
    Actions for negative result: Already_open
    Name: close_door
    Conditions: Garage_door_already_open
    Actions for positive result: Click
    Actions for negative result: Already_closed

    • This reply was modified 7 years, 3 months ago by bgnome. Reason: Garage_door_already_open modified to account for automation notification about door being left open
    #532

    bgnome
    Participant

    Now with IFTTT, I required an applet that sets Opengarage_status and an applet that will CLick the button for OG. After that, you can make up any applet to open or close your garage door based on whatever trigger you want.

    So on IFTTT:

    Applet: Whenever OpenGarage changes status, send to apilio.io
    Trigger: Receive a web request
    Event Name: opengarage
    Action: Make a web request
    URL: (Copy “Set value” link from Opengarage_status variable but replace “your-value-goes-here” with Value1 from IFTTT ingredients list)
    Method: Get

    Applet: Web request to click button for OpenGarage
    Trigger: Receive a web request
    Event Name: Click
    Action: Make a web request
    URL: (Use the link that triggers a button press on your OG set up previously)

    Example of an applet to close the door
    Applet: If garage door is open at 10:00 PM, then close door
    Trigger: Every day at
    Time: 10pm
    Action: Make a web request
    URL: (Use “Evaluate” link from close_door logicblock)
    Method: Get

    Example of an applet to open the door
    Applet: If You say “Alexa trigger garage door open”, then check and open garage door
    Trigger: Say a specific phrase
    Phrase: garage door open
    Action: Make a web request
    URL: (Use “Evaluate” link from open_door logicblock)
    Method: Get

    The first applet fires everytime OG sends IFTTT a notification. Value1 will be something like “My OpenGarage just closed!” and is stored under Opengarage_status. Whenever an applet triggers one of the logicblocks, it checks to see if Opengarage_status contains “OPENED” or “closed” then if the argument is positive, will send a Click back to IFTTT. If there is a negative result, I have it send Already_open or Aleady_closed to IFTTT which then sends the appropriate notification, but this is optional.

    This process could be cleaner if we could get the garage door status directly from Blynk or the OG and then send the button click based on that value. However, I could not figure out how to read a value in IFTTT without some sort of trigger or send that same value once it was read. Once I figured out that the opengarage event that is sent to IFTTT by the OG when activated actually contains the text for the notification in Value1, I figured I could use that as my conditional flag for apilio.io. I am hoping that eventually an independent open and close function get incorporated into the firmware or we get a native IFTTT service, but so far it has been a lot of fun figuring this stuff out.

    • This reply was modified 7 years, 3 months ago by bgnome.
    #583

    Ray
    Keymaster

    Yes we do plan to very soon add a new API to the firmware that allows you to trigger ‘open’ or ‘close’ in addition to just be able to ‘toggle’ (or click). Specifically, open will check if the door is already open and only triggers relay if the door is currently closed, and similarly for the close command.

    #637

    lawrence_jeff
    Participant

    Ray
    I have added this to my fork if interested
    Here is the specific committ
    https://github.com/lawrence-jeff/OpenGarage-Firmware/commit/cdf3d1337705b53c132d09c51dd41d37382d0667

    I haven’t baked it into the MQTT piece yet

    #925

    Saachi
    Participant

    I suggest you look at switchur.com as a better alternative to apilio. https://switchur.com

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

OpenGarage Forums Comments, Suggestions, Requests Check to see door is open before closing with IFTTT and apilio.io