Question on Sunset/Light Example

Having problems? Maybe others have had the same problem too. Post HouseBot technical issues here.
Post Reply
dorrsr
Member
Posts: 9
Joined: Thu Jun 05, 2008 11:22 am

Question on Sunset/Light Example

Post by dorrsr »

I implemented the sunset light example you created a tutorial for. It works fine. I did notice one odd thing when I looked at the log today. The controller sent an "off" command to the light every second during the minute it was suppose to turn off. Interestingly other switches I control with a slightly different task only send the command once during that minute when I used the setting Time without seconds.

Here is the task code:
If ('System Time.TimeAndDate' is Equal to '7/24/2008 8:48:00pm') Then
Change 'LivingRoomLight.Power State' to 'On'
Else If('System Time. Time Without Seconds' is Equal to '12:15am') Then
Change 'LivingRoomLight.Power State' to 'Off'

The first time being actually the system variable for sunset. This is the only place I have used the else if. Not sure if mixing the .TimeAndDate and .Time Without Seconds in the same "if /else if" clause is what is causing the else if to be triggered 60 times or not.

Steve
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Re: Question on Sunset/Light Example

Post by ScottBot »

Good point. This is due to the fact that both the ON and OFF logic is combined in the same Task (I can explain it in more detail if you are interested). If you want to make sure it only turns off once, just put the 'Else if' portion of the Task in a separate Task (changing the Else If to just IF).
Scott
Post Reply