6

(I'm not sure if an question about IFTTT automation via Android is better suited to Stack Overflow, or Android Stack Exchange, or here, so I figure I'll try here first ...I'm surprised there's no "official" forums yet!)


I've been coding for many years but am new to automation, and just got a Google Home, which introduced me to IFTTT. It seems fairly straightforward/intuitive, which I why I figure there must be a way to do this.

I like the idea this applet from 'Android Battery':

img

...but instead of it running when the device's battery level drops below 15%, I want to use a plain old Date/Time trigger service so the applet fires every hour, still recording the "current battery level" (ingredient) in a Google Sheet.

      hourly trigger      battery ingredient


Is it possible to combine a trigger from one applet, with an action ingredient from another, in this way?

2

To my knowledge, this is unfortunately not possible.

The BatteryPercentage ingredient comes from the Android Battery trigger, so you can only get that data if you are using one of the Android Battery triggers (i.e. charging, removed from charger or < 15% charge). Since there's no way of chaining things effectively on IFTTT, it's simply not possible to get data from the Android Battery trigger after the Date/Time trigger activates.

I suppose the logic here is that the Date/Time trigger is processed on IFTTT's servers, whereas Android Battery triggers are pushed to the server at the correct time. That would mean the Date/Time trigger would need to poll your phone for its charge (or else have a new trigger to run a local timer and trigger the event at the right time).

Android Authority say that Tasker may be able to do what you want, though:

There are plenty more times than just plugging in or unplugging that I would want to save data points, I’d want to see low battery warnings, overheating battery warnings, maybe even an entry once per hour, just to see how things are coming along.

As I eluded earlier, you can utilize variables into a dedicated “file writer” Task, to prevent the code duplication required here, but if you ignore that and create brand new Tasks for each trigger, just copy the above steps, keep the Boolean to indicate your plugged-in state regardless the trigger, then update your reason for action (trigger) entry, including things like “Low Battery”, “AC Plugged In”, “USB Plugged in”, “Device Unplugged”, “Hourly Update”, “WiFi/Bluetooth radio activated”, “WiFi/Bluetooth radio deactivated” and so much more.

They're unfortunately rather brief on the details (and I can offer little more in the way of help myself, as I'm not intimately familiar with Tasker) but that may be a better route to pursue. Another negative is that Tasker is a paid app; you could of course write an app yourself to do what you need... but I suspect it's probably going to take more than a few hours of work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.