Software pointers please

Hi, I'm new to this home automation but it looks like an interesting challenge. My plan, initially, is to have a series of "1 wire" devices networked over the house to monitor temperature, plus some control functions like dampers. These devices are networked into a PIC microprocessor that will be located in the furnace room in the basement. The PIC will host all the smarts for the project, and will also interface to a serial to ethernet device (EM202) to get the information to/from the PIC. Thats the easy part (for me at least).

Where I get stumped is how to do the following:

I have Apache installed as a server on a VISTA machine, together with SQL. I would like this server machine to read the data from the PIC as well as send controls messages to the PIC over ethernet. I would like to be able to do this via Apache so that I can access the server from any computer on the home network to monitor/control the PIC.

Does this seem a reasonable approach, any suggestions how to get the data into/out of the server so that Apache has access to it?

Thanks

Barry
 
If you know Java or some other programming language and want to custom-build the app, couldn't you just read the data off the PIC and use JDBC to write it to the SQLServer? In which case you could also do some programming to render the SQL inside the apache server.

Alternatively, you could use one of the gazillion HA Software apps that seem to abound nowadays to do the donkey work for you. Some even have built-in webservers, so you wouldn't need Apache standalone...
 
Sure, it's reasonable! :D

Since, I assume, that you can program a PIC, you should be able to do one of these:

1. What IVB said.

1a. Get PowerHome* ($69) to talk to your PIC (via Ethernet or serial) and use its built-in web server.

2. Get Microsoft's free, Visual Studio 2008 Express package and write some simple code to talk to your PIC and to drop files into the served Apache folder.

* I run PowerHome, so, yes, I am biased.
 
Since, I assume, that you can program a PIC, you should be able to do one of these:

1. What IVB said.

Really, I think everyone should just acknowledge the obvious, and make that part of the standard CT sig :-)
 
Hi Barry,
MainLobby has a 1Wire plugin that writes many 1Wire device results to a database. This will very, very significantly reduce the amount of effort it will take to implement the solution. There is also a "MLDatabase" plugin that allows for ODBC and SQLServer connectivity including charting.
 
These type threads are becoming weekly.... there are many ways to handle HA these days. Top picks in no significant order are Mainlobby/Homeseer, CQC, Powerhome (with Netremote as a graphic front end) and Netremote/Girder 5 (which is what I use for my 6 zone whole house audio system and home automation)

Link to my project:

http://www.cocoontech.com/index.php?showto...t=15#entry85476


I would first sit down and decided what functions you would like to have. Here are some that I have in my setup:


Central Server Music database/player accessible via client based PC's and Touch screens capable of 6 independent zones with 1500+ watts RMS

Lighting automation and control

Caller ID Voice annunciation and log

Elk based security system

Local weather and radar images via touch screens

1-wire temperature sensors

Ocelot IR control and digital I/O


After that decide how much are you willing to spend. Many setups can be built up over time. Some software packages cost upwards in the hundreds of dollars but can be pretty powerful. Each setup has its disciples here on Cocoontech as well as their pros and cons so if you want to ask specifics about any package I am sure you will get your answers.

John
 
IMHO, 1-wire networks are great, but not reliable enough to directly drive automation. Don't get me wrong, I have many, many sensors. What I notice is that every so-often, I'll have a sensor not respond, or an errant result (temperature result that is obviously incorrect)

My advise: make sure you compensate for an occassional errant/missing result. One easy algorithm, if you're tying this to a database: read your sensors every 10 minutes, throw out the outlyers, average the rest.
 
Thanks for all the replies, and apologies if this is a "weekly request". Currently part of me says "build your own software, it'll be a great learning experience", the other part says "don't be stupid" others have already written the s/w, just buy it!"

IMHO, 1-wire networks are great, but not reliable enough to directly drive automation. Don't get me wrong, I have many, many sensors. What I notice is that every so-often, I'll have a sensor not respond, or an errant result (temperature result that is obviously incorrect)

My advise: make sure you compensate for an occasional errant/missing result. One easy algorithm, if you're tying this to a database: read your sensors every 10 minutes, throw out the outlyers, average the rest.

I had the same thought about rogue readings, and have done something very similar to compensate.

Barry
 
My perspective isn't that it's foolish to build your own software, only that your time could be better spent elsewhere (ie, architecting the design). Tomorrow represents the 2 year mark of this thread, which is my "HA Progress". It's now 75 pages long and you can see how much work I went through (and still am) to setup my own system. And that's using a high-end package that does all the work for you, so it's mostly a point&click operation. FWIW, the website in my sig has screenshots of what I currently do, which is nearly everything doable.

Talk about fun - automating every dang thing in your house without doing any programming - now *that's* fun :D
 
I agree that 1-wire isn't 100% reliable. But by the comments of others in other threads, neither is X10 or UPB or Insteon.

Most 1-wire devices have checksums and/or return a known invalid value (85C for the ds18s20). Validate the checksum and/or result, immediately reread if a problem. If that happens N (i.e. 3) times in a row, then throw out the reading. I read a dozen or so sensors every 15 seconds and log the average for each sensor each minute. Since there's very few errors to start with, I can throw out the occassional misread and still have valid readings each minute. Reading temp sensors every 10 minutes isn't enough for my tastes. One of my sensors (in the HVAC main supply) can fluctuate 75F in 5 minutes. I rolled my own software for this. My perspective is to build your own software because you'll get exactly what you want and you'll know how it works and how to fix it when it breaks.

Going back to the original question, it sounds like you want your PIC to be an independent device and have your "server" contact it to get temperature data and send control commands to it.

You'll need some memory on your PIC to hold data when the server is down or offline, the PIC should have a RTC or the ability to sync with one to timestamp the data, and the PIC will need some protocol to insure that when data is transferred to the server and logged its also removed from the PIC data buffer.

If you want to log historical data, you'll need a process on the server that will run at reguar intervals to contact the PIC to get and log the data. Web servers (Apache, IIS, etc) typically only do something when a page is requested. If nobody requests anything for a couple of days, that data will probably be lost unless your PIC has a huge memory. Now you could task schedule (cron) a job to run every X minutes and pull up a data collection web page, in which case you could do all your data collection through the web server scripting. You'll need more scripting and graphing utilities to generate usable pages from the raw data.

If your PIC contains the smarts and can run on its own, I assume the commands you'll be sending it would be predefined modifiers for its original programming. You'll need to do some scripting to send commands to the PIC when you pull up a control page and click a button for instance. You'll probably want the PIC to respond to commands with at least an "OK" to let you know it received the command.

One point of all that, at least some of it, was that you'll need to handle historical data collection/display differently than monitoring/control.

Another point is that maybe using a custom PIC isn't the best choice if you want to go with canned packages. I don't know how flexible those gazillion HA software packages really are. Can they be told to read user defined data from an IP address and write it to a MSSQL database? Can they take the data and display it how you want? Can they be told to send user defined commands to a specific IP address? If you can't find one that does what you want, you'll either have to DIY, change your design, or scale back your goals.
 
You sum up my dilemma nicely in your last paragraph! For the moment I am going to bash forth and see what can do what, while at the same time playing with PHP and SQL.

Barry

Another point is that maybe using a custom PIC isn't the best choice if you want to go with canned packages. I don't know how flexible those gazillion HA software packages really are. Can they be told to read user defined data from an IP address and write it to a MSSQL database? Can they take the data and display it how you want? Can they be told to send user defined commands to a specific IP address? If you can't find one that does what you want, you'll either have to DIY, change your design, or scale back your goals.
 
Back
Top