OpenGarage › Forums › Comments, Suggestions, Requests › Check to see door is open before closing with IFTTT and apilio.io
Tagged: Ifttt extension
- This topic has 6 replies, 4 voices, and was last updated 6 years, 7 months ago by
Saachi.
-
AuthorPosts
-
August 6, 2017 at 9:37 am #529
bgnomeParticipantSo 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.
August 6, 2017 at 11:20 am #530
bgnomeParticipantYou will need to have IFTTT already set up with your OG.
Ray has a write up on this thread:
I also have an alternative method using Blynk:You will also need to sign up at apilio.io and input your IFTTT key:
http://www.apilio.ioThe 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.
August 6, 2017 at 1:36 pm #531
bgnomeParticipantOk, 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: blankConditions
Name: Garage_door_already_closed
Variable: Opengarage_status
String contains: closed
Name: Garage_door_already_open
Variable: Opengarage_status
String contains: left OPENEDLogicblocks
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, 1 month ago by
bgnome. Reason: Garage_door_already_open modified to account for automation notification about door being left open
August 6, 2017 at 2:16 pm #532
bgnomeParticipantNow 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: GetApplet: 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: GetExample 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: GetThe 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, 1 month ago by
bgnome.
August 15, 2017 at 10:39 am #583
RayKeymasterYes 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.
September 6, 2017 at 3:47 pm #637
lawrence_jeffParticipantRay
I have added this to my fork if interested
Here is the specific committ
https://github.com/lawrence-jeff/OpenGarage-Firmware/commit/cdf3d1337705b53c132d09c51dd41d37382d0667I haven’t baked it into the MQTT piece yet
January 16, 2018 at 1:05 pm #925
SaachiParticipantI suggest you look at switchur.com as a better alternative to apilio. https://switchur.com
-
This reply was modified 7 years, 1 month ago by
-
AuthorPosts
- 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