trigger before / after sunset
Moderator: RDNZL
trigger before / after sunset
after reading the domotiga site i stil didn't understand how to switch on a device for example 10 minutes before / after sunset. Is there anyone else who uses this and can explaint how tot do it?
Re: trigger before / after sunset
I'm using an event which runs after sunset
For this I use an event that's triggered when the variable "dark" is set to "True".
To prevent continues triggering I use a condition "don't run event if event already ran in last x hours"
In the trigger list I added an action which waits the required time. Therafter the final trigger (device on/off) runs.
A quick and dirty solution for an event prior sunset could be using a "waiting" trigger of a little less than 24 hours. Im convinced sombody else knows a smarter solution...
For this I use an event that's triggered when the variable "dark" is set to "True".
To prevent continues triggering I use a condition "don't run event if event already ran in last x hours"
In the trigger list I added an action which waits the required time. Therafter the final trigger (device on/off) runs.
A quick and dirty solution for an event prior sunset could be using a "waiting" trigger of a little less than 24 hours. Im convinced sombody else knows a smarter solution...
-
- Starting Member
- Posts: 12
- Joined: Mon Nov 28, 2011 12:17 pm
Re: trigger before / after sunset
Good question!
I would like to know the answer too.....
Can u make an event or trigger thats says
"10 min before dark" ?
I would like to know the answer too.....
Can u make an event or trigger thats says
"10 min before dark" ?
Re: trigger before / after sunset
You would need a time machine for that 

- RDNZL
- Forum Moderator
- Posts: 1008
- Joined: Sun Sep 24, 2006 1:45 pm
- Location: Dordrecht, The Netherlands
- Contact:
Re: trigger before / after sunset
Funny enough this is one of the few topics described in the 'manual', so RTFM 
http://domotiga.nl/projects/domotiga/wiki/User_Manual
It describes how to:
Create a trigger for every minute.
Create a condition which is true for a given time before or after sunset/sunrise.
Var_Sunset is calculated every day, so a compare against it (which is what the = does) is True if condition is met.
There is an issue with SunSet and SunRise is not correct when Daylight Saving Time is active, will add a workaround for that soon.
Until then just add or subtract the extra hour difference.

http://domotiga.nl/projects/domotiga/wiki/User_Manual
It describes how to:
Create a trigger for every minute.
Create a condition which is true for a given time before or after sunset/sunrise.
Var_Sunset is calculated every day, so a compare against it (which is what the = does) is True if condition is met.
There is an issue with SunSet and SunRise is not correct when Daylight Saving Time is active, will add a workaround for that soon.
Until then just add or subtract the extra hour difference.
Regards, Ron.
Re: trigger before / after sunset
Thank you for the extra info!
I did RTFM but it's a bit to technical. I'll try with the above text and the manual to make it work. I'm just an end user so don't blaim me for not understanding.
I did RTFM but it's a bit to technical. I'll try with the above text and the manual to make it work. I'm just an end user so don't blaim me for not understanding.
- RDNZL
- Forum Moderator
- Posts: 1008
- Joined: Sun Sep 24, 2006 1:45 pm
- Location: Dordrecht, The Netherlands
- Contact:
Re: trigger before / after sunset
I don't blaim you, hence the smiley.
If you figured it out and have better instructions i'd be happy to put them in the manual.
If you figured it out and have better instructions i'd be happy to put them in the manual.
Regards, Ron.
Re: trigger before / after sunset
Hi all, after a reinstall because of some errors and a lack of time I had to redo this trigger and needed an our to fix it. so for me the next time a little something to remember and maybe help someone else.
First u need to create a trigger that triggers every minute of the hour.
Events -> Add trigger and fill in:
Minute <> 61
Now u need to create a condition.
Events -> Add condition and fill in for example:
Var_Sunset = Format(hour(Now()),"0#") & ":" & Format(minute(Now()),"0#")
Now u can make an event.
Events -> Add event and select the previous made trigger and condition. Now all u need is an action and your event is ready.
First u need to create a trigger that triggers every minute of the hour.
Events -> Add trigger and fill in:
Minute <> 61
Now u need to create a condition.
Events -> Add condition and fill in for example:
Var_Sunset = Format(hour(Now()),"0#") & ":" & Format(minute(Now()),"0#")
Now u can make an event.
Events -> Add event and select the previous made trigger and condition. Now all u need is an action and your event is ready.
- RDNZL
- Forum Moderator
- Posts: 1008
- Joined: Sun Sep 24, 2006 1:45 pm
- Location: Dordrecht, The Netherlands
- Contact:
Re: trigger before / after sunset
You can login to domotiga.nl and complete the 'user manual' here http://domotiga.nl/projects/domotiga/wiki/User_Manual 

Regards, Ron.
Re: trigger before / after sunset
Hihi, didn't know that. Will do that.