From: Kirk B. <ki...@ka...> - 2004-01-13 14:47:00
|
On Tue, 13 Jan 2004, James Armstrong wrote: > The example below is what I need (turning on the lights to different > levels). I downloaded the latest test release and was looking at the > comments which seem indepth. The problem I have is visually > understanding the edges and how to assign them. I understand the > property thing, it is just coordinances for the rooms. Does the edge > tell where the sensor is located? I just need a simple room / hallway > drawing that matches the example in the code showing the placement of > the sensors and marking the edges with numbers. I'll try to give a quick and clean example here of a hypothetical 2-bedroom apartment. Here is what the symbols mean: D: door sensor (i.e. an X10.com door/window switch) M: Motion detector /-----------------------\ /------------\ | | | M| | |----------------| Living | | M Hall M Room | | Bedroom1 | | |------ ------- | |M M| | | \---------- D ------ -/ |............| | | | | | | Closet | B | Bedroom2 | | |-----------| a | | | t | Kitchen | | h M| M| M| |-----|-----------------------------/ Now, in real life, you have to make sure that a motion detector in one room does not see into another room. If you have it pointed at a wall with a door it can often times see motion on the other side of the door. Also, the Living Room/Kitchen could be treated as one or two rooms... in this example I'll treat it as two rooms, but the motion detectors would have to be carefully placed for that to work well. The closet door is normally closed so a door switch works much better than a motion detector in the closet. So, once you have your floorplan and you know where all of the sensors are, you have to assign a number to each "edge". An edge is simply a point where two or more rooms meet that allows somebody to walk from one room to another... such as a doorway. In this case: 1: edge between closet and bedroom1 (i.e. the door) 2: edge between bedroom1 and hall 3: edge between bedroom1 and bath 4: edge between bedroom2 and bath 5: edge between bedroom2 and hall 6: edge between hall and living room 7: "edge" between the living room and kitchen For edge 7, there is no real edge, but I wanted to separate the two rooms, so you can imagine the edge being the dotted line in the illustration. So, you'll see that I have one number assigned to every doorway in the house plus one for the logical boundry between the living room and the kitchen. At least in my house, all edges only connect two rooms. So, now each room is defined by the edges it has: Closet: 1 Bedroom1: 1, 2, 3 Bedroom2: 4, 5 Bath: 3, 4 Hall: 2, 5, 6 Living Room: 6, 7 Kitchen: 7 Make sure that every room has a unique set of edges. Now, for each motion and door item, you just assign to it the edge list for the room in which it is located. $om->set_edges($om_closet_door, 1); $om->set_edges($om_bedroom1_motion1, 1, 2, 3); $om->set_edges($om_bedroom1_motion2, 1, 2, 3); $om->set_edges($om_bedroom2_motion, 4, 5); $om->set_edges($om_bath_motion, 3, 4); $om->set_edges($om_hall_motion1, 2, 5, 6); $om->set_edges($om_hall_motion2, 2, 5, 6); $om->set_edges($om_living_room_motion, 6, 7); $om->set_edges($om_kitchen_motion, 7); The key here is that if two motion detectors are in the same room, they need to have the exact same edges assigned. Doors were confusing to me at first. Because they ARE the edge and not really inside of a room. What you have to do is pretend that the door is in one room or the other. You should pick the room with less motion detector coverage and assign the door to that room. In this example, the closet has no motion detectors, and Bedroom1 has two motion detectors, so I placed the $om_closet_door sensor in the closet (by giving it only a node of 1). I hope that helps! -- Kirk Bauer <ki...@ka...> http://linux.kaybee.org | www.autorpm.org | www.logwatch.org |