Page 1 of 1
Motionsensor after sunset
Posted: Monday 18 November 2019 20:15
by jon205
I've been trying to trigger a light at the frontdoor. The motiondetector 'Bewegingsmelder voordeur' does detect motion and switches 'on'. But the light isn't switched on. First I had an extra 'if else' rule stating that if <sunset and >sunrise 'lamp voordeur' is off. This didn't help. I'm lost now. I do not see my fault. Any suggestions?
Jon.
Re: Motionsensor after sunset
Posted: Monday 18 November 2019 20:38
by Geitje
Your blocky looks OK. Is your log showing the event is triggered?
What happens if you remove the sunset/sunrise stuff?
Just check the "trigger selection" (should be set to "device" or "all"), check if event system is enabled.
Re: Motionsensor after sunset
Posted: Monday 18 November 2019 21:04
by jon205
When I remove the sunset/sunrise stuff, the event is triggered and the lamp switches on. So I think I've made a mistake in defining the time variable.
Jon.
Re: Motionsensor after sunset
Posted: Monday 18 November 2019 21:09
by snellejellep
the blockly does not work because the time block does not work like that. i tried making it myself but the only way to make it work for me was the following:
create a dummy switch and enable timers on that dummy switch to turn it on at sunset and turn it off at sunrise, then use that state in a blockly instead of the time component. that should work.
Re: Motionsensor after sunset
Posted: Monday 18 November 2019 21:13
by jon205
I've done a bit more extensive searching.
'Time > Sunset and Time < Sunrise'
should be
'Time > Sunset or Time < Sunrise'
Makes sense, but never thought about it... First test worked. Just have to wait till after sunrise to see if the light stays off.
Jon.
Re: Motionsensor after sunset
Posted: Monday 18 November 2019 21:27
by Geitje
I do not understand, time > sunrise would mean during daylight. Did you make a typo?
Re: Motionsensor after sunset
Posted: Monday 18 November 2019 22:07
by jon205
You’re right. Thanks for pointing out my mistake. I’ve corrected it.
Jon.
Re: Motionsensor after sunset
Posted: Tuesday 19 November 2019 17:17
by jon205
Turned out that 'Time > Sunset or Time < Sunrise' didn't do the trick. The lamp would go on no matter day or night. I've let go of the sunset/sunrise and let the lightsensor inside the motionsensor decide if it's dark enough.
Jon.
Re: Motionsensor after sunset
Posted: Tuesday 19 November 2019 17:48
by eleutscher
Create an virtual device with an timer. For example, On 1 minute after sunset en Off, 1 minute after sunrise. Use this device in your blocky.
Re: Motionsensor after sunset
Posted: Tuesday 19 November 2019 18:33
by Geitje
Could this be a bug? I had this same issue some time ago, solved it the way eleutscher did, however I find this the less elegant solution.
jon205 wrote: Tuesday 19 November 2019 17:17
Turned out that 'Time > Sunset or Time < Sunrise' didn't do the trick. The lamp would go on no matter day or night. I've let go of the sunset/sunrise and let the lightsensor inside the motionsensor decide if it's dark enough.
Jon.
Re: Motionsensor after sunset
Posted: Tuesday 19 November 2019 20:54
by Treve
This will do the job.
Variabele will be 1 during dark.

- testpir.jpg (36.51 KiB) Viewed 2049 times