Lastest downloadable image 2013-11-29
License: FREE FOR NON COMMERCIAL USE, ONLY TO BE DISTRIBUTED FROM THIS WEBPAGE
Found here: http://bit.ly/IrG1pi
MD5 of img file inside the zip: b78b-363a-e8fe-9b94-7658-a7f8-f7a2-71cd
Based on sourcecode revision: 3e9a2cc
Source repository and issue tracker: https://bitbucket.org/davka003/automagically/
UserID for console/ssh/admin interface: pi
UserID for mysql: root
Password for the above: raspberry (I advice you to change this but I haven't yet put any instructions on all the places needed to be changed)
The work I do with this system is done on my spare time and with my private resources. If you use the system on regular basis please consider a donation.
(I know the cost of a remote controlled switch, are the control software worth as much as one of those? :-)
First time install: Grab the downloadable image from above. Unzip it (i recommend 7zip for this if not running Windows) and make a 4 GB (or larger SD card). Quick start instructions found here (but use the zip above instead of the one linked to in the document).
If you have already been using a previous image see this page for instructions on moving the configuration.
After you have updated to this image there is now a link in the admin interface for software updates.
Then boot your Raspberry Pi and point your browser at it.
All configuration is handled in the Administrative interface that has a link at the bottom of the page, here you can add or remove devices. User is allways pi with password raspberry.
Start by going to the administrative interface and into administrate core system and then Raw Tellstick Devices. This is where you should configure everything similar to what goes into tellstick.conf - your actually hardware switches. Refer to this site regarding protocols and what more you need to fill in based on your devices.
If you need to send learn codes to self-learning devices there is a link at the main page of the admin interface for that.
When you have done the Raw Device configuration with the switches from the main page http://[rpi ip adress]/ .
Now you can start creating more complex devices. The following exist and are all configured in core system section of the admin interface:
Group Device - Several devices are done at the same time. Example is to use this for whole room on/off.
Preset Device - Make several devices configured in a certain way. This is per device independent command so one device could be DIM and other could be ON and OFF. Example is to use this for "Movie time".
Timer Device - Make a command a defined number of minutes into the future.
Wol Device - Send a wake-on-lan command on the network to wake up a computer (or similar). The target machine needs to be correctly configured and support wake-on-lan. - Lately I have got a report that this is not working, bug has been reported. I will look into it.
Send Signal Device - Send a signal to the internal signal system. See sections on Signals below.
Please note that all complex devices can act on all other Devices so a Timer Device could trigger a Preset Device that in turns trigger a Group Device. But make sure that there is no "ring" configured this will probably crash the system because of infinite recursion. Example By using a Preset Device that triggers a Raw Device and a timer device I made a device that is "Turn on now and off in 1 hour" - very good for car engine preheater control.
All devices share a couple of settings these are:
Name - Used in the administrative interface to identify it
Order - When the device listing is presented it is sorted by Order so if you want to rearrange the listing change number here.
Hidden - Not supported yet, have it not set.
Scheduled event let you configure to do a comand at a certain time and weekday, it also support time relative to sunset/sunrise if you make sure to fill in your longitude and latitude in the settings.
Threshold lets you make sure a device command is executed based on a global variable. I.e if it goes below a certain value execute a command. Useful for keeping temperature above freezing in your summer house for example.
Remotes is a way to design custom control pages for various devices, users or occations. It let you build up the page by placing widgets on it. A widget has the following attributes: Page, X, Y, Xsize, Ysize.
Page should allways be set to 0 for the moment.
X is the widgets position horisontaly on the page.
Y is the widgets position verticaly on the page.
It is then up the the Theme to render remotes according to these settings. Today there is only one theme availiable (JQuery). For this theme it works like this. For both X and Y it is not absolute position but relative meaning that if you place a single widget at Y=10, X=10 it will still end up in the upper left corner as there is no other widgets with lower values. If you add an additional widget with Y=5, X=0 it will end up at the upper left corner moving our first widget to be on the second row of widgets but still on the left edge of the page.
Everything is configured from the /admin/remote/ url. If you want to configure a certain remote for your device goto /remote/change/ this will allow you to store your selection of prefered remote in a session cookie and after that only access /remote/ to bring up the page.
To get started first create a remote: Select them jQuery and give it a name. Second create a page and give it number=0.
Now start to place widgets on your remote/page. It is a good idea to have a sepparate browser window or the device you design for close so that you can stay in the admin interface and place widgets and see the result at the same time.
There are a couple of different widget types and you could expect a couple of more to be added when I get time. At the moment the following exist:
Dim dev: Used to controll a dim-able device, renders as a slider + an off-button.
OnOff dev: Render a double button for controlling a device supporting On/Off commands.
Single dev command: Renders a single button that can do a single command. Useful for the devices that only support Activate command or if you want a button for Turn everything off, but dont want one to turn everything on.
Variable Value: to display a global variable including a link to a plot of its values for the last 24h. Make sure the global variable is off datatype Integer or Float before this will work.
Links: Places a link to a generic url on the page. Link to internal pages is not working yet.
Generic Content: Include any html code you want here. Good if you want to include a ip-camera image with its own <img> tag.
Heading: Place some heading text on the page or just a divider line.
For more advanced automation there is a system that is called signals. This is strings of text that is processed in various ways. A signal is nothing more than just an ordinary string. Various plugins can send in signals to the system. For example if you have Tellstick DUO it will send in all device commands and sensor events that it sees. Other plugins are under development. These signal are then broadcasted to all handlers (Transform, Find Repeat, Store Global Variable and Device Command). Each of these handlers have a pattern that needs to match the signal for the handler to do something. The pattern can be a regular scanf string or regular expression. The following handlers exist:
Transform - Send out one or many new signals if pattern is matched. If there are variable matching (like %d in scanf) these variables can be inserted in the signals by adding $1 (for the first parsed), $2 (for the second parsed)...
Find Repeat - If pattern is matched a number of times within a certain time intervall a new signal is sent out.
Store Global Variable - Store value from a signal to a global variable (temperature for example).
Device Command - If pattern is matched make a certain command on a device.
With the help of these I am able to store the temperature from an wireless thermomemter (from kjell.com) and that is displayed on the top of the main page. I also have the possibility to press a Nexa Remote Switch twice (or hold long) and that will turn off all lamps in the house.
Signals are also sent to various other plugins that make it possible to extend the system. Documentation on plugin development are currently not existing but take a look at the files in /home/pi/source/home_auto/site/plugins. That folder is automaticaly scanned for new plugins every start so there is no need to modify any other files. Let me know if you are interested in writing plugins and I will help you.
To see what signals has been sent around the system point your browser to /signals/index/ . Here you can turn on signal logging and you will see all signals sent, you have to manualy refresh the page to see anything new. It will currently not work to create signal handlers directly for raw device events from tellstick duo. These are only enabled for 4 minutes from last refresh of /signals/index/. Instead create a hidden tellstick device for the signal in question and then create a handler for this device event. (This might be changed later).
If you want to extend the functionality and integrate automagically with other systems there is a REST API that is documented here. The same documentation is also available in the device by browsing to /rest/ .
If you install this, please let me know what you think. It is allways intresting to hear from any users.