Previous Level

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
ericvic
Senior Member
Posts: 144
Joined: Thu Feb 26, 2004 11:06 am
Location: Irondale, AL
Contact:

Previous Level

Post by ericvic »

I would like to find out how others have solved this problem. Let's say I want to create a task that will turn off some lights when I want to watch a movie and then another task for when the movie is done to restore the lights to the state they were in before. For instance if it is the middle of the day the lights are probably not on anyway and I don't want the end of movie task to turn the lights on.

Is there an easy solution to this?

Thanks,
Eric
Hobby Boards
Complete 1-Wire solutions
http://www.hobby-boards.com
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

You could create NULL Device properties which are used as flags. So if your lights are turned off to watch a movie, that same task could set a flag. Another task that turn the lights back on again after the movie could check the flag first to see if it really needs to be done.
You could also simply use the Sunset value. That is what I use. So when I watch a movie, the lights are always turned off. If they were already off, nothing would happen anyway. If the movie stops and current time > sunset, then my lights will be turned on.
Last edited by Richard Naninck on Sun Oct 01, 2006 9:55 am, edited 1 time in total.
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

You could also just add a condition to the task to test if System Time.Sunrise Indicator == 0.
Scott
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

Actually that is what I meant to say. I don't check the time > sunset, I just check if the sunrise indicator = 0.
Thnx
Attachments
Task.jpg
Task.jpg (48.07 KiB) Viewed 2489 times
ericvic
Senior Member
Posts: 144
Joined: Thu Feb 26, 2004 11:06 am
Location: Irondale, AL
Contact:

Post by ericvic »

For me this question goes deeper than the example I used. It could be usefule to know the last state of a property so that it could be restored after a task changed it. I have a task that run the fan on my HVAC unit for 15 minutes every 3 hours and it works fine but if someone manually turn the fan on then my task will turn it off after the next time it runs the fan even though it should have stayed on. I can think of other examples where you have motion detectors to turn on lights, you would not want them to go off if you had manually turned on the light.

Just trying to come up with a generic way to keep up with a previous state.

Eric
Hobby Boards
Complete 1-Wire solutions
http://www.hobby-boards.com
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

As far as I am concerned, you can only do that if you have status of everything yo do. So turning on the light manually, should give you a status. X10 and many others can do that. Pressing the outlet switch also produces a status update on the net which HB will receive. The same could go for your Fan switch. If you don't have the means to get status from manual switching, you will not be able to track it!
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Originally I had some ideas about begin able to reference data from the Property Value history so you could test for things like that in Tasks and Scripts. I've never implemented anything because I wasn't sure how that would work/look in the Task language. It's easy enough to add a script function for GetPreviousValue( Device.Value, nValuesBack ) and GetPreviousValueTime(...), but there was never really a demand for such functionality.
Scott
ericvic
Senior Member
Posts: 144
Joined: Thu Feb 26, 2004 11:06 am
Location: Irondale, AL
Contact:

Post by ericvic »

Richard,

I don't/won't use any devices that HB won't know the status of. If HB can't detect a local change then I will make sure that HB is the only thing that can control that device.

Scott,

I haven't thought through exactly how I would use previous values but your couple of script functions sound like they would be useful.

Eric
Hobby Boards
Complete 1-Wire solutions
http://www.hobby-boards.com
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

If you have status from everything, you just need to put a manual/automatic property controllable by a theme button in your system. I have that for my heating system. On automatic it switches automatically off when the alarm is armed and on manual, I can control the system according the current temperature.
So in your case when a switch is flipped to turn on the fan your HB system will know that and must flip the property to manual. When this property is in manual, the task that handles the automatic part won't work until it is restored in automatic. Then you can manually set it back to automatic using the theme button or think of a hundred other ways to get it back to auto. Let's say after a certain (extra) time, or the current alarm state or sunrise or...
You can even put an extra layer on top of this button and call it your vacation mode. Whenever the vacation mode is on, none of the automatic tasks will perform its duties. You could set vacation mode to on at a certain alarm state (ELK M1 can do that) or do it again using a theme button.
In my system that vacation button stops controlling automatic lights because I don't want the lights to switch when my parents feed the cats, automatic email retrievement is stopped (why bother my provider when I am not home), automatic heating is stopped no matter what setting the automatic/manual switch is in and my doorbell script stops doing certain stuff.

Well, actually the only thing I want to say here is that when you have all the status, it is just up to your imagination how you control stuff. And actually I believe that is your question. That's all for me...
yaccri
HouseBot Special Member
Posts: 304
Joined: Wed May 07, 2003 2:19 pm
Location: Tel-Aviv, Israel
Contact:

Post by yaccri »

...but there was never really a demand for such functionality
It would be VERY useful to have an 'undo' operation or something similar.
Post Reply