From 5c3e3c751889e458aaed889b5415dee2186fc98a Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Mon, 12 Jan 2009 09:21:53 +0000 Subject: [PATCH] New version from Martin git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@325 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- contrib/getstate/99_getstate.pm | 2 +- contrib/getstate/README.getstate | 64 ++++++++++++++++++++------------ contrib/getstate/fhem-getstate | 35 ++++++++++------- 3 files changed, 64 insertions(+), 37 deletions(-) diff --git a/contrib/getstate/99_getstate.pm b/contrib/getstate/99_getstate.pm index 09c9ce4d9..9b70d5175 100644 --- a/contrib/getstate/99_getstate.pm +++ b/contrib/getstate/99_getstate.pm @@ -1,6 +1,6 @@ ################################################################ # -# $Id: 99_getstate.pm,v 1.1 2008-12-28 14:43:45 rudolfkoenig Exp $ +# $Id: 99_getstate.pm,v 1.2 2009-01-12 09:21:53 rudolfkoenig Exp $ # # Copyright notice # diff --git a/contrib/getstate/README.getstate b/contrib/getstate/README.getstate index c961b2351..ccd24c218 100644 --- a/contrib/getstate/README.getstate +++ b/contrib/getstate/README.getstate @@ -1,32 +1,50 @@ -getstate.pm - Copyright (c)2008 Martin Fischer +NAME + getstate.pm - Copyright (c)2008 Martin Fischer -Description: - The module getstate.pm extends FHEM to support a short status output - of a device. It is useful for monitoring the device in e.g. Cacti. +SYNOPSIS + getstate -Installation: - Copy the script 99_getstate.pm to FHEM modules directory, e.g. - 'cp 99_getstate.pm /usr/local/lib/FHEM' - and restart FHEM. +DESCRIPTION + The module getstate.pm extends FHEM to support a short status output of + a device. It is useful for monitoring the device in e.g. Cacti. -Usage: - getstate +INSTALLATION + Copy the script 99_getstate.pm to FHEM modules directory, e.g. - Output a short string of the "READINGS" for . + 'cp 99_getstate.pm /usr/local/lib/FHEM' - Example for a FS20-Device: - FHZ> getstate EG.sz.SD.Tv - state:0 + and restart FHEM. - Example for a FHT-Device: - FHZ> getstate EG.wz.HZ - actuator:0 day-temp:21.5 desired-temp:21.5 lowtemp-offset:4.0 [...] +EXAMPLES + Output a short string of the "READINGS" for . - Example for a KS300/555-Device: - FHZ> getstate GH.ga.WE.01 - humidity:93 israining:0 rain:207.8 rain_raw:815 temperature:5.1 [...] + Example for a FS20-Device: + FHZ> getstate EG.sz.SD.Tv + state:0 - Example for a HMS-Device: - FHZ> getstate NN.xx.RM.01 - smoke_detect:0 + Example for a FHT-Device: + FHZ> getstate EG.wz.HZ + actuator:0 day-temp:21.5 desired-temp:21.5 lowtemp-offset:4.0 [...] + + Example for a KS300/555-Device: + FHZ> getstate GH.ga.WE.01 + humidity:93 israining:0 rain:207.8 rain_raw:815 temperature:5.1 [...] + + Example for a HMS-Device: + FHZ> getstate NN.xx.RM.01 + smoke_detect:0 + +CONTRIB + You can use the example script contrib/fhem-getstate as a "Data Input + Method" for your Cacti graphs. + +LEGALESE + License GPLv3+: GNU GPL version 3 or later + . + + This is free software: you are free to change and redistribute it. There + is NO WARRANTY, to the extent permitted by law. + +AUTHOR + Copyright (C) 2008 Martin Fischer diff --git a/contrib/getstate/fhem-getstate b/contrib/getstate/fhem-getstate index 9e196bdb0..114265971 100755 --- a/contrib/getstate/fhem-getstate +++ b/contrib/getstate/fhem-getstate @@ -1,29 +1,38 @@ #!/bin/bash # -# fhem-getstate script for reading / writing DigiTemp values -# Copyright (C) 2008 Martin Fischer . All rights reserved. +# $Id: fhem-getstate,v 1.2 2009-01-12 09:21:53 rudolfkoenig Exp $ # -# License GPLv3+: GNU GPL version 3 or later +# Copyright notice # -# This is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# any later version. +# (c) 2008 Copyright: Martin Fischer (m_fischer at gmx dot de) +# All rights reserved # -# This source is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - +# This script free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# The GNU General Public License can be found at +# http://www.gnu.org/copyleft/gpl.html. +# A copy is found in the textfile GPL.txt and important notices to the license +# from the author is found in LICENSE.txt distributed with these scripts. +# +# This script is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +################################################################ NCAT=`which netcat` HOST="localhost" PORT="7072" +VERS="$Revision: 1.2 $" # Functions function version { - echo "fhem-getstate, Version 1.0 + echo "fhem-getstate, Version$VERS Copyright (C) 2008 Martin Fischer License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it.