I was wondering if it is possible to use the sunset/sunrise with linknx to trigger some events? I think it is not yet implemented - but would it be possible to add it? How could this be done?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I already found 2 sunrise/sunset calculation algorithm that seems to work. I still have to choose which one is the best choice. I'll try to do it in the coming weeks, but cannot guarantee anything.
Regards,
Jean-François
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I finally was able to add the sunrise/sunset module. It's already checked in in CVS and will be officially released in next linknx release.
Here's a short description of how it works:
In <services> section of xml config, add something like:
<location lon="4.20" lat="50.54"/>
Then you can use something like this in a timer:
<condition type='timer' trigger='true'>
<at type='sunrise' wdays='12' offset="1200"/>
<until hour='23' min='58' wdays='12'/>
</condition>
In <at .../> or <until .../> elements, you can set "type" attribute to "sunrise" , "sunset" or "noon". Of course, using "hour" and "min" attributes is useless, but "day", "month" and "year" still works, even if in most case you will use "wdays" and/or "exception" instead. The "offset" is a number of seconds added to the computed sunrise/set time. (negative offset should be possible also)
The feature is not much tested yet, but basic functionality seems to work.
Regards,
Jean-François
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was wondering if it is possible to use the sunset/sunrise with linknx to trigger some events? I think it is not yet implemented - but would it be possible to add it? How could this be done?
I already found 2 sunrise/sunset calculation algorithm that seems to work. I still have to choose which one is the best choice. I'll try to do it in the coming weeks, but cannot guarantee anything.
Regards,
Jean-François
Yes, that would be really great. Looking forward for the results.
Some kind of scripting ability is a thing that would be great in any way. ;)
Hi,
I finally was able to add the sunrise/sunset module. It's already checked in in CVS and will be officially released in next linknx release.
Here's a short description of how it works:
In <services> section of xml config, add something like:
<location lon="4.20" lat="50.54"/>
Then you can use something like this in a timer:
<condition type='timer' trigger='true'>
<at type='sunrise' wdays='12' offset="1200"/>
<until hour='23' min='58' wdays='12'/>
</condition>
In <at .../> or <until .../> elements, you can set "type" attribute to "sunrise" , "sunset" or "noon". Of course, using "hour" and "min" attributes is useless, but "day", "month" and "year" still works, even if in most case you will use "wdays" and/or "exception" instead. The "offset" is a number of seconds added to the computed sunrise/set time. (negative offset should be possible also)
The feature is not much tested yet, but basic functionality seems to work.
Regards,
Jean-François