Fun With Webservers

IVB

Senior Member
Well, given that:
1) The 2.0 PDA Viewer isn't done yet
2) The wife has a treo 650 with no dataplan and no ability to put the CQC DNV on it as it's a palm-OS

I decided to go ahead and use that webserver license I got as part of the "full CQC package" deal.

Yes Virginia, this is an ugly webpage. But, before spending excessive time coding it to be pretty (given that I don't know HTML), I opted to just do a raw dump of all the relevant HA type status info onto a webpage.

I can access this from the internet by going to http://ivbhouse.not-telling-you.net:12345/house_status.html from any PC or internet phone. That gets rerouted from my dyndns.com free hosting account to my house. I can't actually control anything over the 'net, that requires learning CML. I'm not willing to do that given the PDA Viewer will be out within a few weeks.

I won't post a screenshot here as it's 20" high, but you can see most of it on this page here

Here's what the code looks like. Pretty dang simple. I won't show you the beginning security stuff, as i'm a paranoid guy, but here's some of the latter stuff. basically just put $(device.field) whereever you want the info to do. I used notepad to write the HTML, so i'm really no guru.

Code:
<big><b><u>Lighting Status:</b></u><br></big>
Entry: $(sample-zwave-ACT.Entry)<br>
InHouseEntry: $(sample-zwave-ACT.InHouseEntry)<br>
Living Room: $(sample-zwave-ACT.LivRm)<br>
Kitchen: $(sample-zwave-ACT.Kitchen)<br>
MBRCloset: $(sample-zwave-ACT.MBRCloset)<br>
DinRmPendant: $(sample-zwave-ACT.DinRmPendant)<br>
KBR: $(sample-zwave-ACT.KBR)<br>
Hallway: $(sample-zwave-ACT.Hallway)<br>
KBath: $(sample-zwave-ACT.KBath)<br>
DinRmSpot: $(sample-zwave-ACT.DinRmSpot)<br>
BRNook: $(sample-zwave-ACT.BRNook)<br>
<br>
<br>
<big><b><u>HVAC</b></u><br></big>
The Thermostat is: $(sample-aprilaire.T1Mode)<br>
Current Temperature in Dining room is: $(sample-aprilaire.T1CurTemp)<br>
The SetPoint is $(sample-aprilaire.T1SPHeat)<br>
<br>
Temperature in other parts of the house is:<br>
Outside: $(sample-elk.Probe15)<br>
MBR: $(sample-elk.Probe09)<br>
Attic: $(sample-elk.Probe10)<br>
Inside Entry: $(sample-elk.Keypad02)<br>
Media Closet: $(sample-elk.Keypad01)<br>

<br>
<big><b><u>Audio Status:</b></u><br></big>
FamilyRoom Xantech is: $(sample-xantech.Z1Power)<br>
FamilyRoom Denon is: $(sample-denon-3805.MZPower)<br>
BRN/Kitchen/KBath is: $(sample-xantech.Z2Power)<br>
Livrm/DinRm is: $(sample-xantech.Z3Power)<br>
KBR is: $(sample-xantech.Z5Power)<br>
MBR is: $(sample-xantech.Z6Power)<br>
<br>
<br>
</body></html>
 
Well, i've gone from a "yeah, that webserver thing is cute, not really that necessary" to "I must use that and use it more" in a matter of 1 week, and the wife in a matter of 1 hr. Much more so for the value of PDA control.

We're on vacation now, and I've been using the above page to keep tabs on the house and housesitter. Wife thinks it's very nice to be able to monitor said things, esp given how crime has been on the rise given the holiday season.

Well, we just got a call from NextAlarm saying that the alarm was tripped, they tried contacting the premises, no one picked up, so they dispatched the police. I happened to be on a work call in the hotel room at the time (don't they know i'm on vacation), so I quickly hung up, pulled up the CCTV's on the PDA. Didn't see anything, decided to pull up CQC. Regardless of the 2.0 CQC DotNetViewer not yet being released, I can't actually put CQC on my work laptop. But I could quickly pull up that page, boy does it load fast.

I scanned through the security system, checked out the doors and interior with the CCTV. All looked fine. But that's still not all - I just got HUGE mileage out of the 10 motion sensors and that "recent activity" logic I coded in ElkRP where it'll tell CQC if there's been any motion in any room in the last <x> minutes. Scanned through it, realized there was only one zone reporting recent activity, pulled that up on the CCTV, realized it was fine, must have been some funky false alarm. I'll check out the ElkRP log when I get back to make sure the Elk threw a false alarm, and it wasn't a communications or NextAlarm problem. Apparently there was an earthquake a few hours ago, so that may have thrown some wiring or other electronics akilter.

Anyhow, count the wife (& me) in as one of the "webserver rocks" converted, she actually had me add the bookmark for the above page in her Treo 650P. Both of us were already "PDA access is key" folks, now much more so (although admittedly, today's activity was all about the CCTV PDA access).

She cannot put CQC on her PalmOS PDA, nor the CCTV PDA software. Hence, she's stuck with webserver access. However, she's now contemplating getting the same phone as me so she can pull up the CCTV if I'm unavailable. Hmmm, maybe i'll get the new Cingular 8525 and she can have my 5 month old 8125.

We wouldn't have been able to actually do anything had we verified the existence of the bad guys. Honestly, I would have deferred that to the cops anyhow - this just gave us peace of mind that the house is actually fine within the matter of a few minutes, as opposed to the 1-3 hours it would have taken for a relative or the house sitter to finally make it there. (oh, plus avoiding the $250 charge for a false alarm if we weren't able to succesfully cancel). That is priceless.
 
Thats pretty slick... The ability to see what is going on in my house over the web and on a PDA is the thing that sold my wife on HA in the first place!

Chris
 
well, when you're ready to go let me know and i'll walk you through the setup on one of the webexes. Not that bad by any stretch of the imagination.
 
I'm interested in the "recent activity" logic you added to Elk so it would tell CGC to record it in a log. How did you do that?
 
Didn't record it in a log. It's an Elk rule that says something like:

Code:
WHENEVER MBR Motion (Zn 43) BECOMES NOT SECURE
   THEN TURN Output 200 ON FOR 5 MINS, RESTART TIMER IF RUNNING

All I do is dump output200 on that webpage. Easy peasy.

However, given yesterday's activity, the wife would also like to know if the zone has been tripped since we armed the house. I'm going to use CQC and the variables driver to create a new set of fields, one for each motion/door/window sensor, and record if anything has happened. Perhaps the time it happened too, haven't really mapped out rqmts yet.
 
If you're going to be a big man and use a software based controller for primary automation duties, I've got 2 words for you: Battery Backup.

A few hours after the prior post, there was a power outage in my house. Unfortunately, I didn't have a battery backup and the machines require someone to press the button in order to turn on. I haven't been able to access my house servers for >1wk now since I wasn't home. We just got home and checked, sure enough, both the HA server and the CCTV server were off.

I'll be buying 2 battery backup UPS's tomorrow to correct that defiency...
 
IVB said:
Unfortunately, I didn't have a battery backup and the machines require someone to press the button in order to turn on. I haven't been able to access my house servers for >1wk now since I wasn't home. We just got home and checked, sure enough, both the HA server and the CCTV server were off.
A UPS will help protect your systems, but to truly solve the problem you need to get the computers configured to boot up when power is applied. Usually this can be done with BIOS settings, but it may take a hack with an Elk relay across the power button or something.
 
Or just bite the bullet and move your primary automation stuff into the Elk. It already comes on after a power outage and has battery backup. But if you stay your current route, Wayne is correct - at some point the batteries will drain and you'll be in the same boat.
 
WayneW said:
IVB said:
Unfortunately, I didn't have a battery backup and the machines require someone to press the button in order to turn on. I haven't been able to access my house servers for >1wk now since I wasn't home. We just got home and checked, sure enough, both the HA server and the CCTV server were off.
A UPS will help protect your systems, but to truly solve the problem you need to get the computers configured to boot up when power is applied. Usually this can be done with BIOS settings, but it may take a hack with an Elk relay across the power button or something.
Interesting idea with the relay across the power leads - does the Elk know if 1)power went off, and then 2)power went on? I didn't realize that.
 
