Entry Light Trigged by Doorbell Motion During Day


#1

Hi Guys,

I’m having an issue with this piston. I have my entry light turn on to 100% brightness if my ring doorbell detects motion during night. If the lights are already on, it sets them to 100%. If they are not on, the lights will turn on and set to 100%.

This should only happen if the time is between sunset and sunrise. However, every once in a while, the rule gets triggered during the day. For example, the other day around 8am, the light turned on based on the motion of the ring doorbell. If I look at the history for the entry light, I can see it was trigged by this rule.

I’m not sure what would cause this or why it would be sporadic?

4) Post a Green Snapshot of the pistonimage


#3

For the first two blocks, the check is if the switch is already on.

That switch is triggered by another rule that turns the switch on between sunset and sunrise.


#4

If the motion sensor is active right before sunrise, the light will stay on.
I don’t see any code to account for that.

You could add a safety net to turn off the lights at sunrise + 1 minute


I would also check the logs in that piston as well… That one might have hiccupped, causing the error in this one


#5

Heres an example of the rule triggering at 10:10 am and a few times after that.

What would cause it to trigger like this a few times when it doesn’t match the rule of being between sunset and sunrise?

3 days ago
2018-09-30 2:43:12.922 PM PDT DEVICE switch off Porch Lights switch is off
3 days ago
2018-09-30 2:43:12.920 PM PDT DEVICE level 0 Porch Lights level is 0
3 days ago
2018-09-30 2:01:25.934 PM PDT DEVICE switch on Porch Lights switch is on
3 days ago
2018-09-30 2:01:25.931 PM PDT DEVICE level 40 Porch Lights level is 40
3 days ago
2018-09-30 2:01:22.383 PM PDT APP_COMMAND setLevel Control Lights Based on Ring Doorbell Activity sent setLevel command to Porch Lights
3 days ago
2018-09-30 2:00:25.023 PM PDT DEVICE switch off Porch Lights switch is off
3 days ago
2018-09-30 2:00:25.021 PM PDT DEVICE level 0 Porch Lights level is 0
3 days ago
2018-09-30 2:00:22.857 PM PDT APP_COMMAND setLevel Control Lights Based on Ring Doorbell Activity sent setLevel command to Porch Lights
3 days ago
2018-09-30 1:27:09.523 PM PDT DEVICE switch on Porch Lights switch is on
3 days ago
2018-09-30 1:27:09.521 PM PDT DEVICE level 40 Porch Lights level is 40
3 days ago
2018-09-30 1:27:06.565 PM PDT APP_COMMAND setLevel Control Lights Based on Ring Doorbell Activity sent setLevel command to Porch Lights
3 days ago
2018-09-30 1:26:49.305 PM PDT DEVICE switch off Porch Lights switch is off
3 days ago
2018-09-30 1:26:49.300 PM PDT DEVICE level 0 Porch Lights level is 0
3 days ago
2018-09-30 1:26:09.638 PM PDT DEVICE level 100 Porch Lights level is 100
3 days ago
2018-09-30 1:26:06.674 PM PDT APP_COMMAND setLevel Control Lights Based on Ring Doorbell Activity sent setLevel command to Porch Lights
3 days ago
2018-09-30 1:26:04.640 PM PDT DEVICE switch on Porch Lights switch is on
3 days ago
2018-09-30 1:26:04.638 PM PDT DEVICE level 40 Porch Lights level is 40
3 days ago
2018-09-30 1:26:01.573 PM PDT APP_COMMAND setLevel Control Lights Based on Ring Doorbell Activity sent setLevel command to Porch Lights
3 days ago
2018-09-30 1:25:28.199 PM PDT DEVICE switch off Porch Lights switch is off
3 days ago
2018-09-30 1:25:28.196 PM PDT DEVICE level 0 Porch Lights level is 0
3 days ago
2018-09-30 1:25:04.806 PM PDT DEVICE level 100 Porch Lights level is 100
3 days ago
2018-09-30 1:25:01.848 PM PDT APP_COMMAND setLevel Control Lights Based on Ring Doorbell Activity sent setLevel command to Porch Lights
3 days ago
2018-09-30 11:46:54.366 AM PDT DEVICE level 40 Porch Lights level is 40
3 days ago
2018-09-30 11:46:51.334 AM PDT APP_COMMAND setLevel Control Lights Based on Ring Doorbell Activity sent setLevel command to Porch Lights
3 days ago
2018-09-30 11:45:55.206 AM PDT DEVICE level 100 Porch Lights level is 100
3 days ago
2018-09-30 11:45:51.844 AM PDT APP_COMMAND setLevel Control Lights Based on Ring Doorbell Activity sent setLevel command to Porch Lights
3 days ago
2018-09-30 10:11:43.221 AM PDT DEVICE switch on Porch Lights switch is on
3 days ago
2018-09-30 10:11:43.219 AM PDT DEVICE level 40 Porch Lights level is 40
3 days ago
2018-09-30 10:11:37.481 AM PDT APP_COMMAND setLevel Control Lights Based on Ring Doorbell Activity sent setLevel command to Porch Lights
3 days ago
2018-09-30 10:11:24.486 AM PDT DEVICE switch off Porch Lights switch is off
3 days ago
2018-09-30 10:11:24.483 AM PDT DEVICE level 0 Porch Lights level is 0
3 days ago
2018-09-30 10:10:40.906 AM PDT DEVICE level 100 Porch Lights level is 100
3 days ago
2018-09-30 10:10:37.864 AM PDT APP_COMMAND setLevel Control Lights Based on Ring Doorbell Activity sent setLevel command to Porch Lights
3 days ago

#6

Looks like the issue is someone (or something) turned on the lights during the day.


#7

The second half of the code has the porch light switch turning on it its currently off. So its this rule turning it on.

But part of the “if” statement is to only do that between sunset and sunrise. You can see it repeatedly turning the switch off and on during this time based on the motion activity.


#8

I just went thru your long log above, and each and every trigger is 100% following your code to the letter.

The only two areas that may confuse are:
(1) My previous post, where something DID turn on the light…
(2) At the very bottom (where the log cut off), the porch was turned off by some other means as well

If you want to cancel the 40% after a minute wait, you can add another check before the 40% command.
(to see if the bulb is still on)


It is also important to note that you do not have ANY turn off commands programmed to happen in the daytime. The only off commands are programmed to only happen at night.


#9

Just an idea for you… I normally program one block for if motion changes to active, and another block if motion stays inactive for X minutes. This would resolve your issue completely.

Such as:

IF Motion changes to active
and time is between X & Y
Then turn light to 100%
END IF

IF Motion stays inactive for 1 minute
and time is between X & Y
Then turn light to 40%
END IF

#10

Thanks. I think I’m going to re-design this one a little bit as you suggested to take care of this.

Appreciate the assistance looking through everything.


#11

I understand completely. Wait’s can be tricky to get right, especially if something has changed in the meantime. Notice my last post has no waits whatsoever, yet it effectively does what you want it to.