CoRE and Piston Rules Engine, first design steps

Excuse my ignorance but what’s a uDTH? Sounds interesting!

@Mike_Maxwell’s [RELEASE] Universal Virtual Device Type and Translator

2 Likes

As cool as uDTH is I don’t see how converting from a switch to presence would work differently vs. the virtual switch example when applying the logic to CoRE?

It’s not, was just a side note that he could use a better device than a switch that can be used anywhere in the ST universe…

1 Like

v0.1.10b.20160622 - Beta M1 - Reverse IFTTT support - IFTTT can now trigger pistons - coming up next: The IFTTT capability

JSON data (aka Body) is optional, can be left empty. If provided, data is available to the piston via variables having the respective names. If variables didn’t exist, they get created… :wink:

#documentation

5 Likes

The IFTTT capability is now up in v0.1.10c.

Use the Maker channel to send an external HTTPS request. The URL is https://[CoRE endpoint]/ifttt/[event name]

[CoRE endooint] is the same as your dashboard URL but up until and excluding the word “dashboard”.

[event name] is any of your choice, must be the same as the value entered for the IFTTT trigger in the piston’s IFTTT capability. //todo import event data into variables so CoRE can process Ask Alexa and IFTTT data on events…

6 Likes

Holy sweetness… I’ve been looking for this, time to get rid of about 30 virtual switches :grinning:

2 Likes

I’d like to understand better what this new IFTTT integration just added can do. Can you elaborate on what you have set up now, and the ways in which using this new IFTTT integration will make things cleaner? This would be useful for understanding some use cases.

1 Like

I am only going through the proper integration this weekend, but from what I can see from @ady624 previous post we can run pistons directly using IFTTT. For me an example use case is:

I have a few Android devices in key places setup to run SmartTiles, Lannouncer, Voice Automation (using alexa listens and ok google… can’t decide on a single one so using both), Tasker and a few other goodies. One of them, for example, is in my main foyer with a massive chandelier, and the chandelier is the only light source for the room. I use tasker to monitor room brightness using the lux sensor on the device and Tasker runs ifttt when it detects the light has dropped below a threshold. Right now ifttt triggers a virtual switch called low brightness, which then triggers the light. I can’t have the switch triggered directly since it will mess with a few other pistons and smart lighting setups. With the new integration, I can skip the virtual switch in between.

Another use is I also use the cameras on the device as a surveilence system, and when there is motion, they trigger another virtual switch through ifttt which runs a few pistons. I can make all of them run the pistons directly instead of using the virtual switches.

1 Like

How can I make a IF trigger based around a value that comes from an external service? For instance if I want to have an IF around the temperature or humidity reported for a certain area by the weather service? I was thinking maybe through IFTTT, but I don’t know if that’s the right way to go about it.

Let me know if you get going how much faster response you’d get from using maker and no man in the middle. Really interested if you get less lag. I have contact sensors and cameras and a bunch of other things updated by ifttt.

1 Like

So for IFTTT to trigger that, a service that connects to IFTTT needs to start the trigger. A basic example is:

If I want my light sensor on my android device to trigger a light in ST through IFTTT, the program called Tasker checks the value of the sensor and when that value falls within the preset threshold, the Tasker program runs the IFTTT trigger. At that point IFTTT checks’s what exactly triggered it and runs.

So using the triggers available in IFTTT’s weather channel (https://ifttt.com/weather) you should be able to run pistons. If the channel I linked doesn’t have a specific trigger you are looking for another one might. Worst case scenario you might have to use the IFTTT maker channel and figure out a DIY method.

I really hope I haven’t confused you, I am horrible at explanations. :confused:

Will do, I’ll post an update this weekend.

1 Like

Since all IFTTT is doing is calling the CoRE endpoint URL, is it possible to call the endpoint URL directly or is there an authentication between IFTTT and CoRE that I missed?

1 Like

So I just did a simple test of the IFTTT integration using the following scenario:

If every day at 7:45 PM, then make a web request

My piston was a Basic piston that was:

If IFTTT event “ifttt_test” was executed
Then send SMS notification

I received the SMS notification within seconds of the IFTTT recipe running.

So I would say the response time was pretty good.

4 Likes

So I just ran another test at a different time and I actually got the SMS notification from my piston before I got the IFTTT notification that the recipe ran.

2 Likes

Sweet, now I am really looking forward to using this. @ady624 once again thank you for the awesome work, countless hours and dedication to this. Your work is a large part of what makes ST smart and CoRE has just been plain and simply amazing. Without CoRE SmartThings honestly would jut be another Thing.

3 Likes

No authentication other than the endpoint url. Going to allow event data to be mapped to variables so that @HDGuy can read the temperature or humidity from IFTTT.

1 Like

oh, in that case I should be able to skip ifttt altogether. Just call the url directly from tasker!

Correct. Same URL as you would be using in the Maker action.

2 Likes