IVB said:
Interesting idea with the relay across the power leads - does the Elk know if 1)power went off, and then 2)power went on? I didn't realize that.
The Elk knows when AC power has failed as it eventually set off a power fail trouble signal. But I don't think it is anywhere near instantaneous as minor glitches are irrelevant from a security perspective unless your M1 battery is dead. For instantaneous Elk awareness use a relay with a 110VAC coil to the powerline and the relay contacts to an Elk zone input. Then you can write rules to do whatever you want. But you may be able to write rules using the existing power fail trouble if the timing is acceptable. If power has been off long enough that the UPS battery is dead, some would say that you don't want the computer to boot instantly as it would be running without any UPS protection until the UPS has a chance to recharge. Smart UPSes can be configured to delay bootup until X% battery capacity is achieved to give time for another proper shutdown.
 
If you're that dependant on the PC-based control you may want to code "watchdog" rules to make sure it is operating.

On the PC have it turn on a "dummy" light every 30 seconds for a duration of 65 seconds - make sure the Elk is handling the 65 seconds and not the PC.

On the Elk code a rule that if the light ever turns off then send a message/beep to the keypads and possible expand this into the reset/power discussion above.

The overlapped time is to make sure a single glitch doesn't set off alarms.
 
A friend of mine made me a small circuit that I put in parallel to my PC power switches. I can turn on/off my PCs with the switch, or from a relay on my HVPro. Also, the HVPro knows the status of my PC power because of it.

Awesome little mod for a server PC. I can ask him if it's home built or a kit... didn't look too hard to make though.
 
I was thinking about doing something like this. I currently have a 120 volt coil relay plugged into regular house power and it's being monitored by my Ocelot via an SECU16I module. HomeSeer monitors this as a device as well.

I have my HS machine and my Ocelot and other hardware (including network router/modem) on UPS units. When the power to the house goes out, I have HomeSeer send a message to my cell phone, work Email, and pager. It will also notify me when it's turned back on. If I don't get a "back on" message I know the UPS batteries are dead or the power is still off in the house.

I want to connect an X-10 Telephone Responder (got one for twelve bucks off of EBay) to the same outlet that my Ocelot's TWA-523 is on. I also want to connect a relay output of a RLYX8 Ocelot expansion module to the "Power Button" inputs on my HomeSeer computer's motherboard. So then I can just call my house and "send" a closure to the power input of my HomeSeer computer. The Ocelot will insure that the contacts are closed for just one second.

If the power isn't on the house yet, it's just a waisted command. Granted this is a manual method so it does have some drawbacks.

BTW, I was also thinking about using a 12 volt coiled relay and have it connected to my HomeSeer computer's power supply and have the contacts monitored by my Ocelot. Then when my Ocelot powers on it could look at that status and maybe send that "on" command by itself. Thoughts?

It's easy to have/monitor contact closures when a computer is on, especially with some Antec power supplies. They have a "four pin" power connection on the back (outside) face of the unit!

I do currently use a relay activated by a pc like this in my wife's kitchen machine which is kept in a pantry shelf so it turns on an external fan (so the PC does not overheat).

Anyway I don't have this all worked out yet (been wanting to just haven't got around to it). Maybe this thread will spark some ideas and give me motivation to complete this task! :)
 
Back
Top