Digital Home Server application

Show or discuss your existing Home automation project here, so a detailed explanation!.....

Re: Digital Home Server application

Postby r_255 » Fri Mar 09, 2012 4:32 pm

Thumbs up for your project !
Its not usable for me, as most of my hardware doesnt fit in. But i love to see people make these kind of things and share them.

I like the 02, its hardware is comparable to the viliv s5 and the older fit pc.
Thanks for this tip
r_255
Advanced Member
Advanced Member
 
Posts: 621
Joined: June 2008
Location: Netherlands

Re: Digital Home Server application

Postby soitjes » Fri Mar 16, 2012 1:09 pm

Part 3 of the prototype is ready : the rule engine. I kept it very simple : a rule consist of a number of conditions, that can be evaluated using AND (all conditions must meet) or OR (at least one condition must meet). If the conditions are met, all actions are then executed. A rule will no longer fire as long as the conditions are met (otherwise it would fire at each incoming xPL message).

Image

This concludes the functional scope for the prototype, next phase will be the integration in my Digital Home Server application. But first I'll release the Scanning and Archiving module. Did some administration over the weekend, and the amount of documents I have to keep in binders is ridiculous. I desperately need that module.

Still some small improvements needed for the prototype though. Performance can becomes an issue when you have a lot of devices, as one tester pointed out to me. Database performance is not my strongest point, but I'll manage. :)

As nobody tested the security schema part I will probably remove it. It seems the xPL x10.security schema is not widely used.

Those who still would like to give it a try : http://www.digitalhomeserver.net/haproto1.zip. There are regular updates of that file (about once a week).

Soitjes.
My Digital Home Server - http://www.digitalhomeserver.net
soitjes
Member
Member
 
Posts: 67
Joined: February 2010

Re: Digital Home Server application

Postby soitjes » Sun Apr 22, 2012 3:37 pm

A little update on the latest progress...

