App: FHEM App

Hi everybody,

currently I am working on an app that connects to a FHEM home automation server. The purpose is to get easy access to devices configured there without having knowledge about internals (like URLs to be called). It is in BETA state at the moment and the development is still going on. If anybody is interested to test it and provide feedback/ideas, thanks in advance!

The app can be found here:

https://apps.garmin.com/en-US/apps/8...3455908071d6#0

Prerequisites:

- running FHEM home automation server with a secure (https) connection: this is a limitation in Garmin Connect (based on changes from Apple), where data can only be downloaded from secure servers. Referring to the Commandref here are the steps to follow to set up HTTPS access for FHEM:

HTTPS
Enable HTTPS connections. This feature requires the perl module IO::Socket::SSL, to be installed with cpan -i IO::Socket::SSL or apt-get install libio-socket-ssl-perl; OSX and the FritzBox-7390 already have this module.
Set the FHEMWEB attribute "HTTPS" to 1.
A local certificate has to be generated into a directory called certs, this directory must be in the modpath directory, at the same level as the FHEM directory.

  • mkdir certs
    cd certs
    openssl req -new -x509 -nodes -out server-cert.pem -days 3650 -keyout server-key.pem


A self signed certificate seems to be not enough to work with Garmin devices. At least my try to make it work didn't succeed. If anybody else has made it run, please post the necessary steps, thanks!

- this module file 2766.98_JsonDetails.zip: FHEM does not provide a good rest interface for apps like this, so I have written a small module to give exactly the data the Watch App needs. It does not do any complex magic, it simply generates necessary data in JSON format. Copy the file to the "fhem/FHEM" folder and restart FHEM, that's all.
- csrfToken needs to be either deactivated or set to a static string for the used FHEMWEB instance (see csrfToken-attribute in commandref)
- device with "webCmd" attribute: every device with a "webCmd" attribute is shown in the Watch App. Currently command lists, sliders, RGB colorpickers, HSV color pickers, sliders for hue, saturation and brightness, selectnumbers, select and time values are supported. I am interested in adding more command types but need some feedback from users what kind of commands they are using.