Detecting Power Failure?

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
loo_hoo_ser
Member
Posts: 83
Joined: Sat Oct 30, 2004 4:16 pm

Detecting Power Failure?

Post by loo_hoo_ser »

Hi Y'all -

I finally got around to getting a new UPS with a USB interface. I prevously had my HB server on an older UPS with a serial interface. However, I didn't have enough comm ports on the server to connect it to the UPS. The new one has a USB interface. I do know that Windows can detect when the battery in the UPS is reaching a certain level that can trigger a program execution at a certain threshold, and even shut down the server.

What I'd like to do is to somehow have HB notice that the power has gone out (UPS has switched over to battery power). I sometimes lose power for maybe 5 minutes.

So, how do I go about making the link between UPS and HB? Ideas? I don't necessarily need HB to do anything, but it's more of a "FYI - you lost power", but others might want to use it to do something else.

Thanks!
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

Some USB devices like FS20 and the UIRT are based on the same circuits which can be integrated using the FTD2XX.dll to create a virtual COM port. You should find out if there is some COM object you can use to talk to this UPC or figure what hardware it is based on. Maybe you can find a way to create a virtual COM port for it. How come your PC ran out of COM ports? That should be easy to expand.
yaccri
HouseBot Special Member
Posts: 304
Joined: Wed May 07, 2003 2:19 pm
Location: Tel-Aviv, Israel
Contact:

Post by yaccri »

Did you receive any software with the UPS?
Can you use it to control HB?
loo_hoo_ser
Member
Posts: 83
Joined: Sat Oct 30, 2004 4:16 pm

Post by loo_hoo_ser »

Richard -

I ran out of serial comm ports because my PC only had 1. I'm aware you can buy expansion serial port PCI cards but I didn't think it was worth the hassle.

yaccri -

The UPS is an APC Back-Up XS900 model. It does come with software, but I don't know enough about it whether it offers what I need to communicate with it (ie. query the state of the unit). Can someone tell me if it does, then, I'd be willing to look into it.

A thought I had would be to have Windows kick off a script file when it detects it is on battery power and the script would simply write to a text file of the time and date when it was executed - thus indicating the time and date of when power was lost. HB can simply monitor this script and do a tail of the last line in the file (presumably the last power off event).

Something like that..................... simple.
Post Reply