My home automation project / software

Show or discuss your existing Home automation project here, so a detailed explanation!.....
airox
Member
Member
Posts: 214
Joined: Sat May 15, 2010 10:42 pm

Re: My home automation project / software

Post by airox »

For those running with PHP:

Code: Select all

	/**
	 * Sending a message to Android devices with NotifyMyAndroid installed.
	 * @param string $text
	 */
	public static function sendNmaMessage($title,$desc) {
		$fields = array( 	'apikey'=>urlencode(Config::instance()->get('nma_key')),
		            		'application'=>urlencode(Config::instance()->get('app_name')),
		            		'event'=>urlencode($title), 'description'=>urlencode($desc) );
		
		$fields_string = '';
		foreach( $fields as $key => $value ) {
			$fields_string .= $key . '=' . $value . '&';
		}
		
		rtrim($fields_string,'&');
		
		$ch = curl_init();
		curl_setopt($ch,CURLOPT_URL,'https://www.notifymyandroid.com/publicapi/notify');
		curl_setopt($ch,CURLOPT_POST,count($fields));
		curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
		
		$result = curl_exec($ch);
		
		curl_close($ch);
	}
airox
Member
Member
Posts: 214
Joined: Sat May 15, 2010 10:42 pm

Re: My home automation project / software

Post by airox »

Small update:
- Growl plugin so I can receive notifications on my PC when I'm home.
- I'm using this to send important messages to the PC and tell them through the house. No more missing those important messages which are told throughout the house when listening to spotify with my headphones on :-)
- Foursquare plugin (checkins of friends, checkin of myself, checkins on a certain venue)
- When a friend checks in on facebook or foursquare in our home, he will be welcomed by the system (through the text-to-speach) and asked for coffee ;-)
- Tells my girlfriend where I checked in.
- Tells when a friend checks in nearby our home.
- SMS plugin (using mollie.nl)
- SMS support! More important messages are send also through SMS (alarm, fridge below certain degrees) next to the push messages.
vanisher

Re: My home automation project / software

Post by vanisher »

It's time for a release :D :D

Keep up the good work!
User avatar
jrkalf
Member
Member
Posts: 291
Joined: Fri Nov 12, 2010 4:20 pm
Location: Nootdorp
Contact:

Re: My home automation project / software

Post by jrkalf »

I'm sceptical about announcing your location in your house to your girlfriend while you're not at home.
Today for example, I saw him check in with a girl named Mireille O. at the Van Der Valk Hotel in Eindhoven.

How are you going to explain that when you get home?...
It's a good thing you have a lot of Domotica "Friends" that'll solemnly swear you were at the dinner table and never went anywhere near a hotelroom with this lady.
If you can't fix it with a hammer, you've got an electrical problem!

Fibaro HC2, various z-wave switching, alerting, detection modules.
ELV FHT80b heating system.
airox
Member
Member
Posts: 214
Joined: Sat May 15, 2010 10:42 pm

Re: My home automation project / software

Post by airox »

Hahaha! Glad she doesn't read this forum ... ;-)
airox
Member
Member
Posts: 214
Joined: Sat May 15, 2010 10:42 pm

Re: My home automation project / software

Post by airox »

And finally I got some hardware thanks to Tane and his webshop! I bought four Zwave.Me modules and will be integrating them in this week. I also ordered a Analog to VOIP telephone box (Linksys SPA-2102). I am going to integrate my analog line and my mobile telephone lines into senders of call events on which the system will act. So when anybody calls me when I'm home the system will tell me who is calling :-)

Nice things ahead!
airox
Member
Member
Posts: 214
Joined: Sat May 15, 2010 10:42 pm

Re: My home automation project / software

Post by airox »

Update 23 dec 2011:

The Zwave.ME modules are now integrated completely in my home. Also one Fibaro module (2x1.5KW) is installed in the shed controlling the shed lights and the garden lights. I added some rules so they will only turn on when the light is low and there is presence. The kitchen lights are on at the same time as the living room lights but are turned at 40% (dimmer) and when entering the kitchen they glow up to 80% :-)

