Show a Calendar from FHEM Data

I recently bought a new router (AVM Fritzbox 7390) since my older router doesn’t support 802.11n and didn’t have an integrated dsl modem. Shortly after, I visited the tradeshow Cebit where home automation was a big topic. I’m always trying to find new ways to make life easier and home automation has been a long standing dream of mine. Visiting AVM’s booth I noticed they are also pushing towards giving their routers home automation capabilities. In the meantime, their labs firmware incorporates FHEM, an open source home automation server based on perl. Immediately I ordered the required USB device to connect wireless home automation devices and a control unit for a radiator.

Installing went fine, I was able to reach fhem via http://fritz.box:8083/fhem/. While it was pretty cool to be able to control my radiator via mobile phone, this does not relieve me of needing to control my heating schedule. Ultimately, I want my radiators to know if I am home or not, when I come back and maybe even what room I am in. This requires a lot of work so I decided to start small.

I use a FHT80b to control my radiator, which supports automatically setting the temperature in two intervals per weekday. I then created a module for fhem which reads this schedule and transforms it into recurring events in the ical (rfc5545) format. This is readable by your favorite calendar client, mine is obviously the Lightning extension to Thunderbird. The first version of this module is merely read-only, but support for actually changing the schedule is planned.

  1. Get the module from my github repository. You should save it in your fhem module directory, i.e /usr/share/fhem/FHEM/. If you are also using a Fritzbox it will be here.
  2. Add the line define ICS FHEMICS to your fhem.cfg
  3. Make fhem reload your config (i.e kill -HUP $pid, telnet host 7072 and rereadconfig, or restart your Fritzbox)
  4. Now you should be able to subscribe to http://fhemhost:8083/fhem/fhem.ics
  5. The FHT80b doesn’t advertise the weekly schedule by itself, so it needs to be initialized. Use the control unit and cycle through each day’s heating schedule.
  6. It takes a while until all commands are transmitted (1% bandwith usage regulation enforced by most 868Mhz devices)

If you’d like more options, please take a look at the module file itself. If you are not seeing events, the following commands are available via the telnet interface of fhem:

telnet fhemhost 7072
list FHT_1234    # lists the readings of your FHT device called FHT_1234.
                 # If you are missing readings like "mon-from1" or "fri-to2"
                 # then the FHT has not transmitted its schedule.
list             # Shows all defined devices, make sure there is a FHEMICS device
list ICS         # Show state information about the ICS device.
get ICS          # Retrieves the ics stream. This should contain more than 2 lines.

If you find a bug, please report at github.

6 thoughts on “Show a Calendar from FHEM Data

  1. Nice FHEM module!

    You told:
    >If you find a bug, please report at github.

    Is it possible to report without creating an account at github.com? If not it may be better to report to Google groups “FHEM users” (home of FHEM users). I do not like to create another account (too much accounts already)…………….

    • I believe github allows openid login, so you can probably use other accounts to post. I read the fhem users group too, so I’ll likely respond to bug reports there too. An Email or comment here is fine too.

  2. You wrote
    “6. It takes a while until all commands are transmitted (1% bandwith usage regulation enforced by fhem)”

    This usage regulation is not enforced by FHEM. It is enforced by the firmware of the CUL device and also by all other 868 devices like ELV FHT-80b. Reasons are the official regulations in Europe of the 868 Mhz band.

Leave a reply to Andreas Schaller (@AndreasSchaller) Cancel reply