IFTTT - GPS Location

Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Locked
User avatar
bernd_d
 
Posts: 6
Joined: Fri Aug 23, 2019 4:46 pm

IFTTT - GPS Location

Post by bernd_d »

Hi,

I'm new here and really like Adafruit IO. I send LoraWAN sensor data and currently visualize them in Dashboards which works great.

Now I tried to get GPS location information into IO. The data is send from TheThingsNetwork --> IFTTT --> Adafruit IO (like for the other sensors).
However it seems I missed somewhere to format the GPS data the right way within IFTTT. I see the correct GPS lat and lon information in the feed table.
I hope I didn't miss it in the forum search somewhere...

Currently the value field in the feed table looks like this (replaced the GPS coordinates with '1'):

Code: Select all

value : 0, lat : 11.1111, lon : 1.1111	
In the next column it seems that a location is recognized as there is a "Location" column in the feed table with a "view" button.
If I click the button I see an ID. However when I create a map block within a Dashboard it isn't populated with the feed values...but it feels I'm close to it ;-)

My question is what is the right way to format the data within IFTTT so that Adafruit IO correctly recognizes the data as GPS information and the map block can visualize it ?

Would appreciate your thoughts or a pointer in the right direction.

Best regards, Bernd

User avatar
brubell
Learn User Page
 
Posts: 2017
Joined: Fri Jul 17, 2015 10:33 pm

Re: IFTTT - GPS Location

Post by brubell »

It seems like you're sending everything correctly. Could you take a screenshot of your Feed page and post it below?

User avatar
bernd_d
 
Posts: 6
Joined: Fri Aug 23, 2019 4:46 pm

Re: IFTTT - GPS Location

Post by bernd_d »

Thank you for your reply
brubell wrote:It seems like you're sending everything correctly. Could you take a screenshot of your Feed page and post it below?
I attach a screenshot of my feed page and the popup window that appears when pressing "view" in the location column.

Regards,
Bernd
Attachments
Popup window when pressing "view" in the feed page
Popup window when pressing "view" in the feed page
Popup_Window_Location.png (49.97 KiB) Viewed 698 times
Screenshot of feed page with location column
Screenshot of feed page with location column
Screenshot_Feedpage.png (313.58 KiB) Viewed 698 times

User avatar
brubell
Learn User Page
 
Posts: 2017
Joined: Fri Jul 17, 2015 10:33 pm

Re: IFTTT - GPS Location

Post by brubell »

It seems like you're sending the location in the value field. The map block looks for location as metadata in the location field, highlighted below in red:
locfield1.png
locfield1.png (46.37 KiB) Viewed 687 times
Here's an example of a feed with the location field populated correctly:
locfield.png
locfield.png (11.61 KiB) Viewed 687 times
IFTTT should be sending GPS location as optional metadata, along with the value:

Code: Select all

# Send new data with a value of 42 and include optional location metadata
curl -H "Content-Type: application/json" -d '{"value": 42, "lat": 23.1, "lon": "-73.3"}'  -H "X-AIO-Key: {io_key}" https://io.adafruit.com/api/v2/{username}/feeds/{feed_key}/data
Reference: https://io.adafruit.com/api/docs/#create-data

Could you post the IFTTT setup?

User avatar
bernd_d
 
Posts: 6
Joined: Fri Aug 23, 2019 4:46 pm

Re: IFTTT - GPS Location

Post by bernd_d »

Thanks for the working sample. Attached the IFTTT setup as per GUI.

Thanks for you support!

Regards, Bernd
Attachments
IFTTT_Setup_GUI_GPS_location.png
IFTTT_Setup_GUI_GPS_location.png (167.01 KiB) Viewed 682 times

User avatar
brubell
Learn User Page
 
Posts: 2017
Joined: Fri Jul 17, 2015 10:33 pm

Re: IFTTT - GPS Location

Post by brubell »

Seems like the IFTTT integration sends everything to the value field instead of separating it. Wanna see if using https://zapier.com makes it possible to send metadata as well as the value field?

User avatar
bernd_d
 
Posts: 6
Joined: Fri Aug 23, 2019 4:46 pm

Re: IFTTT - GPS Location

Post by bernd_d »

brubell wrote:Seems like the IFTTT integration sends everything to the value field instead of separating it. Wanna see if using https://zapier.com makes it possible to send metadata as well as the value field?
Thank you for the additional option with zapier, but I'd prefer not to use another service ;-)
Maybe it is just the wrong data format or keywords I used within ifttt ? Any specific keywords on the IO side that are necessary to fill the location column?

User avatar
brubell
Learn User Page
 
Posts: 2017
Joined: Fri Jul 17, 2015 10:33 pm

Re: IFTTT - GPS Location

Post by brubell »

bernd_d wrote:
brubell wrote:Seems like the IFTTT integration sends everything to the value field instead of separating it. Wanna see if using https://zapier.com makes it possible to send metadata as well as the value field?
Thank you for the additional option with zapier, but I'd prefer not to use another service ;-)
Maybe it is just the wrong data format or keywords I used within ifttt ? Any specific keywords on the IO side that are necessary to fill the location column?
IFTTT may be only filling the value field, instead of sending extra fields (for the location) to IFTTT such as lat/lon/ele.

