-
Notifications
You must be signed in to change notification settings - Fork 130
Modes
This page describes how to get started using the MisterHouse Modes controls. One of the things I wanted to be able to do is have MisterHouse turn lights on and off while I was away from home. I saw the mode page, but had no idea how to get started. After some digging, and lots of code errors, I finally got it working.
Eventually, I think it would be interesting to create some more modes, or perhaps "moods" to provide scene control for different occasions.
A mode is nothing more than a Generic Item that you create in your user code. To create a mode that e.g. allows you to override the controlling of the lights of your xmas tree, add the following user code:
$mode_xmastree = new Generic_Item;
$mode_xmastree->set_states('on', 'off');
If you want to be able to control a mode through the web interface, the recommended way of working is documented here.
Lots of words are nice (well, they would be if I took the time to write them), but sometimes it's easier to just look at some samples.
- http://misterhouse.wikispaces.com/space/showimage/occupied_mode_demo.pl - This sample is a simple demo that toggles some lights on and off as you scroll through the different Occupied modes. I added comments that describe what it does.
The use of Generic_Items to create different modes is an easy way to have control of larger events or scripts from a simple, GUI friendly environment. By toggling the icons you can trigger any number of events.
Here's just a few examples:
- HVAC simply disables my furnace. HVAC mode is off when house is armed as you don't need to heat an empty house. The pipes won't burst in California so this isn't a solution for everyone.
- The water mode follows the sprinkler schedule based on the temperature from the previous day. This makes it easy if we want to disable it temporally. Rain8 module controls 4 zones and waters at 5AM
- Cat mode: Training cat to stay off the table while we're not home, with the help of a motion sensor and a blender. Sometimes they get a day off.
- I like to disable the Audreys sometimes if my code is looking to send sound or a light command and it can't find the audrey. This prevents hanging of Mr. H until I can find the problem.
- I like to disable the chat option from work. "Yes, I know the cat is on the counter. Stop with the instant messages"