From 4fbe4e4f21134701baf70198d648556e921f947a Mon Sep 17 00:00:00 2001 From: fhemzap <> Date: Sun, 11 Oct 2015 10:48:38 +0000 Subject: [PATCH] HMCCU: Added example script in readme file for calling FHEM commands from CCU git-svn-id: https://svn.fhem.de/fhem/trunk@9433 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/HMCCU/HMCCU_README.txt | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/fhem/contrib/HMCCU/HMCCU_README.txt b/fhem/contrib/HMCCU/HMCCU_README.txt index 2f7f1d91e..b3fc3435a 100644 --- a/fhem/contrib/HMCCU/HMCCU_README.txt +++ b/fhem/contrib/HMCCU/HMCCU_README.txt @@ -11,12 +11,16 @@ 1 HMCCU Introduction 1.1 HMCCU Description 1.2 HMCCU Requirements + 2 HMCCU Usage 2.1 HMCCU Set Commands 2.2 HMCCU Get Commands 2.3 HMCCU Attributes 2.4 HMCCU Parameter File +3 Executing FHEM commands on CCU + + ------------------------------------ 1 HMCCU Introduction ------------------------------------ @@ -188,3 +192,39 @@ The format of a parfile entry is: Empty lines and lines starting with a '#' are ignored. + +------------------------------------ + 3 Executing FHEM commands on CCU +------------------------------------ + +It's possible to execute FHEM commands from CCU via the FHEM telnet port. +The following shell script encapsulates the necessary commands. It can +be placed somewhere under /etc/config/addons directory in CCU. The script +requires the installation of the netcat command (nc) on CCU (search for +the binary in google and install it somewhere in /etc/config/addons). + +--- Script --- +#!/bin/sh + +# Set name or IP address and port of FHEM server +FHEM_SERVER="myfhem" +FHEM_PORT=7072 + +# Set path to nc command +NCCMD="/etc/config/addons/scripts" + +if [ $# -ne 1 ]; then + echo "Usage: $0 Command" + exit 1 +fi + +echo -e "$1\nquit\n" | $NCCMD/nc $FHEM_SERVER $FHEM_PORT + +--- End of script --- + +The script should be called from a CCU program by using the CUXD exec object. +If FHEM command contains blanks it should be enclosed in double quotes. + + +*** Have fun! zap *** +