livebox:hah

This is an old revision of the document!


Home Automation Hub (Overview)

Navigate to the top level page for more information about all the components of this system.

The Home Automation Hub (HAH) Project transforms the Livebox into one of the most capable and affordable Home Automation systems that you might imagine.

The following features were proven to make this project a winner: hah-box.jpg

  • Browser based user interface
  • Pre-programmed automation scheduling via Google Calendar
  • Instant control via Twitter
  • Data logging to pachube
  • Power use monitoring/graphing from a Current Cost unit
  • Easy to control remote RF mains sockets (Bye Bye Standby & HomeEasy)
  • Seamlessly integrated with JeeNodes
  • Open control protocol (xAP)
  • Input sensing (upto 4 switch inputs) as well as output driving (upto 4 relays)
  • Free, Open Sourced, HAH firmware
  • User scripting language for customisation of operation
  • Cheap to run. Only uses 6 Watts of power
  • Solid operation - not prone to hangups
  • Gets its IP address via DHCP or STATIC
  • Remote firmware 'auto-updates'
  • Configuration not lost on 'hard' reset
  • Makes a great solar PV controller

HAH components can be bought from the shop or drop by the forums if you have any questions about the HAH project.

Note that your Livebox needs to be like the one pictured above. The newer Livebox 'mini' version won't do the job.

You might want to read about the experience of a HAH user. Karl has a writeup here.

Now with a xAPFlash interface!

Monitor
Control

Architecture

The 20,000ft view of how the HAH controller fits into a network and the devices that it is able to control with the custom hardware.

Focusing on the software that controls the HAH additional Hardware

  • Using the open protocol xAP gives us the flexibility that our project requires
  • For the webserver component we use klone. It's a webserver where you build all the web pages using normal HTML but the embedded scripting language is C. Then it compiles all the pages into a BINARY executable which you ship. One binary and that IS your application. No CGI. No interfacing issues, and best of all no possibility that the scripting language can't do it!

A block diagram of how the daemons interact with one another on the livebox.

  • xap-HUB - allows multiple xAP devices to be controled from a server. In this case the Livebox.
  • xap-adapter - convert the AVR menu interface into an xAP protocol and interfaces with the RS232 port.
  • xap-currentcost - USB/Serial interface to the CURRENTCOST electricity monitor
  • xap-sms - USB/Serial interface via a DLR-3 cable to a Nokia 7110 mobile phone.
  • xap-pachube - Feed xAP BSC data to the PACHUBE data aggregation service
  • xap-googlecal - Trigger xAP event from Google calendar
  • xap-twitter - Remote control with Twitter.
  • xap-plugboard - Lua based scripting engine
  • iserver - xAP/TCP gateway for running a wi-fi based touch screen for remote control.

All components use the file /etc/xap-livebox.ini as the universal registry for their settings. This is in “windows ini” file format using minini the INI file parser.

WebServer

The webserver is written in C using

The web server listens on PORT 80 from here you can control most of the Home Automation controller features.

To access any other page but info you will need to authenticate. Login in as admin you can enter anything as the password and it will be accepted. Not until the admin user password has been setup will it be validated.

More screenshots

There are several settings in the /etc/xap-livebox.ini file that directly affect the webserver or the Livebox itself.

The network section defines what additional services will be enabled and the ports used, whether DHCP or STATIC IP configuration is setup, if the two Ethernet ports should be bridged together into a Switch configuration or addressed individually, the domain name of the Livebox and the NTP time server to stay in sync with.

[network]
lan_proto=dhcp
hostname=hahbox
config_bridge=1
ether_0=00:07:3A:11:22:00
ether_1=00:07:3A:11:22:01
domain=
ntp_host=uk.pool.ntp.org

The power LED indicator, although it appears on the SETUP page, has its own section. This reduces the amount of ON time that this LED has, useful if you keep the Livebox in a room where this brightness would be annoying.

[hardware]
power=0

These network entries allow in-built services such as SSH, TELNET and FTP to be enabled/disabled.

[network]
telnet_enable=0
telnet_port=23
ssh_enable=1
ssh_port=22

Access to various pages in the HAH controller can be controlled in the [security] section. For example:

[security]
user=demo
passwd=secret
demo=automation,graph,control

Will create a login user called “demo” with a password of “secret” that only has access to the automation, graph, and control pages.

Up to 10 additional user accounts can be created. Simply separate each with a comma.

[security]
user=demo,foo
passwd=secret,bar
demo=automation,graph,control
foo=automation,control

The page names are derived from the names of the pages as defined in the URL. For example the page setup.kl1 will be “setup”.

There are two other entries that appear in the security section that are update-able via the webserver

info_protect=0
admin_passwd=21232f297a57a5a743894a0e4a801fc3

Info protect controls whether the INFO page is displayed without needing to authenticate as a valid user. The admin_password is an MD5 hash of the special user “admin” who cannot be deleted from the system; it's a hardcoded username much like “root” in a Linux system.

If you forget the “admin” user password simply delete the admin_passwd entry and whatever you enter in the login prompt will be accepted as valid.

Wake on LAN is a great way to save power by keeping your PC on 'standby' until it is given a little 'wake up' message. This page allows you to specify the MAC address of a number of PCs. Pressing the 'Wake Up' button sends the command.

More details of regarding WOL can be found here.


~~DISCUSSION:off~~

  • livebox/hah.1324236890.txt.gz
  • Last modified: 2011/12/18 19:34
  • by brett