This is possible by using the following twitter trigger:
And using the IFTTT Maker channel as trigger, similar to described in this post:
With the twitter trigger I have mentioned, you can react to mentions you get, and get the text of the tweet. So, suppose you have a twitter account for your home that is @home. You could write “@home, turn lights on”. So every time you got a mention, your device resource is called with the text, and the user that have mentioned you. From this point, it is quite easy to check the user mentioned you (to be sure the user have the right credential to execute the action), and evaluate the text to detect what is the request.
I have tested this integration with IFTTT, configuring the maker event as the following:
And defining a resource in the device like this:
thing["mention"] << [](pson& in){
const char* user = in["user"];
const char* text = in["text"];
Serial.println(user);
Serial.println(text);
};
Which results in an output similar to the following result every time you got a mention:
alvarolb84
@thinger_io reacting to a twitter mention!
However, It seems that twitter does not allow you to write tweets with the same status, so if you turn on and off quite frequently from twitter, you must add a trailing number, or a different hashtag to pass the twitter filter.
