Defining a Configuration Schema File for the Switches

There are a number of switches in the house, most of them controlling lamps but also other things like the printer for example. Most of the switches are of the brand ‘Nexa’ and selflearning which makes it easy to control using the tellstick.
A new switch has to be configured in two different ways. The first configuration file is the tellstick.conf used by the telldus service daemon. In this configuration file, the id is specified as well as the name and the protocol of the switch. It is quite easy to find the protocol name of the 433 MHz communication by looking into wikis/forums of telldus.
The second configuration file is the one defining the on/off intervals of the switches. First of all having a separate file defining the intervals gives the possibility to differ between intervals at normal occasion and trip/vacation.
The format of the configuration file is json-format since it is very easy to read directly into a python program. In more detail it is a list of all switches where each switch has a structure containing a textual description, the device id in telldus, and the schema/interval defined as either always (on), never (on), sun, night, or : 

   "text" : "textual description e.g. lamp in working room",
   "name" : "device id in telldusd",   "schema" : schema either "always", "never", "sun", "night", ":"

The schema/interval sun is defined as turning switch on 40 minutes before sunset and then turning it off at a defined bed time which is one o´clock at night.

Here is an excerpt from the existing normal.json of the house:

        "text" : "Prydnadslampa 1",
        "name" : "wallswitch3",
        "schema" : "sun"
        "text" : "Pappas sänglampa",
        "name" : "wallswitch4",
        "schema" : "always"
        "text" : "Linneas sofflampa",
        "name" : "wallswitch5",
        "schema" : "night"

In vacation.json the second switch above, the schema is changed from ‘always’ to ‘sun’ to give an illusion of somebody in the bedroom (does it fool anybody? – probably not).


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s