pebble-health-export
pebble-health-export copied to clipboard
POST:ing using IFTTT MAKER?
Hi,
I tried to set it up so that a POST to a MAKER-path in IFTTT triggers a write to Google Drive.
However it does not trigger.
The path is https, perhaps that is the culprit. Omitting the 's' to http will not trigger either, but isuspect IFTTT-MAKER only supports https...
Not sure what happens when pebble tries to connect there...
Found this; but not sure it's related http://forum.universal-devices.com/topic/18834-ssl-error-to-makeriftttcom/
Hi, I received your e-mail on the same topic, but if you don't mind I'll answer here so that others can benefit from it too.
The most likely reason it doesn't currently work with IFTTT is that the POST payload doesn't have the correct format: Health Export currently sends the payload as application/x-www-form-urlencoded which is the same as a browser would do when submitting an HTML form, while IFTTT Maker channel expected a JSON payload, as is often the case in the javascript world.
I can probably update Health Export to speak with IFTTT Maker channel. However I'm concerned about the terms of service, because there is qiute a lot of data to export. There is one sample per minute, so 1440 samples per day. The simplest way to interface with a spreadsheet would be one query per sample, but I doubt IFTTT would let you chain 1440 queries without some hard rate-limit or even temporary ban. Samples can be merged, to a total of about 60 KB/day, but then it would require some logic to split them in the spreadsheet.
I have never used IFTTT or Google Drive yet, but it seems like a useful target, so I will try to look into it when I find time.
If you know what are the rate-limits or payload-size limits or things like that in IFTTT Maker channel, it would be helpful to know, otherwise I guess I will eventually find them by myself.
Hi, Thanks for your answer! (and thanks for your app!)
I have sifted through the terms and other places to try to find the information you sought, but to no avail yet. Does that mean there are no limits? It might mean I just was unable to find it.
Below are the options that IFTTT-Google identifies as connectable to a IFTTT-Maker web POST.
So it does not have to be to a pre-defined spreadsheet. It could be any type of file. But it does specify some limitations as seen in the squares. When setting up the trigger part in the Maker channel, no such restrictions are displayed.
I have managed to use ifttt to publish to google sheets but still with some limitations.
It seems a high number of calls to maker channel may disable the applet. At least it did it using Evernote instead of gdrive at 100 calls without data bundling. Using data bundling I managed to get more than 100 calls to google sheet, not sure which factor made the difference.
The other limitation is cell separation. It gets each call's payload in one only cell so i Will try no bundling (so at least i get one row per minute) and i Will need to slice each row within the sheet document using formulae.
You could just send it directly to google sheets and have the doPost parse it however you like. That's what I'm doing. I haven't done a full pull yet with just google sheets but when I did it with a HTML Poster (putreqs) in the middle it worked fine, so I can't imagine it'll fail with a full push. I planned on running that scenario Friday once I get the logic down on how I want to parse the data. Thinking each item in the row in it's own column and creating a sheet for each day.
I'd love to hear how you did the IFTTT push. I've been experimenting with applets but haven't dived deep enough in.
I thought that making a direct google sheet call would require some OAuth and that I could not get it working with the out-of-the-box config page for the app (I installed it from pebble appstore). Am I wrong? Let me know if your scenario of this weekend works.
Using IFTTT maker channel is quite easy and since it resolves authentication seamlessly I thought it would be a nice zero-code option.
-
Step: enable maker channel. (From yesterday maker webhooks).
-
Step: check the channel config where you get an URL (https://maker.ifttt.com/use/{your_personal_key}) where you can get more instructions and easy copy/paste urls for next steps.
-
Step create applet. a. Trigger (Maker - Receive web request). You set the "event_name" here. b. Action (in my case g. sheet append): Here you state how the webcall will be registered in g. sheet (folder, file and row content) using some "recipe ingredients".
-
In pebble_health_export config page you state the url https://maker.ifttt.com/trigger/{event_name}/with/key/{your_personal_key} and you can set datafield name to "value1" (mind lower case here although in IFTTT you will see it as Value1) as it is one of the known ingredients for the maker channel.
I'm using as row content in g.Sheet action plugin value1 but this makes the full data row exported from pebble in one only cell since the cell separator in IFTTT is "|||" and not "," so I have to parse the cell with sheets formulae (I'm doing it right now).
Greetings
Would it help if I made the value separator configurable instead of hardcoded to ","
?
It's easy to do and fit in the next version that will be released soon (with iOS support), I'm mostly concerned about making the configuration page too complex.
I don't know whether the cell separator ||| is a marker for IFTTT or for g.sheet, if it's the second case it will help having such a config option but if it's the first one it will be useless since it will surely escape it as a reserved char. I think I can make a dumb call to my applet from using HttpRequester and confirm. I'll tell you in a few moments.
Edit. IT WORKS!! Definitely a configurable separator will do the trick.
My issue is that I'm not sure I have a maker channel? I signed up for one. I'll google around for what you said since it sounds like there might be a back way into it. How reliable is IFTTT? Meaning how many lines or bundles have you sent at it at one time?
As for the solution I'm doing I have a spreadsheet that I shared publicly if you want to see it. But very high level what you'd do is:
- Create a google sheet.
- Open the script editor and add a custom form (just a bare bones form created in HTML). Not an actual google form.
- Add a doGet function to create the form in the code.gs script editor.
- Add a doPost function that will receive the bundle sent from the app, and append it to the sheet. (use sheet.appendRow([e.parameter.dataExport])) where dataExport is the name that you'll use for the field name in the app)
- Do a Publish > Deploy as web app and set the permission to anyone even anonymous (I haven't played with this to see if these permissions need to be this high, I also put my sheet in a public folder just in case.) Then copy the app link it give you. Send it to your phone.
- Add the app link to the Health Export and set the data field to the name you set on the appendRow. (I also set it to bundle 100, and put the line separator in).
Alot more coding than your solution but once you have the data you can have the doPost parse it however you like. Some time tonight I'm going to attempt a full export (I got the watch 3/9, so it won't be a fill 14 days of data) and I'll let you know if it got all the data or not.
Hi, I didn't know about the coding options in google sheets, that web app publishing looks like it might deserve some concept-proofing.
About IFTTT maker channel you just have to activate it in the channel list. I'm not sure if it is disclosed to a few users or they have some user quota, I'm using it since the very first launch (then for a home automation tool) and I have noticed that yesterday the name changed to "Maker WebHooks".
About realiability: The g.sheet append action only allows one row per call, so disabling bundling is needed until I (we) find out the row separator char if it exists (it's not %0d%0a since it is a CR in the same cell). I've noticed some lag (few minutes) between pebble sending some rows and the rows appearing in the sheet while it was open (I was setting up the formulae to parse the comma-sepparated row into individual cells while syncing). First line however appears inmediately, I had to turn out IFTTT notifications for the applet since, otherwise, it would launch one notification in my phone for each synced row. I've noticed no dropped rows, only a little scrambling since rows get to the sheet mostly ordered minute-wise but sometimes you get a 4 or 5 minutes jump and the skipped row/s appears 2 to 5 lines after.
I tried the evernote channel for my first try but when 100 calls where made the applet got disabled automatically. Probably strong data bundling there might have solved the issue. I haven't noticed such limitation with g.sheet appendrow action while syncing more than a hundred lines (not a whole day). I'm waiting to have a stable sheet document with some graphics before trying a full sync (i think it's been 3 weeks since I got the watch).
Greetings.
Hi mollenburguer, I usted the addrow action in ifttt instead of the createdocument. I believe that action only create doc files white the addrow creates the Sheet If it doesn't exists.
However I've seen daily reliability issues when a Full day is synced (every day at 0:00 in my Pebble), haven't checked If faelys has set the custom separator config options in new releases so we could send the info in batches which could resolve these problems.
El vie., 26 may. 2017 21:00, mollenburger [email protected] escribió:
I just got the GDocs version of this to work--mostly. I just have the IFTTT recipe export "value1" which gives me a csv format that works fine...except that it's getting saved as a Doc instead of a Sheet. Tried creating a Sheets file with the right name, but the recipe just made itself a new Doc file. mmenorgi, just curious if you have any idea what's going on there?
The Dropbox channel seems to have the same problem as the Evernote one, I get 50 lines before it quits. Haven't sorted out bundling properly, it doesn't work with the default separator and I've been nerdsniped enough for one day...
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/faelys/pebble-health-export/issues/6#issuecomment-304363108, or mute the thread https://github.com/notifications/unsubscribe-auth/AQ1ljZIzpLWqqxmMoKVR-9QrTdJovReKks5r9yFdgaJpZM4Ly0PA .