Another thing I already had was the possibility to speak through speakers and play sounds through them. But... when I am gonna throw some speakers around the house you need to direct sound to a specific speaker. So I decided to create a speaker concept in the software. Speakers are audio output devices with a certain set of capabilities. Capabilities like:

[*] Playing local files
[*] Playing URL
[*] Play a local file or URL right now
[*] Queue a local file or URL after everything which is in the queue
[*] Pause playing whatever is playing and play the given file or URL right now and then resume the previous playing audio
[*] Stop playing
[*] Pause playing
[*] Mute/Unmute/Volume set

So whenever I create a Speaker driver I can tell the system what the driver is capable of. The first driver I created was an ALSA-device. When adding such a speaker you can select the soundcard and the output which the speaker is connected to. For example I have a set of stereo speakers connected to a stereo jack and another audio output in the form of a HDMI cable to the Onkyo system. All sound actions (text-to-speech and playing files) in the system are now capable of directing to a specific Speaker!

The next speaker driver I wrote was rather odd. It is a capability of turning a web interface of the system (touchscreen interface) into a speaker. When sending commands to this speaker they are forwarded through the AJAX push mechanism I am using to the touchscreen. This then plays the sounds or does other actions! I used jPlayer for this, check it out. Rather nice web 2.0 player :-)

I also designed some other drivers on paper, but haven't wrote them yet. An Onkyo speaker for example, Airport express and an Agent speaker (an agent is a concept which I'm using for devices which don't have a display but are capable of receiving commands from the system). Maybe in the upcoming period.... the first one will be an DLNA speaker :-)

So now we have speakers but no content to play from. So I added the concept called ContentProviders. These can provide listings of concent and content items. Basically something like a MediaServer in DLNA terms. The idea is that on our touchscreen you can browse content and select a bunch of items to be send to a speaker without copying them to a local device etc etc. No more difficult stuff being done. For now I have the following contentproviders implemented:

[*] Local directory (plain and simple)
[*] Podcast xml feed (so we can play our favorite podcasts)
[*] Radiostations (a listing of currently dutch radio stations)
[*] Dropbox support (we all know dropbox)
[*] PogoPlug support (playing files from a disk at my brothers house)

The next contentproviders I am creating are SkyDrive, DLNA mediaserver, Shoutcast.

As always checkout the screenshots at http://fotoboek.vandulmen.net/domotica/ha_23_dec_2011/

Some random stuff I also added:
- iSCP driver (for controlling Onkyo devices)
- Windows Messenger integrated (based on their new XMPP interface)
- Capability of cameras to be added from Motion or just plain URL's

What's next? I am thinking about the concept of a "Display". A display capable of showing images, videos and notifications. This would perfectly integrate with the contentprovider concept. Playing a directory of images as a slideshow on our touchscreen (picturelist support) or playing a list of images on our TV.
airox
Member
Member
Posts: 214
Joined: Sat May 15, 2010 10:42 pm

Re: My home automation project / software

Post by airox »

Quick update:

Added:
- Plugwise support (got myself a Home basic set :-)
- Contentproviders added: DLNA client, Picasa web albums, Shoutcast, Camera images
- Spotify support!

Next things I'm working on:

Exposing the home automation as a DLNA server. All content available through the content providers can then be accessed through a DLNA capable device!
Exposing all available speakers as DLNA renderers. This makes it possible to use MediaConnect on my ipad as a client for my home automation system :-)
Bluetooth speakers as "Speakers" for the system.
User avatar
structor
Member
Member
Posts: 125
Joined: Tue Sep 22, 2009 8:12 pm
Location: Netherlands

Re: My home automation project / software

Post by structor »

Hey a quick question how do you play these system sounds, is that over these bluetooth speakers? I am trying to accomplish more or less the same, but are running into some snags. I am looking for some alternatives, so if I can 'borrow' something it would be an enormous help :)
airox
Member
Member
Posts: 214
Joined: Sat May 15, 2010 10:42 pm

Re: My home automation project / software

Post by airox »

Structor,

I am using bluetooth in combination with ALSA on linux. I put this into my asound configuration:

Code: Select all

pcm.upstairs {
    type plug
    slave {
        pcm {
            type bluetooth
            device C8:84:47:02:8C:30
            profile "auto"
        }
    }
    hint {
        show on
        description "Logitech speaker adapter"
    }
}

