Motionsensor after sunset

Moderator: leecollings

Post Reply
jon205
Posts: 39
Joined: Monday 05 November 2018 16:17
Target OS: Linux
Domoticz version: 2022.2
Location: @home
Contact:

Motionsensor after sunset

Post 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?

Image

Jon.
Geitje
Posts: 170
Joined: Monday 22 January 2018 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Motionsensor after sunset

Post 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.
Domoticz beta, on Raspberry Pi 3B, Raspian Buster
Zwave, Zigate, RFlink etc.
jon205
Posts: 39
Joined: Monday 05 November 2018 16:17
Target OS: Linux
Domoticz version: 2022.2
Location: @home
Contact:

Re: Motionsensor after sunset

Post 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.
snellejellep
Posts: 241
Joined: Tuesday 16 May 2017 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: The Neterlands
Contact:

Re: Motionsensor after sunset

Post 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.
raspberry pi | xiaomi vacuum | yeelight | philips hue | zwave | ubiquiti unifi | harmony | sonoff | zigbee2mqtt | https://www.youtube.com/channel/UC2Zidl ... m1OLuNldfQ
jon205
Posts: 39
Joined: Monday 05 November 2018 16:17
Target OS: Linux
Domoticz version: 2022.2
Location: @home
Contact:

Re: Motionsensor after sunset

Post 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.
Last edited by jon205 on Monday 18 November 2019 22:06, edited 1 time in total.
Geitje
Posts: 170
Joined: Monday 22 January 2018 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Motionsensor after sunset

Post by Geitje »

I do not understand, time > sunrise would mean during daylight. Did you make a typo?
Domoticz beta, on Raspberry Pi 3B, Raspian Buster
Zwave, Zigate, RFlink etc.
jon205
Posts: 39
Joined: Monday 05 November 2018 16:17
Target OS: Linux
Domoticz version: 2022.2
Location: @home
Contact:

Re: Motionsensor after sunset

Post by jon205 »

You’re right. Thanks for pointing out my mistake. I’ve corrected it.

Jon.
jon205
Posts: 39
Joined: Monday 05 November 2018 16:17
Target OS: Linux
Domoticz version: 2022.2
Location: @home
Contact:

Re: Motionsensor after sunset

Post 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.
eleutscher
Posts: 22
Joined: Thursday 15 November 2018 11:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Motionsensor after sunset

Post 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.
Zigbee, KAKU, Hue, Google, Honeywell, MotionEye, Telegram, Tasmota, Shelly, IFTTT, etc
Geitje
Posts: 170
Joined: Monday 22 January 2018 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Motionsensor after sunset

Post 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.
Domoticz beta, on Raspberry Pi 3B, Raspian Buster
Zwave, Zigate, RFlink etc.
User avatar
Treve
Posts: 107
Joined: Thursday 05 November 2015 10:37
Target OS: Raspberry Pi / ODroid
Domoticz version: v4.11474
Location: Rotterdam, NL
Contact:

Re: Motionsensor after sunset

Post by Treve »

This will do the job.
Variabele will be 1 during dark.
testpir.jpg
testpir.jpg (36.51 KiB) Viewed 2054 times
- RFXtrx433E,
- AEON Labs ZW090 Z-Stick Gen5 EU
- Hue v2.1
- Raspberry Pi 3 Model B, Raspbian Stretch Full on USB-Stick.
- Domoticz 4.11474
Devices: KaKu, Z-Wave, Hue.

for testing:
Raspberry 4, 2GB, SSD
Domoticz 2022.1
Ikea Hub, Fyrtur curtain
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest