Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

Wednesday, March 28, 2012

Small update!

It has been a while since I posted something here...the truth is, not much has happened in the electronics front.

The JeeTherm has been working flawlessly since I installed it, on the 15th of January, so that it over 2 months ago. During those 2 months, we had some serious cold coming this way, I measured -15C on my weather station! That is the lowest ever recorded here.

One interesting thing about this whole story of the efficiency of an HR boiler, is that, due to some graphics I found I limited the temperature setpoint of the boiler to 55 degrees, as this is the limit above which the efficiency decreases rapidly, thinking that, if it gets really cold, I could raise this limit, as it is all software anyway, and there was no need to recompile anything (on the JeeTherm the limit is 80C, on my PID controller implemented in PHP, the limit is 55C).

As the cold came and settled in, I noticed that the boiler, and the whole heating system was still able to warm up the house, and keep it warm, even in the coldest days! so I ended up never having to raise it! I was glad, I had days where the boiler worked nonstop, but down to a simmer. My energy saving correlation calculation also indicated that the gas spent was way below expectations, although the curve fitting was not done with any data in that kind of cold range.

What bothers me the most, is that I could never really find any good info about this efficiency story. In many forums you can find people saying that an HR boiler needs a 20C difference between feed and return to operate at optimal performance, but all the graphics I find of performance, none indicates such a difference, the efficiency being a simple function of the return temperature. Furthermore, if that is the case, then the boiler should be set to start modulating to try and achieve such a difference, but the behaviour I see with my boiler is that it modulates to have a 7C or 8C difference between feed and return. sometimes even 5C. I start to think that all that matters is the return temperature...and that one, I have it limited to 55C now!

Tuesday, October 18, 2011

New Dashboard

Progress of the OpenTherm interface is going very well! but that is not what I am here to report today. Today it is just a short post to share the prototype of the new design of my dashboard. My wife made the design, and I implemented the functionality. Still some rough edges to adjust. Here is a snapshot:



All information gets updated regularly via HTML5 and AJAX calls. Half of it is already working even, but there is still some to get done. I'll share the code once it is ready!

By the weekend I should report on the Opentherm!

Saturday, June 18, 2011

Home dashboard V2

Since the last post, not much has happened, but I have been busy with the dashboard.


I made some changes to it, so here it is:


The left dial is the electricity consumption, and the one on the right is the gas. They go from 0 to 5, so at the moment I took the snapshot, there was a very high electricity consumption - vacuum cleaner :)
The pointer indicates the instantaneous consumption, the white number the total for the last hour, the blue number (month) is the running total for the last 30 days, as well as the cost, which is simplz the number in blue multiplied by the average cost.

It is all made using HTML5 canvas, and AJAX (I think...). On the server side, php does the job of answering the requests. The thing updates every 5 seconds, and the temperature updates every couple of minutes. The agenda fetches data from google calendar and does that only at the moment the page is loaded, so the plan is to reload the page every few hours (my agenda hardly changes...)

I now have to polish it a bit, to display properly in portable devices - it works in android 2.1 - and to lighten the load on the server...my database structure is far from ideal, and the requests take a very long time to process - 1 to 2 seconds - when most data doesn't change that fast.

Sunday, September 20, 2009

Further news from the polar front

One more quick post about the polar coordinates display for the energy consumption.

I have adapted the graphics from the last post to have a logarithmic progression in the size, so that an increase of consumption would not lead to the bars going off screen, while allowing to see small variations as well. So this was the result:


Not bad in my opinion, but I think it is a bit too difficult to read, partly due to the difficulty in adjusting the coefficients such as to have a nice variation range.

So I decided to make it constant width and only change the color:


I think this is a better display, although the colors aren't the best...must work on that. The red area was the washing machine centrifuging the clothes!

One other idea, would be to combine the electricity and gas in one sole graphic displaying the cost, e.g. in euro, or in CO2 emissions!

Wednesday, September 16, 2009

Back, with polar ideas!

A lot has happened in the last 2 months or so since my last post!

I was on holidays for quite a while, and then I came back and kept experimenting with the JeeNodes/JeeLinks from JeeLab, but that is not what I will write about today! I'll keep it short and show something I just got together in the last hour (instead of practicing the trombone!)

Based on this article in Make magazine, I decided that that is a great way to show the electricity consumption, so I decided to adapt my old fashioned looking graphs to the modern polar graphics!

Here is the first iteration!


In the bottom you can still see the linear bar chart, so that you can relate the consumptions to the pie slices! Let me know if you want the code...still must investigate a way to get it online!

The next stage is to integrate in one sole graph the consumption of the last hour (displayed above) and the last day, just like "hours and minutes", and of course, make it pretty!! something I am not very good at!

It is all made in PHP!

UPDATE:

Been trying around with fancy stuff, first color dependent on the consumption, going towards red as we go up, and then, some rounding of the courners :) check it:

Tuesday, May 19, 2009

Growling door bell



In my quest to complicate things, but to use the available technology, as you might remember, I connected the doorbell to the computer.
So, if someone rings, the internal beeper makes a little funny noise, not very loud, and the power orb turns purple!
The problem arises when I am upstairs, probably at the computer and do not hear the little beep, so, I thought of making some kind of listener daemon for the mac that would listen to messages in the network, only to find out that it already exists (technology advanced a lot while I was not looking...) and it is called Growl. After that and almost by accident I found a php library for growl, which is great, because all my server and home automation stuff is done in php, including the eternal cycle of checking if there is an additional line in the doorbell rings databse and sound the beeper if so. From there to a growling doorbell was just a few lines of code.

Even cooler is to setup the messages from the doorbell application to be spoken! Then the mac tells me that there is someone at the door! That is why the message is so verbose - it makes it cool when spoken! I managed to record it! The only way I found to get it here was to make a little movie out of it...so here it is!



As usual, if you want the code, just drop a line!

Thursday, January 29, 2009

Log rotation

The heating system of my house creates a log file per week, per zone ( currently 3 zones: living room, kitchen and sleeping room). Every week, and on the same day of the week as the first day of the year, it starts a new log file. So to see the nice little graphs plotting temperature - actual and desired - and valve state, once a week, I have to ssh onto the server, manually adapt a little script and run it.
Until today!
I finally beat my laziness, and wrote a php script, took about 5 minutes to write. It is a brute force script just to get the job done. This to prove that a lot of time is wasted in activities that can very easily be automated and are of no interest to be kept manual.
So here is my script.
All, or almost all of my home automation run on php scripts being executed by a crontab.
Now, once a year I'll have to adapt the crontab file...maybe I should think about automating that also..

$comand = "rm kitchen.log livingRoom.log sleepRoom.log";
exec($comand);
$comand = "ln -s kitchen-";
$comand = $comand . date("Y-W");
$comand = $comand . ".log kitchen.log";
exec($comand);
$comand = "ln -s livingRoom-";
$comand = $comand . date("Y-W");
$comand = $comand . ".log livingRoom.log";
exec($comand);
$comand = "ln -s sleepRoom-";
$comand = $comand . date("Y-W");
$comand = $comand . ".log sleepRoom.log";
exec($comand);

and the crontab line

#once per week, for 2009 on thursday, first thing in the day, rotate the logs
15 0 * * thu /usr/bin/php /tmp/automate_log_change.php