Poor man’s weather station

With all the money invested in our Loxone home automation project there currently is no room for a weather station. I need one to steer the heating system. The KNX OT Box of Theben I bought has a program which can take outdoor temperatures into account.

Currently Loxone has a weather service but it is limited to certain countries and the Netherlands is not included (yet). So I started thinking, can I not use weather services on the internet to tell me my local temperature, mold that into a PicoC program and have the service tell my heating the outdoor temperature?

The answer is “Yes you can!”. I’ve cooked up a little PicoC program which will do exactly that. Here’s how to do that:

A WARNING IS IN PLACE HERE! PicoC is not very strict in its syntax checking. A missing curly bracket will still run but gives unpredictable behavior. At one time I had to remove the SD card from the server, format it and reinsert it because my server did not respond to anything anymore. Be careful with what you program and check double check your code before committing it to the server!

You will need an account at a weather service. I used ‘aerisapi.com’. Go to their website and create an account. After you have created your account, register your application and you will get a UserID and UserSecret which will you will need in the code below.

Add a ‘Program’ module to a page in your Loxone Config program.

Loxone Config

Loxone Config


I use a lot of Memory flags which help me organize the programming. Here are the settings for the outdoor temperature memory flag. Uncheck the ‘Use as digital flag’. Now you can also change the ‘Unit’ value to reflect the value.


Doubleclick the module and paste the program below into the edit window and change the values of <your id> and <your secret> to the values obtained from the website mentioned above.


// This programm calls the aerisapi.com weather web service.
// The return value is a JSON string. Since PicoC does not support
// JSON I use scraping of the string to find the values.

enum OutputPorts
    Temperature,        // AQ1
    Humidity,            // AQ2
    windKPH             // AQ3

int GetIntValue(char *name, int def)
    int value = def;

    int pos = strfind(result, name, 0);

    if(pos > 0)
        char *stemp = calloc(1, 10);
        int lenName = strlen(name);

        strncpy(stemp, result + pos + lenName, 5);

        value = atoi(stemp);

        setoutput(Temperature, temp);

        stemp = 0;

    printf ("%s = %d", name, value);

    return value;

/// <Summary>
/// Main loop.
/// </Summary>
    char *host = "api.aerisapi.com";
    char *page = "/observations/apeldoorn,nl?client_id=<your id>&client_secret=<your secret>";

    char *result = httpget(host, page);

    if(result != 0)
        int temp = GetIntValue("\"tempC\":", -100);

        if(temp != -100)
            setoutput(Temperature, temp);

        int humidity = GetIntValue("\"humidity\":", -100);

        if(temp != -100)
            setoutput(Humidity, humidity);

        int wind = GetIntValue("\"windKPH\":", -100);

        if(temp != -100)
            setoutput(windKPH, wind);


    // Slow the loop down 10 minutes
    int sleepTime = 10 * 60 * 1000;

When you run the code in the server you will see the following in the Log. And the memory flags will show Temperature Celsius, Humidity and Wind velocity.



In October of this year (2010) we bought a house in Apeldoorn (the Netherlands). The idea in my head is to make this the most energy efficient house possible. Home automation is one of the essential things to achieve that. My investigations lead to many solutions. Once upon a time I did some X10 so started looking there. The Home Automation world goes fast. New protocols like KNX, ZigBee and Z-Wave passed by. Then my eye caught the Loxone system. It is a KNX based system but has many Extensions (DMX, EnOcean, RS232, RS485, 1-Wire) which makes it the most compatible system I could find. The EnOcean extension is very interesting. I’ve read a lot about it and got convinced that is the way to go. EnOcean is a wireless and battery less standard for Home Automation that is big business in Germany, Austria and Switzerland. In the Netherlands it is not so popular but that goes for Home Automation in general here. Big energy-neutral buildings have been equipped with EnOcean already. The combination of KNX and EnOcean makes it a very powerful solution.

In my youth I learned how to build electrical installations at School. EnOcean has a huge impact. Traditionally wiring was needed to all switches and power outlets. With EnOcean the wiring to switches becomes obsolete which means less cost during the building process and less magnetic fields in the home. One can even glue a switch to the wall. Many manufacturer deliver their switches with double-sided tape. Each outlet for light has to start and end in the distribution box which is normally not done. For existing houses this is hard if not impossible to fit later on. The advice to have empty pipes to each corner of your house needs to be revisited. They are still needed but can be a lot less with EnOcean.

If you only use the KNX wired switches you will also need piping to each switch in the home ending in the distribution box too.

The nice thing about EnOcean materials is that they are battery less too. They have developed a technology they call ‘Energy harvesting’. The energy efficient transmitters en receivers get the needed energy from their environment. Until now 3 harvesting methods have been developed.

1. Kinetic energy which is produced when you press a button.
2. Solar energy.
3. A new one is energy from temperature differences.

At the moment I am writing this article there are not yet servo controllers for radiators without batteries but my guess is that it is a matter of time.

A disadvantage of EnOcean at the moment is that it is relatively expensive in comparison to materials for other techniques. You will need to take the omission of piping and wiring into account to calculate the total cost. In our new House an extra empty pipe would cost me 45 Euros. An EnOcean switch of Eltako costs 40 Euros. For the power outlets you will still need piping and wiring.

For a long time Z-Wave was my favorite but reading about it in many blogs gave me the impression this was a failing standard. I read about lots of problems and that was something I really did not want. So I dropped Z-Wave as an alternative.

Loxone, default, supports my Sonos and several other streaming devices (Squeezebox, etc.). So less remote control head age.

06-05-2012 Bought Loxone.