User avatar
bernd_d
 
Posts: 6
Joined: Fri Aug 23, 2019 4:46 pm

Re: IFTTT - GPS Location

Post by bernd_d »

brubell wrote:
bernd_d wrote:
brubell wrote:Seems like the IFTTT integration sends everything to the value field instead of separating it. Wanna see if using https://zapier.com makes it possible to send metadata as well as the value field?
Thank you for the additional option with zapier, but I'd prefer not to use another service ;-)
Maybe it is just the wrong data format or keywords I used within ifttt ? Any specific keywords on the IO side that are necessary to fill the location column?
IFTTT may be only filling the value field, instead of sending extra fields (for the location) to IFTTT such as lat/lon/ele.
It's been awhile now but finally I was able to give Zapier a try. Really great interface and great options compared to IFTTT. I like it. ;-)
However I still struggle in getting the gps coordinates into the io dashboard location column. I was able to connect zapier to adafruit but I see the same results as if they come via IFTTT...

I'd appreciate any hints for data formatting within Zapier to make Adafruit recognize the coordinates as "location" not as "value"...

Bernd

User avatar
mharmon12
 
Posts: 1
Joined: Mon Jul 10, 2017 11:45 am

Re: IFTTT - GPS Location

Post by mharmon12 »

I'm using
AdafruitIO_Feed *AIO_feed = io.feed( "myFeedInAdafruitIO");

AIO_feed->save( val, lat, lon, ele );

Where
val is an integer
lat, lon & ele are double.

When I tried anything else then my information ALL went to the value as in your example.
Try just sending each value comma separated.

User avatar
adafruitguy
 
Posts: 206
Joined: Sat Jun 07, 2014 7:52 am

Re: IFTTT - GPS Location

Post by adafruitguy »

I'm having a similar challenege via ifttt placing all data in the "Value".

From my IFTTT setup...
Here's my IFTTT Setup
Here's my IFTTT Setup
ifttt data.png (29.91 KiB) Viewed 343 times
Feed showing up on Adafruit.io under Location "View"...
Location Data Showing as "View"
Location Data Showing as "View"
Screen Shot 2020-10-08 at 8.41.18 AM.png (24.09 KiB) Viewed 343 times
And it looks like everything is in the Value field...
Value Field Only
Value Field Only
io example.png (64.28 KiB) Viewed 343 times
Anyone have some more suggestions? My data is originating on The Things Network, and I would like to log and display on a map via Adafruit.io

User avatar
adafruitguy
 
Posts: 206
Joined: Sat Jun 07, 2014 7:52 am

Re: IFTTT - GPS Location

Post by adafruitguy »

IFTTT allows a web request via Webhooks. If I use this instead of the IFTTT Adafruit integration might I be able to feed location data into the proper place, instead of everything showing up in Value?
IFTTT Webhooks POST
IFTTT Webhooks POST
Screen Shot 2020-10-10 at 8.38.08 AM.png (138.39 KiB) Viewed 322 times
What would I use for the URL and where would I apply my username and Key?

X-AIO-Key= BANNED in the body?

User avatar
adafruitguy
 
Posts: 206
Joined: Sat Jun 07, 2014 7:52 am

Re: IFTTT - GPS Location

Post by adafruitguy »

It looks like success is possible using IFTTT to get GPS data into the location fields...

Instead of using the IFTTT Adafruit service for you "then that" ingredient, add: "Webhooks", "Make a web request" with the following...
IFTTT Make a Web Request
IFTTT Make a Web Request
Screen Shot 2020-10-11 at 9.24.03 AM.png (156.24 KiB) Viewed 296 times

Code: Select all

https://io.adafruit.com/api/v2/{username}/feeds/{feed_key}/data?x-aio-key={io_key}
Using your own: {username}, {feed_key}, and {io_key}

This yields the desired results...
Data in the desired location fields
Data in the desired location fields
Screen Shot 2020-10-11 at 9.24.33 AM.png (31.88 KiB) Viewed 296 times

User avatar
bernd_d
 
Posts: 6
Joined: Fri Aug 23, 2019 4:46 pm

Re: IFTTT - GPS Location

Post by bernd_d »

adafruitguy wrote:It looks like success is possible using IFTTT to get GPS data into the location fields...

Instead of using the IFTTT Adafruit service for you "then that" ingredient, add: "Webhooks", "Make a web request" with the following...
Screen Shot 2020-10-11 at 9.24.03 AM.png

Code: Select all

https://io.adafruit.com/api/v2/{username}/feeds/{feed_key}/data?x-aio-key={io_key}
Using your own: {username}, {feed_key}, and {io_key}

This yields the desired results...
Screen Shot 2020-10-11 at 9.24.33 AM.png
@adafruitguy - You are the guy!! Thanks for sharing this. This works ! Adafruit offers the URL by copying the adafruit feed URL that is automatically generated into the webrequest URL.

Locked
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.

Return to “Internet of Things: Adafruit IO and Wippersnapper”