Is it possible to activate/deactivate a Simulated Motion Sensor via webhook, or IFTTT?


#1

Is it possible to activate/deactivate a Simulated Motion Sensor via webhook, or IFTTT?

I know Switches and Locks can be, but can’t figure out a way to do motion


(Ernie) #2

Ifttt can send a Webhook to Webcore, which can set the simulated motion sensor to active or inactive.


(Brian Diehl) #3

As @ErnieG said, you can use a webhook with WebCoRE.

You can use IFTTT by creating a virtual switch and then using whatever logic machine you have (WebCoRE or whatever) to say that simulated motion sensor is only active if that virtual switch is ON. Use IFTTT to turn that virtual switch OFF when you want to deactivate.

Options are always nice.


#4

yeah, i got that part figured out now, I just can’t get webcore’s link to be triggerd by IFTTT.

I have an

If 
  IFTTT executes 'blarg'
then
  with 
    Simulated sensor
  do
    active();

but I’m not sure how to get IFTTT to interact with the URL webcore generates. I’ve tried all options with GET, PUTS, and POSTS. even manually running the URL doesn’t get the motion sensor to activate.


(Dan) #5

It would be simpler to have IFTTT act directly upon a virtual switch (i.e. on and off). Your Virtual Switch would be a custom DTH that interprets ON as motion ‘active’ and OFF as motion ‘inactive’ providing the necessary event updates for its Motion Capability.

So, just a simple DTH that has both Switch and Motion Detector Capabilities. The Switch Capability is exposed to IFTTT via normal ST to IFTTT integration. Whenever an on() command is called by IFTTT, you would just perform a sendEvent(name: “motion”, value: “active”) call, and vice-versa for off().


(Ernie) #6

I use POST as the method and the content type is application/json. Make sure you authorized Ifttt as a service in WebCore.


#7

yes, i have IFTTT as an integration in WebCore, just nothing seems to happen when the URL is hit.

edit: so if i hit the URL provided by webcore manually in a browser it works, but if its the “that” webhook on ifttt it doesn’t work.


(Ernie) #8

Any errors in Ifttt sending the webhook?


#9

If I i run the IFTTT URL it triggers the IFTTT alert. I see absolutely nothing in Live Logging on Smartthings IDE, as in NOTHING… Logging used to work fine… I am on the correct shard, not sure…


(Ernie) #10

You should contact ST support about the logging issue.
Do you see any activity in the Pistons log?


#11

it looks like logging is magically working now… but no event when i hit the URL to trigger IFTTT, but it works fine if i hit the URL to trigger the piston


(Ernie) #12

Maybe if you post a picture of your Ifttt applet and your Piston we can see if everything is setup properly. Also, make sure the entire url was pasted into Ifttt.


#13

Screenshot%20from%202018-03-19%2012-05-51


(Ernie) #14

If you have the method as Post and content type as application/json, I can’t see any errors. Not sure what else to try.


#15

What is your IFTTT trigger, the piston?


#16

the trigger is motion detection by motioneye calling the webhook of IFTTT


(Ernie) #17

Maybe test a different trigger?
What you have setup should work. I do something similar with Blink cameras and it works well.


#18

i tried a WebCore piston without an if statement, just the do to smartthings simulated sensor and it worked.


(Ernie) #19

How about trying something other than the motioneye to test the applet.


#20

This is the end of your web call…

image

This is the end part of my web call…

image

Seems you’re missing the part that WC is waiting for… fromWeb in my case.