I bought a Foscam FI8918W IP camera on eBay. Actually, I bought one before directly in China, but it was blocked by customs. Apparantly it was a fake one, and I had to sign a paper to transfer this property to customs. So about 50 euro that went up in smoke :(

But this camera on eBay (sent from Germany) was a real one, and not much more expensive. Quality is very good, it has PTZ functionality and what's even more interesting, it has an http API, which you can find here : http://www.foscam.es/descarga/ipcam_cgi_sdk.pdf.

In the browser it works like a charm, but obviously if I need to integrate this in the Digital Home Server I need direct access. And that turned out to be a bit more complicated. Because how to capture a MJPEG stream in Delphi ? After a day of Googling I stumbled upon a MJPEG decoder written in Delphi, but back in 2006. Mmm, would that still compile in Delphi XE ?? Of course, it didn't, but the changes were not that hard. So it compiled, but didn't work. Actually, it worked, but the Foscam IP camera requires authentication. So I needed to find a way to change this decoder to that it would connect immediately with the Base64 encoded authorization string. Which required digging in the Http protocol to understand where I had to send that authorization info. And then I tried again, and look who's working :D

Image

So now I have direct access from Delphi to the camera. No audio yet, but as the camera has an audio output maybe I don't need the API for it. I can just branch the audio in an USB audio card, and play audio from there.

So what am I going to do with this ? First usage will be to monitor the baby, because my wife is pregnant for 7 months. So she has changed my priorities in the development. But the initial idea (and what I still would like to implement) is a doorbell application, that will show who is in front of the door when the bell is pushed. Pieces are being built (prototype, RFXCOM, and now the camera). Still a way to go though, as I like to build things in a generic way.

Most of my time is going to the home automation prototype though, because it has to be rock solid and simple. I rewrote the whole database part because performance was not ok. Now I'm working on the "schedule" part. I'll post an update when I have something to show.

Soitjes.
My Digital Home Server - http://www.digitalhomeserver.net
soitjes
Member
Member
 
Posts: 67
Joined: February 2010

Re: Digital Home Server application

Postby soitjes » Tue May 08, 2012 8:00 pm

The final part of the Home Automation prototype is developed : The scheduler. The previous part was about rules that trigger when a certain condition was met. E.g. a sensor goes above a certain value. Where rules operate on events which are not predicatable, the scheduler allows to planify events on specific moments. So the two activities are complementary.

Actually, the design of the scheduler was something I developed more than a year ago. It was the very first idea I had for a user-friendly way to plan things, but before I could add it here to the prototype I had to complete first all other parts : manage and use devices, the floorplan, charts and rules. And so finally it’s here !

The big challenge with a scheduler is to keep it simple. A text-based representation of scheduled items would work, but it requires some imagination of the user to understand the sequence of events. Certainly when there are a lot of events planned. I've seen implementations where users have to enter IF THEN ELSE statements, but that's clearly invented by computer scientists, not by normal users (no offence meant, I'm a computer scientists as well ;) ).

The DHS implementation uses a graphical representation of a week. A timeline is presented for each day, and you can schedule events on the timeline in the form of little flags. Changing the schedule is not more complex than moving the flags over the timeline.

Image

Instead of a continuous calendar which must be maintained I have chosen for a number of week “templates”, which I call a Schedule. You can define as many schedules as you like : for a week where you all work, one where you work partly at home, another one for the holidays etc… And then you activate one of the schedules (only one schedule can be active at a given time).

Once the schedule is active, events will execute as they are put on the timelines. There is no limit on the number of schedules, and you can change them on the fly. What I really like about it is that you immediately can see what is going to happen, thanks to the graphical representation of events. No need to read lines, scroll through text or whatever.

I didn’t plan to add the schedules to the prototype, but I was requested to do so. Some finetuning is still needed for the schedule, but now the prototype is finished, and I will transform everything to a DHS module. Special thanks to Jorge, Steve and Oleg for testing and their feedback. If anybody else would still like to give it a try, please do so. You still have some opportunity to influence the development.

http://www.digitalhomeserver.net/homeautomation.zip

And now I urgently must release my Scanning and Archiving module for DHS, which is ready since several weeks, but I still have to finish up the documentation. So you will hear soon from me again.



Soitjes.
My Digital Home Server - http://www.digitalhomeserver.net
soitjes
Member
Member
 
Posts: 67
Joined: February 2010

Re: Digital Home Server application

Postby structor » Wed May 09, 2012 7:59 am

Nice work! I like the calendar idea. I have also thought about it and thought of using google calendar as a datastore, but then you miss the finese of a custom ui like you have!
User avatar
structor
Member
Member
 
Posts: 125
Joined: September 2009
Location: Netherlands

Re: Digital Home Server application

Postby r_255 » Wed May 09, 2012 8:54 pm

Nice work again !

Just a suggestion :

If you would add a Y axis, make the x axis variable and had the possibility to draw a line you would have a very user friendly and more flexible rule engine.
Y could represent a sensor value that should act relative to X

For example:

- If lux comes below the line ( certain value ) switch light on between a certain amount of time.
- if temprature comes above the setpoint line switch off the heater between

I do think people would like to have the option to add a if/or/else statement and then just draw another line to set the next rule.
r_255
Advanced Member
Advanced Member
 
Posts: 621
Joined: June 2008
Location: Netherlands

Re: Digital Home Server application

Postby soitjes » Thu May 10, 2012 7:44 pm

Not sure I understand what you mean. The Rules part (see one of previous posts in this thread) is exactly what you're asking for, isn't it ? Each of those examples you give can be implemented by two rules (one if device goes above the level, one when it goes below).

Soitjes.
My Digital Home Server - http://www.digitalhomeserver.net
soitjes
Member
Member
 
Posts: 67
Joined: February 2010

Re: Digital Home Server application

Postby r_255 » Fri May 11, 2012 6:35 am

Sorry for beeing confusing.

But what i suggested is a rule like engine in the way you made the schedule.
See it as drawing a graph that sets the rule.

like in the quick drawing i made...
image_1.jpg
image_1.jpg (53.33 KiB) Viewed 8905 times

setpoint temprature over time, or dimmer value triggered by lux value from sensor.
r_255
Advanced Member
Advanced Member
 
Posts: 621
Joined: June 2008
Location: Netherlands

Re: Digital Home Server application

Postby soitjes » Wed Jun 06, 2012 11:52 am

It took me a lot of time, and development was interrupted several times for other things (like the home automation prototype), but I finally was able to release my “Scanning and Archiving” module. Originally inspired by a project description on domoticaworld.com, I developed a solution that would allow me to scan all documents that come in by post directly in DHS. This was not too difficult, once I had the Twain driver working in Delphi. The basic idea is simple : you create categories (water, gas, electricity, …) and then create a document in a category.

Image

Final step is to add pages, which you can do by scanning a paper document, or to import a file from disk.

Image

You can then zoom in the page, print or export it and change the order of the pages.

One feature I wanted as well is the “unpaid invoice” tracking. When you create a document you can specify whether it’s an invoice, and whether it’s already paid or not. The number of unpaid invoices for each category can be followed using the widget, which you can place on your desktop.

Image

All scanned pages can be accessed via the browser, because I do my online payments from a laptop, not on my main DHS server. So I need access to the invoices from other PCs as well.

The only real feature that is missing is OCR, especially because the database engine I use has a text search feature, so it would work great, but I simply couldn’t find a free OCR library, and I don’t need it urgently enough to justify the cost.

What’s next ? I have foreseen a general maintenance release with plenty of little enhancements that I wrote down the past year. Then the Home Automation prototype will be integrated in DHS. At that point I have home automation and multimedia together in one application, and plenty of ideas. Controlling audio in multiple rooms is very high on my list, as well as radiator control in rooms. Although I still haven’t found a good radiator valve that I can remotely control (without having to hack protocols that is).

Soitjes.
My Digital Home Server - http://www.digitalhomeserver.net
soitjes
Member
Member
 
Posts: 67
Joined: February 2010

Re: Digital Home Server application

Postby soitjes » Tue Jul 03, 2012 9:17 pm

As the development for the prototype is more or less finished I can start using it for some real-life scenario’s. I didn’t plan to do that this early, until my wife complained that her laptop suddenly went black. Turned out that the power supply was disconnected, and she was not near her laptop to see the warnings that Windows will give you when the battery runs low. And then she asked me if I could not find any solution for that.

So I started to work on two little xPL programs : one to check the battery level (xPLBatt), and another one that can “speak” a message using the Windows speech API (xPLTalk). In the Home automation prototype I can easily link them together using a rule. When the battery level runs too low I send an xPL message to the xPLTalk application, and my wife will hear the computer saying that she needs to connect the power supply.

Image

So while I was working on those xPL applications I wrote a few others : xPLCPU, xPLMEM, xPLDISK and xPLSound. The first three are use to monitor my home server, and last will be used to monitor my baby son :)

And here are the screenshots and links for the xPL programs :

xPLCPU

Measures the cpu load and sends xPL message at a configurable interval.

Image

xPLDisk

Measures the used space for all available disks in the system. One xPL message is sent per disk.

Image

xPLMem

Measures usage of the internal memory. An xPL message is sent at a configurable interval.

Image

xPLSound

Measures the sound level, and if a threshold is exceeded during a number of seconds an xPL message will be sent. This allows to detect noise in a room. Threshold an number of seconds are configurable.

Image

xPLBatt

Measures the batter level and power source. It will send an xPL message with the batter level at a configurable interval. It can also send a message when the power source changes (e.g. the power plug is inserted in your laptop).

Image

xPLTalk

This program makes the computer talk. It listens to xPL message and will use Text-To-Speech to say a text phrase.

Image

Those little xPL programs are really handy, because it allows the rule engine to remain generic. Once the xPL messages go out I can simply configure rules and schedules and it works ! I'll write some more of those, if anybody has some good ideas on useful xPL programs let me know !

Soitjes.
My Digital Home Server - http://www.digitalhomeserver.net
soitjes
Member
Member
 
Posts: 67
Joined: February 2010

Re: Digital Home Server application

Postby soitjes » Sat Sep 08, 2012 6:24 pm

I just finished a little xPL application which might be of interest. It's an xPL-Plugwise application that generates xPL messages for Plugwise devices. This version requires the presence of the "source" software, and the built-in webserver of that source software must be enabled. Then you must deploy two files in the "www" subfolder which you can find the the folder where you installed "source".

Image

When you start xPLPlugwise it will generate two sensor.basic message for each Circle found. One for the current powerusage, one for the total powerusage.

sensor.basic
{
device=1A3CD2D
type=powerusage
current=113,30
}

sensor.basic
{
device=1A3CD2D
type=powertotal
current=48,075
}

And then one additional x10.basic message with the state of the Circle plug (ON or OFF).

x10.basic
{
device=1A3CD2D
command=on
}

You can then simply turn a circle on or off by sending an x10.basic message with the correct devicename, and command=on or command=off.

Of course, directly usable in my homeautomation prototype without modification : http://www.digitalhomeserver.net/haproto1.zip.

I can't say I'm very enthousiast about that "Source" software sending my data to Plugwise servers. You can disable that function, but than you get a nasty warning that you violate the license agreement and that you won't be eligable for future upgrades. To be able to do that they need to keep track of who is sending data, and so it's not anonymous at all (data that is sent is accompagnied by the license code, and they know who purchased it). So when I find some time I might port the current Perl implementation to Delphi, then I don't need the source software anymore.

What's next ? Well, the prototype is finished, and so I will start migrating this to the main Digital Home Server application. This will keep me busy for a few months. I might release a few xPL applications in the meantime, in any case I will post the updates here.

Soitjes.
My Digital Home Server - http://www.digitalhomeserver.net
soitjes
Member
Member
 
Posts: 67
Joined: February 2010

Re: Digital Home Server application

Postby soitjes » Mon Feb 04, 2013 9:33 pm

I thought it was time to give a little update on my project. It's several months ago since I posted an update, and you might think this project is dead, but it's far from dead !! I'm actually almost ready with the home automation part of my application, which will bring me to that combination of multimedia and home automation which I was looking for from the start. I've posted the progres of the home automation prototype here, and since September I've been working to integrate that prototype in the main DHS application. Which is now ready, and the staging version is running for a month in my house.

It's an xPL based application, and if you have the xPL version of the RFXLAN you will be up and running in no time. All the xPL schema's supported by the RFXLAN are supported by DHS as well. And off course I use my xPL applications as well (after all, that's why I wrote them).

Some screenshots of the staging environment (I don't expect any change when moving this to production, it pretty final) :

Manage devices : image1 - image2
Floorplans : image1
Charts : image1 - image2 - image3
Schemes: image1 - image2
Rules : image1
Schedules : image1

Still have to finish up my new website, and to avoid to type long documentation I recorded some simple movies showing how it all works.

If anybody would be interested to have a look at the staging version just let me know and I'll send you the download url.

Soitjes.

PS just noticed that this thread is almost two years old... time goes fast !
My Digital Home Server - http://www.digitalhomeserver.net
soitjes
Member
Member
 
Posts: 67
Joined: February 2010

Postby Phaeton » Mon Feb 04, 2013 10:24 pm

Nice :)
User avatar
Phaeton
Advanced Member
Advanced Member
 
Posts: 573
Joined: May 2010
Location: Wassenaar

Re: Digital Home Server application

Postby soitjes » Sun Feb 24, 2013 7:39 pm

I'm happy to announce that the Digital Home Server 2.1.0.0 is now released, containing the home automation modules. You can check everything on my new website, that also contains the tutorial videos that show how everything works. The released modules are :

ModHADevice : define the house, floors and rooms, manage your devices, select the type, turn on/off switches
ModHAFloorplan : put devices on a floorplan, turn on/off switches and show sensor values
ModHAChart : create charts with sensor data
ModHASchemes : create groups of actions (e.g. turn on/off ALL lights)
ModHARules : a rule engine, allowing to take actions based on events
ModHASchedule : a graphical scheduler, allowing to place actions on a timeline

This is not the end, though. I'm working on a video surveillance module, and found the Razberry via this forum, which is a promising way to finally get Zwave integrated in DHS (which was the idea from the start, but I never found a good way to do that).

Soitjes.
My Digital Home Server - http://www.digitalhomeserver.net
soitjes
Member
Member
 
Posts: 67
Joined: February 2010

Re: Digital Home Server application

Postby soitjes » Sat Jun 08, 2013 8:26 pm

I finally found the time to release the next module : video surveillance. Actually a request from my wife so that we could keep an eye on our little boy when he's sleeping, and I would like to use this to show who's at the door when the doorbell rings.

The module has the following features :
- connect up to 4 ip cameras (MJPEG streams only), tested with Foscam and Axis
- record video (still image every second stored in avi format)
- detect motion and limit the detection area with zones
- record video when motion is detected
- take snapshots to local disk, or send them directly by email

I made a video tutorial that explains how to use it : http://www.digitalhomeserver.net/video-surveillance/

Image

The video surveillance module is linked to the home automation modules by means of xPL messages, and so you can take any of the supported actions when motion is detected (e.g. turn on lights, play an mp3, etc...). You could capture these messages also in any xPL-enabled application.

What next ? A lot of things ongoing : next release will be multi-room audio, I finally managed to properly control ELV Max!, and so I will release an xPL gateway for this, and I've been playing with Freepascal on my Raspberry, which I will use to xPL-enable the raspberry (on which I plugged a Razberry, the idea is to build a bridge between xPL and Zwave).

Soitjes.
My Digital Home Server - http://www.digitalhomeserver.net
soitjes
Member
Member
 
Posts: 67
Joined: February 2010

PreviousNext

Return to Home Automation Projects

Who is online

Users browsing this forum: No registered users and 1 guest