The folks at IFTTT have done it again. They have new iOS/Android apps released today and the one named Do Button is perfect for IoT.
While IFTTT is for automating background tasks, the Do Button is for when you want manual control over your (for example) Spark Core. It will allow you to create a recipe that does one of two things:
Publish a private event
Call a function
Then this is wrapped into a single button. And even better, you can put this in Notification Center on iOS so itâs always a flick away. Similarly, on Android it can be a widget on your homescreen.
True, more would be nice. The 3 you do get couldnât be any easier to set up and use. I didnât even have to login since it was smart enough to recognize my account from the IF (formerly IFTTT) app. Very slick.
Now we are talking about IFTTT channels, I really canât seem to understand the âYoâ channel. I tried to search it but that gives bs results. Anyone here that understands it?
I saw that too, but it didnât quite make things understandable. Sure, a button is understandable but âYo IFTTTâ or âadd IFTTT to your Yo contactsâ. Searching for Yo in the app store isnât really helpfull and shouting Yo at my phone doesnât work either
This is a great addition to the Spark universe of compatibility.
so a practical use of the do button⌠toggle a lamp on/off⌠but you donât know its present state?
create a function that toggles the powerState of your device:
int devicePower(String powerState)
{
int value = powerState.toInt(); //for example params=2 //(toggles the state versus zero or one which sets it)
Serial.println(value);
if (value == 0 || value == 1)
{
deviceState = value;
return value;
}
else if (value == 2)
{
deviceState = !deviceState;
return deviceState;
}
else return -1;
}
and then use Pushingbox to return to you a notification with the present state!
Itâs really weird, but while my ifttt recipes work to close my window shutters in combination with my spark core hacked to a shutter remote, the Ifttt do button app doesnât work and gives errors. The only thing my script is doing is creating three functions (open, close and stop) and map those to digital writes to 3 pins. While my jawbone up + spark core recipe works (closing the shutters when I go to sleep), the button does nothing and I get an error message in my email from ifttt. Anybody else having these issues?
Action Timeout Error about 16 hours ago
Spark or its API may temporarily be down. After five consecutive errors, the Recipe will automatically turn off and an email with further instructions will be sent. Adjust your email alert settings here.
I flashed your code to one of my Cores (with the small addition of an RGB blink for testing purposes). I then created a DO button for all four functions. They all seem to work here. (iPhone 5 running iOS 8.1).
Hereâs the code with the RGB flashes:
Could you give it a try to see if the code is being called?
Are there problems with any specific function, or are they all problematic? Seeing as the semicloseFunction has a delay of 16.8s it might time out on the IFTTT side waiting for a response.