Housebot forum search not working?

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
AndyK
Member
Posts: 26
Joined: Sun Jun 27, 2004 4:44 am

Housebot forum search not working?

Post by AndyK »

I think there may be a problem with the forum search. I was looking for a post I remember reading on the old HouseBot forum regarding an anomaly with sunrise/sunset times. A search for "sunrise" only brought up a post related to myHTPC .... despite there being a post in the new HouseBot area with "Sunrise" in both the subject and the text.



I'll have to ask the question again. Is there some way to have HouseBot reliably return the sunset and sunrise times?. I find that if I test for sunset or sunrise times I never quite get what I expect. I can use a rather long-winded method of adding or subtracting a day to the sunrise and sunset times to produce a "next" and "last" sunrise and sunset.



I want to use a task to set a user defined boolean to "true" if the current time is between sunset and sunrise ... that is, a task along the lines of:

if current time > sunset AND current time < sunrise then IsNight = true.



Any clues or any possibilities of having a next and last sunset and sunrise in a future version? ... perhaps a value that changes as the rise or set event is passed.
Andy
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Re: Housebot forum search not working?

Post by ScottBot »

Andy,



Thanks for pointing out the search problem. I just searched for HouseBot and only got one page of results (which were mostly the last few days).


AndyK wrote:Is there some way to have HouseBot reliably return the sunset and sunrise times?.
You can reference System Time.Sunrise Time or System Time.Sunset Time to get the current values.
AndyK wrote:I want to use a task to set a user defined boolean to "true" if the current time is between sunset and sunrise ... that is, a task along the lines of:
if current time > sunset AND current time < sunrise then IsNight = true.
Acutally, this is already done by the System Time Device (since it's a pretty common thing to need). Instead of setting your own IsNight variable, you can simply test the existing System Time.Sun Rise Indicator Property Value. If it == 1, then its day, if it == 0, it's night.
Scott
acheslow
Senior Member
Posts: 168
Joined: Wed Aug 20, 2003 3:23 pm
Location: Bothell, WA
Contact:

Post by acheslow »

The database needs to be re-indexed since merging in the original HouseBot forums. This is a big task and I'm waiting for our server to be upgraded. I apologize for the inconvenience in the meantime.
AndyK
Member
Posts: 26
Joined: Sun Jun 27, 2004 4:44 am

Post by AndyK »

Thanks for the reply Scott. I understand about the System Time.Sun Rise Indicator property and I should probably have explained things a bit better. I was just trying to keep things simple for the sake of clarity.



Rather than the period between actual sunset and sunrise I'm really after the period between twilights. That is, somewhat after sunset until somewhat before sunrise. I'm trying to approximate the end of Civil Twilight in the evening and the start of Civil Twilight in the morning ... to derive the period outside useable daylight ... when it is actually dark enough to enable some sensor activated lamps.



I have used SUNSET_DATE_AND_TIME + Days=0, Hours=00, Minutes=20, Seconds=00 to derive a time 20 minutes after sunset and a similar thing to derive a time 20 minutes before sunrise. Also, I have used > and < to get a period rather using = to get a spot time. If for some reason a spot time is missed the event never fires. Using > or < start or end of twilight allows actions to fire (lights turn on etc.) if HouseBot is restarted during the "dark" period. The "IsDark" boolean is checked in the task. If already set then no action is taken ... to prevent looping.



The problem is that the sunset and sunrise times don't seem to roll over in the way I would expect.



Don't worry too much about it at this stage as I'm fairly sure I read a post in the old forum that was relevant to this. I'll find it and re-read it as soon as the forum search function is up and running again.
Andy
AndyK
Member
Posts: 26
Joined: Sun Jun 27, 2004 4:44 am

Post by AndyK »

... further to my previous post, I got to thinking that it would be nice to have HouseBot provide the start and end of Civil Twilight in much the same way as it provides sunrise and sunset. This may be a lot more useful in practical terms for turning lights on and off.



Anyone living near the equator experiences quite short twilight times ... it gets dark quite close to actual sunset. For those living further north or south, twilight can last a long time. For example, in the UK twilight can last for well over an hour ... there is more than enough useable light for a long time after the sun sets and turning a light on at actual sunset is wasteful. The same applies for sunrise ... it can get light enough to not require lights well before actual sunrise.



Civil twilight is defined as the time when the centre of the sun is 6 degrees below the horizon ... and is quite easy to build into the sunset/sunrise calculation. So, if you're looking for some nice enhancements for the commercial version .... :)
Andy
Post Reply