ctl.upstairs {
  type bluetooth
}
Paired the device in linux using blueman bluetooth manager. I can then use mplayer to play sound to a specific bluetooth speaker like this:

Code: Select all

mplayer -ao alsa:device=upstairs /home/gijs/test.wave
User avatar
structor
Member
Member
Posts: 125
Joined: Tue Sep 22, 2009 8:12 pm
Location: Netherlands

Re: My home automation project / software

Post by structor »

Hey thanks, I suddenly realize if I change my alsa config in that case my xbmc (which is blocking my audio device) can use the hdmi, I can then add elcheapo speakers on my analog outputs. Most probably I can tie the virtualbox instance to the analog device... Yep I see that flying, thanx!!!
airox
Member
Member
Posts: 214
Joined: Sat May 15, 2010 10:42 pm

Re: My home automation project / software

Post by airox »

Cool! Hope you can make it all work. I have the same setup. A PC beneath the television with one cable connected to the receiver and another to cheap speakers laying behind the TV corner. Theses cheap speakers (with fair quality) are used for notifications throughout the house. I noticed you can still understand them upstairs as long as you don't close a door. Therefore I added two bluetooth speaker setups to duplicate the audio towards when there is also movement in those rooms.

Playing audio throughout the house is not a priority over here because often you just want it at one place (specifically from the best speakers you got). It's only nice when you're cleaning the house maybe :-)

Thinks I have done lately:

Exposed the home automation system as a DLNA mediaserver. All described content providers are now folders on the mediaserver. So you can browse podcasts, shoutcasts streams, and all those others. I had to implement a check on the requesting device to see how I would announce the content. My Samsung TV only supports content when you send specific (DLNA specific) headers towards it and specific mime types.

The step towards supporting DLNA renderers as speakers to play to was easy. Just some SOAP requests towards the devices was all that was necessary. The speaker abstract really worked nice over here. Adding support for setting volume, pause, play through DLNA was done by only implementing one method and set a specific configuration item.

So I can now play all my content throughout my house on a DLNA device by pushing it or use my iPad as a ControlPoint to select something and sending it to my TV or Onkyo receiver.
Really nice!
superholz
Starting Member
Starting Member
Posts: 2
Joined: Sat Feb 04, 2012 3:27 pm

Re: My home automation project / software

Post by superholz »

airox wrote:Update:

Integrated the Youw8 weightscale into the system. I now got a tab on the touchpanel named "Health" which shows our BMI, Weight, Muscle mass and Fat percentage. Youw8 is really straightforward to integrate as you will read elsewhere on the forum. Just hookup to their API using OAuth and you can readout the values. No PUSH towards my server so the values will always be out of sync. I checkup on new data every 15 minutes (which is quite often I guess).
...I wonder weather your statement regarding the youw8 and OAUTH is still true. I was about to setup a OAUTH data readout for my youw8 scale, but I can not find the data necessary on their website. An email to them was answered that they do not provide the interface for private people. Maybe you could comment on this regarding your OAUTH youw8 integration.

thanks
airox
Member
Member
Posts: 214
Joined: Sat May 15, 2010 10:42 pm

Re: My home automation project / software

Post by airox »

Superholz,

Sorry for the (very) late reply. Haven't got around visiting this forum very often lately. Their interface details are at http://www.youw8.com/nl/node/102

I had problems earlier and I contacted them. It should be fixed, but never got around trying it at my end.
airox
Member
Member
Posts: 214
Joined: Sat May 15, 2010 10:42 pm

Re: My home automation project / software

Post by airox »

Oh, some very quick updates.

I passed the 37 million readings in the database. The main rule engine is still very fast because it doesn't use a database and does it stuff all in-memory. I have built in domain specific language support and an interface to add them. It now understands text input like "add rule if sunset then turn on outside lamp". I also implemented a new web ui using WebSockets. This made the whole web UI very fast. A click in the web interface (HTML and javascript) and pushing back the state from a z-wave device to the same web interface is now instant and without refreshing the web page :-)

I also added the 2ihome security package. Replaced the RFID reader I build myself with the Z-wave RFID reader and used the other sensors in my house.
Post Reply

Return to “Home Automation Projects”