FHEM Widget Sync Service

FHEM Widget provides a sync service which consists of a small java client that connects to your FHEM instance, A sync server on AWS and the FHEMWidget App. When activated, the app tries to obtain all data locally at first. In case the local connection cannot be established, it switches to the server.

Server communication is ssl encrypted and uses basic authentication with private credentials towards the server.

Setup the App

Setup in the App is easy, go to Settings -> PushSync and activate the sync. The token is used to identify your FHEM instance on the sync server and must also be placed in your FHEM.
To synchronize more devices with one FHEM instance, copy this token to all devices.

Setup FHEM

On FHEM side, add the following lines to your fhem.cfg:

#fhemWidget sync token
define fhem_widget_sync_token dummy
set fhem_widget_sync_token <your_token_from_the_app>

On a machine that can access your FHEM as well as the internet run the following script (edit the pathes).

#!/bin/sh
while true; do
rm path/to/FHEM_Sync_Client.jar
echo "Lade Client"
wget https://tasior.info:42333/FHEM_Sync_Client.jar /path/to/
echo "Starte FHEMSyncClient"
java -jar FHEM_Sync_Client.jar -v -url=http://localhost:8083
echo "Beendet. Oder Gestorbern. Egal, hauptsache es gibt eine neue Version"
done

This script downloads the client and runs. The client exits as soon as its version is lower than expected from the server. This is why we run it in a loop including the download to keep it updated remotely. The client accepts the following arguments:

-v          verbose
-url=<url>  URL:port of your FHEM instance. e.e. -url=http://localhost:8083

That should be it.

Tip

I run the script in a detached screen environment using

screen -dmS FHEMSyncClient /bin/sh <name_of_script>

Disclaimer

The service is still in beta and subject to change. The process of setting everything up will be smoothed out. Automatic adding to the FHEM will be introduced. Then the AWS cost will be monitored and eventually the service will cost a small fee. Please feel free to feed back any issues or ideas.
Also it would be interesting to hear a potential monthly fee you would be willing to pay in case you would want to use the service

IMPRESSUM