Webclients

Installation of PHP/XML webclient

I have build an webclient using apache and PHP5 to display device status using ajax, json and xmlrpc, resulting in on-the-fly page updates without refreshing.
Very spiffy if I may say so myself ;-)

NOTE: you need to run DomotiGa 0.1.163 and Gambas 2.12 minimal.

To use it you need an apache or lighttpd server configured with the right modules.
Read here] how to install one of these.
Next you need to copy the file inside webclient to a directory below you web root.

For example domotiga, so you can access it by browsing to http://yourserver.org/domotiga

NOTE: The directory /var/www is the default webroot for Ubuntu.

$ sudo cp -r domotiga/webclients/domotiga /var/www

Next setup Apache user authentication, very important since the webclient nor DomotiGa's xml-rpc server have a buildin authentication mechanism!

Create an auth file to store users and passwords in, and create a guest user:

$ sudo htpasswd -c /var/users guest
New password:
Re-type new password:
Adding password for user guest

Now make sure you have checked the contents of the htaccess.example file inside /var/www/domotiga
And rename it to the correct filename to activate it (notice the point before htaccess!)

$ cd /var/www/domotiga
$ sudo mv htaccess.example .htaccess

NOTE: I have to check how this works with lighttpd.

Now edit the config.php.example file, and set the connect string to point to your domotiga server and correct port:

$ sudo vi config.php.example
..
$rpc_connect="http://192.168.100.2:9009";
..

Or point it to localhost if you run it on the same server:

$ sudo vi config.php.example
..
$rpc_connect="http://127.0.0.1:9009";
..

Then rename it to activate it:

$ sudo mv config.php.example config.php

You should now have a working web client!
Browse to the url above and you should get a login window first.

It only contains a device status page for now, but I will expand it for sure, tips and suggestions are welcome!

NOTE: Since revision 727 you can also switch devices via the control tab.

Installation of CI webclient framework

Wouter Wolkers build a basic Code Igniter framework version of the client above, it's work in progress, so if someone can extend it with more functionality that would be nice.

You need Apache, with PHP module and mod_rewrite enabled.

Copy the files to your webserver document dir.

$ sudo cp domotiga-ci /var/www

Edit htaccess.example if needed and rename to activate it.

$ sudo mv htaccess.example .htaccess
$ sudo a2enmod rewrite

If this doesn't work, you need to enable .htaccess functionality for the dir you are using.
Edit apache config for this site.
$ sudo vi /etc/apache2/sites-enabled/000-default
...
 <Directory /var/www/domotiga-ci>
   Options [[FollowSymLinks]]
   [[AllowOverride]] All
 </Directory>
...

Change base url to point to the IP address and basedir of your DomotiGa server.

$ sudo vi domotiga-ci/system/application/config/config.php

$config['base_url']        = "http://192.168.1.60/domotiga-ci/";

Change port of XMLRPC server if you are not using the default.

$ sudo vi domotiga-ci/system/application/libraries/Domotiga.php

$this->CI->xmlrpc->server('http://localhost/', 9009);

You should now be able to visit http://<your server ip>/domotiga-ci/ with your favorite browser and see the device list.

iPhone

Simple iPhone client, supports controlling house mode, audio mode, and switching switchable devices, displays value1 of all devices.
To use it copy the iphone directory to your webserver's docroot and rename config.php.sample to config.php
Then surf to the correct url: http://yourserver/iphone/

Thanks Mike for sharing this with us!
Any help extending this is welcome, we could add groups, dim slider etc.

BTW: This interface also works on an Android device.

DomotiGApp

A simple Android client for DomotiGa, it displays in and outside temperature as well as a list of all switchable devices.

You need Android SDK and Eclipse with Eclipse ADT to develop/change source code.

You can find a binary compiled for Android 2.3.3 and higher as domotigapp/bin/DomotiGApp.apk.
Copy the file to your phone and install it with the Apps Installer application from the Market.

Thanks Reno for your contribution, let people extend it.
Look here for more info http://domotiga.nl/projects/domotiga/wiki/Android

Graphs

As of version 0.1.203 RRDtool graphs are supported on GUI clients.
You need to make them available via your webserver.

To do this in apache;

$ sudo vi /etc/apache2/sites-enabled/000-default

Then under line DocumentRoot insert:
Alias /graphs/ "/home/ron/domotiga/rrd/graphs/" 
    <Directory "/home/ron/domotiga/rrd/graphs/">
        Options Indexes MultiViews
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0
        Allow from 192.168.178.0/255.255.255.0
    </Directory>

Where /home/ron/domotiga points to your domotiga directory, then reload apache.
127.0.0.0 allows to access it via the same machine (localhost) , change 192.168.178.0 to your local subnet to allow other machines to access /graphs.

$ sudo /etc/init.d/apache2 restart

Related Resources

Comment

    Updated by: rdnzl, Updated 11 days ago
    Access count: 2801 since 2011-08-25

    domotiga-webclient.png (158 kB) rdnzl, 08/23/2011 05:15 pm

    iphone-main.png (51.7 kB) rdnzl, 11/13/2011 06:45 pm

    iphone-devices.png (45.6 kB) rdnzl, 11/13/2011 06:45 pm

    iphone-switch.png (51.1 kB) rdnzl, 11/13/2011 06:45 pm

    android-screen.png (214.3 kB) rdnzl, 11/13/2011 06:56 pm

    domodroid-parameters.png (28.9 kB) rdnzl, 11/13/2011 06:58 pm

    domodroid-mainscreen.png (73.5 kB) rdnzl, 11/13/2011 06:58 pm