Flash Lights when Dog Pees in my yard


#1

1) Give a description of the problem
My analytics is sensing the motion and triggering the email correctly (I also have the option to use FTP), but I don’t know how WebCore can effectively consume it as a trigger. I have read a few things like sending it to [email protected] (the PISTON ID is too long for analytics engine) and even if I fwded it someone said this is not ready yet. I have also looked at IFTTT [email protected] which does work but I can’t do the light flashing. I then saw something about MAKER ID but then I got lost. Also see a virtual Device email function.

2) What is the expected behavior?
when my DVR sees motion and triggers an email, my front driveway lights need to flash blue and red and then restore to the previous state.

3) What is happening/not happening?
nothing, I don’t understand the email triggering options. They have to be pretty quick.


#2

As far as I know, emails cannot be used as a trigger.
(unless you use Android and Tasker to intercept, that is :sunglasses:)


Can your DVR make a web request? (such as HTTP GET)

If so, the DVR can send the External URL to directly execute a piston.


If the DVR cannot send that command, you could use IFTTT to catch the email… and then use IFTTT to run a piston, which can do the fancy light show. (although this method is much slower than the HTTP GET)


#3

I do have tasker ( i use it for Logitech Harmony automatons). Does that require my phone to be on and running tasker - or does it run in the cloud if my phone was off?

Lorex doesn’t support http get. They do support FTP. Maybe FTP servers support http get once a new file is posted. That might be faster. I’ll check.

In the mean time, I cant find examples of ifttt to run a piston. How would that work?


#4

Tasker would have to be installed on the Android, and the device would have to be on for Tasker to run.
(the screen can be off though, just not the device itself)

If your current phone is turned off frequently, you could re-purpose an old Android for this.


Example one

Example two


#5

What does the Email trigger in WebCore do? Is that the one that doesn’t actually work yet?

Anyways, instead of email I select ifttt as the execute trigger in WebCore and then is says to paste the URL in IFTTT maker channel? Does this look right? I create an ifttt applet to trigger on the email from my DVR and then use webhooks to action the get request using the maker URL WebCore gave me. Anything in Body? Since this is from ifttt to WebCore I don’t need to go through the ifttt integration in WebCore?



#6

I checked the WebCore logs. Looks like it ran/worked. Need to take a look in person and then check how slow it is.


#7

I’ve edited your post (and hidden the edit history) to hide your token and piston ID. Careful what you share online.


#8

I can confirm that this used to work during early beta testing of WebCore, but I haven’t had the need to use it in years and on testing it is no longer working.


#9

I can confirm that the ifttt trigger is working. Flashing hue lights with ST is hit or miss so I just changed the color to Red for 5 seconds and then restored previous settings. Now I will check to see if the grass has improved over the next few months.

Is it possible to change the name of the author? I miss-spelled it and it is bothering me.


#10

Nope… just create a duplicate piston and delete the old… but will require you to update the piston ID on IFTTT.


#11

I figured out how to make my DVR send a http get so I can bypass IFTTT completely and it appears to work. I like this better as there is no trigger (using External URL method). Does this look right? Any ways to make this better?

What is the difference btwn turn on and set switch on? I was having trouble with the bulbs restoring to previous state (but I was using turn on, now I use switch on). Need to test it a bit to see if it works.


#12

I’m glad you were able to send a HTTP GET
(which is likely the solution2 to this thread)

Personally, I like IFTTT, but always try to avoid using it due to the lag.


On the topic of capture and restore… That is an entirely different animal, with lots of posts spread throughout this forum on best practices etc. It is not as easy as one would think, and I would prefer not repeating myself here.

Generally speaking, color, colorTemp and HSL often conflict with each other.
Choose one of the three.


#13

after thinking about it more, I don’t think there is a reason to capture/restore anything but the switch position. During the day the lights are off and at sunset they turn on to 6500 colortemp using a ST Scene/Smart Automation.

New code:


#14

This will make your coding much easier.


#15

What’s the practical diff between turn on (device) and switch on (emulated).


#16

Short answer:
In most cases, (device) is more “direct” than (emulated).

IE: I would use Turn on (device)


#17

Well, it’s sunset here now and the lights are at 6500k level and white. So I took the dogs out to pee to see what happens and it did not change back to white because I need to capture and restore color too. Even worse, when it goes to red, the HUE app reports that the level is 50% (not sure why), so I need to capture color, level and switch position and then restore them.


#18

… alternatively, you could just force the color to go white after the red.


#19

Getting somewhere now. I capture Color Temp 6500K and switch position and that restores correctly now. But the dimmer stays at 50%. I need to figure out how to restore the dimmer to 100%. Can you even set the dimmer? Dimmer level is different than level/light in HSL.


#20

I capture level without using “capture attributes”…
Set intVariable to Device's level
… and restore using:
Set Device's level to intVariable

I have never been impressed with the built in capture / restore.


Or, you can just hard code it:
Set Device's level to 100