Well the delivery of our home is nearing and I had to decide. Last Friday I ordered the Loxone System. It will be here in a few days (from Austria).

What I ordered is:

  • Miniserver
  • Extension module
  • Dimmer extension module
  • EnOcean extension module
  • 8 Servo controllers 0 – 10 volt
  • M30 adapters for the Servo controller on the Floor heating and Radiators (Hope they fit).
  • 3.8 A 24V Power supply

A total of 2300 Euro. That is a lot of money and I’m not finished yet.

Because Home Automation is not big in the Netherlands, finding a company that has EnOcean materials is hard. I found a company in Deventer Klusspullen.nl. They have the following brands

I mailed the Eltako dealer in the Netherlands a mail. He promptly reacted with the question “Can we test this?”. I am curious to what his intentions are. The list below is what I need specifically for our home.

Floor Location # Price Total Brand Type Extra Description
Ground floor Hallway 1 € 47,50 € 47,50 Eltako FT55 Double Switch for light in hallway and Front door.
1 € 37,50 € 37,50 Eltako FT55 Single Switch for light on the ceiling
Front room 1 € 47,50 € 47,50 Eltako FT55 Double Switch for lights on the ceiling
1 € 37,50 € 37,50 Eltako FT55 Single Switch for light on the 1st Floor hallway
1 € 90,80 € 90,80 Eltako FTR55H Thermostat
Stairway clauset 1 € 37,50 € 37,50 Eltako FT55 Single Switch for light on the ceiling
Diningroom 1 € 47,50 € 47,50 Eltako FT55 Double Switch for light on the ceiling
1 € 90,80 € 90,80 Eltako FTR55H Thermostat
First floor Hallway 1 € 37,50 € 37,50 Eltako FT55 Single Switch for light on the ceiling
1 € 37,50 € 37,50 Eltako FT55 Single Switch for light on the 2nd Floor
Bathroom 1 € 47,50 € 47,50 Eltako FT55 Double Switches for 2 lights in the Bathroom (Ceiling and washbasin.
Bedroom 1 1 € 37,50 € 37,50 Eltako FT55 Single Switch for light on the ceiling
1 € 90,80 € 90,80 Eltako FTR55H Thermostat
Bedroom 2 1 € 37,50 € 37,50 Eltako FT55 Single Switch for light on the ceiling
1 € 90,80 € 90,80 Eltako FTR55H Thermostat
Bedroom 3 1 € 37,50 € 37,50 Eltako FT55 Single Switch for light on the ceiling
1 € 90,80 € 90,80 Eltako FTR55H Thermostat
Second floor Attic 1 € 47,50 € 47,50 Eltako FT55 Double Switch for light on the 1st and 2nd Floor
General House 9 € 60,40 € 543,60 Eltako FTK Window/door sensors
€ 1.535,10
Tax 19,50% € 299,34
Total € 1.834,44

The prices are the Eltako catalog prices. It costs a lot all together. Especially the Thermostats, Presence-sensors (not yet in the list) and Window/Door sensors make it expensive. Without these components it would be a lot cheaper but then the system would not be energy-efficient. In that case it is only luxury and the system will not finance itself over time. I estimate that energy reduction is about 20% on electricity and heating. My return on investment will be about 12 to 13 years. We do not only look at this economically but also the environmental aspect is important. We want to invest into our worlds future and then money becomes less important.

After careful considering piping and wiring for our new home I still made a mistake. I had asked for empty pipes to all rooms for wired presence sensors which I dismissed in the very end. I should not have done that. EnOcean sensors are much more expensive then the KNX wired ones. The Bathroom still has to be build and since it is a central room on the second floor I can reach most of the rooms from there. We will have to do that ourselves after the house is delivered.


The Loxone System has arrived a week ago.



The date for delivery of the house is set on june 6th. Take a close look. On the inside of the lid of the box a resistor is taped. You’ll need that to terminate the Loxone bus.

18-05-2012 Test setup


I did a test today with the Loxone System. At ‘Besselink’ in Arnhem I bought a Eltako switch which enables me to test the system. I had read a lot before buying and that payed off. I was able to connect all modules in less then 2 hours and then the excitement, did I do it correctly.

A problem I did not anticipate is that the Loxone system is tested before delivery (which is a good thing of course). But during testing a test setup is installed on the MiniServer that does (of course) not correspond with my setup. So at the first start all modules started blinking orange (except for the MiniServer). It took me a while to understand the software and load a correct setup into the MiniServer. After that all modules started blinking green (hurray) and I was able to do my first tests.

The software of Loxone is very extensive. In principal you can bind any input to any output. Not that this is what you would want in the end but in a test situation it’s nice to play around a bit Glimlach I have reached the point that I am starting to understand the full potential of my new Home Automation system and it is big.

20-5-2012 Eltako

It is very easy to transform the FT55 double switch it into a single one. On the left you see the double switch configuration and on the right the switch cover for the single switch.


Here is the switch as configured into one switch.


21-05-2012 Translated the article into English

08-06-2012 House owner

Since 6 June we are the proud owners of a nice house in Apeldoorn. Today I brought my test installation to the electrician that is going to install the system. The idea is that the current installation is completely replaced by a new one. He can do all the preparations at home. The first changes to the electrical system have already been done in the house. It is getting exciting now.

20-06-2012 Loxone installed

The installation of the system is taking its form. Here are a few pictures of the installation of the system by Henk Kooiman (in the picture) an independent electrician contracted by Rene vd Kamp (Van de Kamp Electrotechniek). The cabinet is, very professionally, equipped by Geyer (http://www.geyer.nl/).