WatchApp: GIFTTT Alpha (Garmin device IFTTT trigger)

https://apps.garmin.com/en-US/apps/04890351-a25c-40ad-afae-f3c6907fe05f

GIFTTT is a simple application that allows Garmin devices to trigger IFTTT events via the IFTTT Maker channel (http://ifttt.com/maker). This may not sound all that interesting, but here are a few things it can allow you to do.

  • Open or close your garage door
  • Turn on or turn off a fan or other device
  • Control a programmable thermostat
  • Change the ambient lighting, open/close blinds
  • Text your wife a pre-written message


Anything you could control with IFTTT, you can control with GIFTTT. For actions may require purchase of additional hardware (to control ambient lighting, you'll need lights that are controllable similar to the Phillips Hue system, or to turn on/off a switch you might need to buy something like a Belkin Wemo Switch).

Instructions:
  • To use this app, you'll need to configure an IFTTT account, and activate the Maker channel (http://ifttt.com).
  • Once you've done this, you'll have to get into the application settings for GIFTTT and set the secret key you were given.
  • You will then need to create an IFTTT recipe to connect the services that you wish to use. For instance, if you wish to send your wife a pre-written text message, you would configure the Maker channel as the 'this' portion of the recipe, and iOS/Android Notification as the 'that'.
  • Now that you have a IFTTT recipe in place, you will need to configure one of the tasks in GIFTTT with the name and values you want to feed to the IFTTT recipe. You can do this from the GIFTTT menu for the task you want to modify.
  • To submit an action, you just have to pull it up on screen it and press enter.


Notes:
  • I don't currently have any logic in place to verify your key is correct and I don't check that you've entered one at all. I plan to fix this in the future.
  • The app currently does nothing to tell you that your device is not connected Garmin Connect Mobile. You will get errors when trying to submit requests, not before. I'd like to fix this so users see a not connected page.
  • The app currently displays a 404 error code. This does not mean that the send didn't work, it just means that the IFTTT server responded with data that couldn't be parsed by the devices JSON parser. I need to figure out how to tell IFTTT to send back JSON data.
  • There is currently no support for adding/deleting actions. You can rename and configure the existing ones, but you can't add or delete them. This will be addressed soon.
  • This is currently a watch-app, but I'd like it to be a widget. As soon as I can figure out how to get the widget to let me use the up/down arrows, I'll switch over. I'm considering adding a widget that has only one action (similar to the existing IFTTT Do channel).
  • The user interface is a little clunky. I'll work to refine it in the future.
  • I'd like to be able to send data from the device in place of the hard-coded value strings. For instance, you could send your current position and speed data to IFTTT.
  • If you have ideas on how to improve this app, please feel free to make requests.


Release History:

0.0.2
* Remove my secret key from the default settings.

0.0.1
* Initial Revision
* Supports 920XT with 4.20 firmware (ConnectIQ 1.1.2)
  • Former Member
    Former Member over 10 years ago
    I'm getting REQUEST_TIMED_OUT

    I've setup everything but when I try to run it I get REQUEST_TIMED_OUT.
    Any ideas?
    Is this a configuration problem on my end or is something else wrong?

    Thanks
  • Travis do you have limitation to 5 events ?

    Yes. I can increase it.

    Maybe you can make an app that will work with tasker it will be best now i trigger ifttt that send to my phone message that triggered tasker and tasker start an action

    I could do that, but that would mean writing a tasker plugin that used the ConnectIQ Android libraries. I don't really have the time to learn Android.

    I've setup everything but when I try to run it I get REQUEST_TIMED_OUT.

    This indicates that the Communications.makeJsonRequest() call invoked the user callback with NETWORK_REQUEST_TIMED_OUT. I'm not exactly sure where the timeout occurred (device -> mobile, mobile -> ifttt), what could cause it, or how to adjust the timeout. Does it do it consistently?

    Travis
  • Former Member
    Former Member over 10 years ago
    This indicates that the Communications.makeJsonRequest() call invoked the user callback with NETWORK_REQUEST_TIMED_OUT. I'm not exactly sure where the timeout occurred (device -> mobile, mobile -> ifttt), what could cause it, or how to adjust the timeout. Does it do it consistently?

    Travis


    Yup, it happens consistently every time I try to run it.
  • Former Member
    Former Member over 9 years ago
    I like your app a lot. For me it does exactly what I want it to do.
    There is one cosmetic wish on my wishlist. Could you (make an option to) present the actions as a list instead of pages.
    I am not using the value fields so I don't need that information on the page so a list with just the action names would be suffice.

    Bernd
  • I am not using the value fields so I don't need that information on the page so a list with just the action names would be suffice.

    Yes. Thanks for the feedback. I'm not really happy about the user interface right now either. Unfortunately, using a list just creates more interface issues.

    Lets just assume for a second that I switch over to use the built-in menu system. You'd get a menu where each item corresponds to an event. You select the event from the menu, and then trigger it by pressing the enter key. Sounds great, right?

    But with this, how do you configure the application (add an event, update your ifttt key, ...) or configure that event (the name, values, ...)? Pressing menu from within a menu isn't something that can be handled in ConnectIQ. So, do I add a settings entry at the bottom of the menu? That seems weird because some of the menu items are for triggering events and others are for configuring them. I could add another sub-menu such that if you select an event from the top-level menu, the sub-menu would appear with Trigger and Configure menu items. This would require an additional button press/screen tap for the most common use case. It also doesn't help to solve the problem of where to put the settings for the application. I could add a dummy main screen, and then allow the user to press Menu to configure the app or the events, and Enter (or tap the screen) to get to the event selection menu where you could select and trigger the event you want. Unfortunately, this adds two button presses (or taps) for the most common use case. I don't really like any of these options.

    I had previously written my own clone of the fr920xt menu system. This is simply a list of items where up to three are displayed on the screen at a time. The user can swipe up/down or use the up/down keys to select an item, and then tap or press enter to select it. With this, you could go to the configuration screen for the selected event by pressing the Menu button. I'd probably still have to add a dummy main screen to provide a place to configure the app, so there'd be just one additional click instead of two. Unfortunately, vivoactive users complained that my custom menu system it didn't work well, and I really do plan to add vivoactive support for this app.

    Comments?

    Travis
  • Former Member
    Former Member over 9 years ago
    Hi Travis,

    Thank you for your extensive comment. I now understand more of the challenges you are facing when programming for ConnectIQ.
    I had a thought, but having no understanding of developing for ConnectIQ, it might be a stupid thought but here it is:
    Why not make the settings outside of the watch f.e. by putting them in an xml or even simpler text file that is coppied to the watch using the usb cable.
    That would remove the need for a configuration user interface.
    Entering the Maker ID through the Garmin text input interface is kind of a pain. Being able to do that using a text editor on the computer would also make that a lot easier. A simple text file with the maker id on the first line and the action id's on further lines could probably do it.
    After my watch totally crashed twice in short time and lost most of it's settings, including the giftt ones, I looked for an easier way to get all settings, including the Maker ID, back in place, During that search, I found the giftt settings file in one of the file maps on the Fenix, but unfortunately it was not really text editable.
    When changing settings for giftt one usually needs another device anyway to make the corresponding iftt recipe. One might as well use that device to create/update the settings file as well.
    I am curious about your thoughts on this.

    Bernd
  • Thank you for your extensive comment.

    No problem. Thanks for taking the time do discuss some of these issues with me. It is a lot easier to come to a decision on what to do if I have some sort of feedback. I'm not really great at making decisions on my own.

    Why not make the settings outside of the watch f.e. by putting them in an xml or even simpler text file that is coppied to the watch using the usb cable.

    This would be a workable solution, but is not likely to be very user friendly unless I invest a bunch of time in it. Making a slick UI jthat allows the user to tweak settings is not something that I can easily do.

    I think in the long run (hopefully with ConnectIQ 2.0 in September), I will be able to make changes that will allow the user to change settings from Garmin Express or Garmin Connect Mobile. This would resolve the issue entirely and remove the need for configuration within the app completely. I think some users will be confused that there is no way to change settings from within the app, but this is something that they're going to have to get used to. A lot of watch faces will be configured this way.


    Entering the Maker ID through the Garmin text input interface is kind of a pain.

    I agree 100%. It was extremely painful to enter my 22 character IFTTT secret key during testing. I never want to have to do it again.

    Being able to do that using a text editor on the computer would also make that a lot easier.

    I had started to implement a solution that would have been quite slick. When you start the app for the first time (or any time where the key was missing), it would send a device identifier to my web service, and my web service would send back a 4-digit key. The watch would show the 4-digit key and tell you to go to a web address. You'd go to that web address on a computer, enter the 4-digit key and your maker channel secret key, and click submit. Then, you'd be directed to press Enter on the watch. Upon pressing Enter on the watch, it would send a request to my web service for the secret key for the given 4-digit key and the unique device identifier.

    All of this would be done to avoid the user needing to type the super-long key strings on their devices. Unfortunately, it does nothing to simplify user interface.

    I am curious about your thoughts on this.

    I think at this point it might be in my best interests just sit back and wait for the expected ConnectIQ 2.0 configuration stuff. This saves me a boatload of work on a backend that I'd probably end up throwing away, and it allows me to eliminate a bunch of configuration stuff from the UI. I could probably write some code to allow users to read/write the application configuration file.

    Travis
  • Former Member
    Former Member over 9 years ago
    Awesome just what i have been waiting for but.....

    Can you add vivoactive please?
  • Yes. The vivoactive didn't previously have any way for me to get user input. This made it impossible for the user to enter their IFTTT key.

    With ConnectIQ 1.2.0, I should be able to avoid this entirely. The user settings feature should allow users to configure the app via Garmin Connect Mobile or Garmin Express, so I don't really need to get input from the user at all.

    I've worked on an improved version over the weekend. I really like how it is looking, but I have a long way to go.

    Travis
  • Former Member
    Former Member over 9 years ago
    Vivoactive

    Great can't wait to see it. I have loads of IoT stuff and this is a nice piece to add.
    So now when the wife turns up the heating i don't have to get up to turn it back down just do it on my wrist :)