perl fhem.pl fhem.cfg
attr global logfile log/fhem.log
attr global modpath .
attr global statefile log/fhem.save
attr global verbose 3
define telnetPort telnet 7072 global
define WEB FHEMWEB 8083 global
Note: the last two lines are optional and assume you wish to use the
builtin telnet and WEB interface.telnet <fhemhost> 7072
<NL> (This newline switches into "prompt" mode)
<command>...
quitfhem.pl <fhemhost>:7072 "<command>..."
set lamp1 onset lamp1,lamp2,lamp3 onset lamp[1-3] onset lamp.* onset lamp1-lamp3 onset lamp1-lamp3,lamp3 onset room=kitchen offlist disabled=list TYPE=FS20?helpattr <devspec> <attrname> [<value>]
<reading>[:<trigger>] [<modifier>] { <perl code> }
{ <perl code>
} for all definitions and setting the value of the respective
user-defined reading <reading> to the result. If
<trigger> is given, then all processing for this specific user
reading is only done if one of the just updated "reading: value"
combinations matches <trigger>, which is treated as a regexp.
attr myEnergyMeter userReadings energy
{ ReadingsVal("myEnergyMeter","counters.A",0)/1250.0;; }
attr myMultiMeter userReadings
energy1:counters.A { ReadingsVal("myMultiMeter","counters.A",0)/1250.0;; },
energy2:counters.B { ReadingsVal("myMultiMeter","counters.B",0)/1250.0;; }
<modifier> can take one of these values:
attr myPowerMeter userReadings power
differential { ReadingsVal("myPowerMeter","counters.A",0)/1250.0;; }
attr global verbose 3attr lamp room kitchenattr lamp group lightsattr lamp loglevel 6attr weatherstation event-on-update-reading wind,temperature,humidityattr weatherstation event-on-change-reading israiningattr weatherstation event-on-change-reading israining,stateattr heating stateFormat Temp:measured-temp, Valve:actuatorsetdefaultattr [<attrname> [<value>]] setdefaultattr room kitchensetdefaultattr loglevel 4define lamp1 FS20 1234 11define lamp2 FS20 1234 12define lamp3 FS20 1234 13setdefaultattrdefine <name> <type> <type-specific>delete <devspec> delete lampdeleteattr <devspec> [<attrname>] deleteattr lamp follow-on-for-timerdeleteattr lampdeletereading <devspec> <readingname> deletereading mySensor temp1deletereading mySensor temp\d+get <devspec> <type-specific>
get <device> ?
getstate <devspec>
getstate lamp
state:1
getstate fl
ack:0 actuator:2 day-temp:21.5 desired-temp:22.5 [...] measured-temp:22.9 [...]
include <filename> inform {on|off|timer|raw} [regexp] list [devspec] [value]
fhem> list
Type list for detailed info.
Internal:
global (Internal)
FHZ:
FHZ (fhtbuf: 23)
FS20:
Btn4 (on-old-for-timer)
Roll1 (on)
Stehlampe (off)
FHT:
fl (measured-temp: 21.1 (Celsius))
KS300:
out1 (T: 2.9 H: 74 W: 2.2 R: 8.2 IR: no)
at:
at_rollup (Next: 07:00:00)
notify:
ntfy_btn4 (active)
FileLog:
avglog (active)
If specifying name, then a detailed status for name
will be displayed, e.g.:
fhem> list fl
Internals:
CODE 5102
DEF 5102
NAME fl
NR 15
STATE measured-temp: 21.1 (Celsius)
TYPE FHT
IODev FHZ
Attributes:
room Heizung
Readings:
2006-11-02 09:45:56 actuator 19%
[...]
modify <name> <type-dependent-options>
define lampon at 19:00 set lamp onmodify lampon *19:00modify lampon 19:00 set lamp on-for-timer 16quit
quit
reload <module>
reload 99_PRIV
rename <oldname> <newname>
rename FHT_1234 fht.kitchen
rereadcfg [fhem-config-file]
rereadcfg
save [<configfile>]
set <devspec> <type-specific>
set <name> ?
set switch on-for-timer 12.5
set switch on-till {sunset()}
set switch blink 3 1
set switch intervals 08:00-12:00 13:00-18:00
setstate <devspec> <value>
<name> as shown in paranthesis in the
list command
to <value> without sending any signals to the device
itself. This command is also used in the statefile.
See the Device specification section for details on
<devspec>.
shutdown [restart]
shutdownshutdown restart
trigger <devspec> <state>
trigger btn3 on
sleep <sec>
sleep 0.5define n3 notify btn3.* set lamp toggle;;sleep 0.5;;set lamp toggle
"/etc/fhem.cfg /var/log/fhem/fhem.save /usr/share/fhem/contrib
/usr/share/fhem/FHEM /usr/share/fhem/foo /usr/share/fhem/foobar
/usr/share/fhem/www"
archivecmd / archivedir / nrarchive attributes to the
global device as you would do for a FileLog device.{ $currlogfile }.
FHEM. The path
does not contain the directory FHEM. Upon setting the
attribute, the directory will be scanned for filenames of the form
NN_<NAME>.pm, and make them available for device definition under
<NAME>. If the first device of type <NAME> is defined, the
module will be loaded, and its function with the name
<NAME>_Initialize will be called. Exception to this rule are
modules with NN=99, these are considered to be utility modules
containing only perl helper functions, they are loaded at startup (i.e.
modpath attribute definition time).
define <name> ALL3076 <ip-address>
define lamp1 ALL3076 192.168.1.200set <name> <value>
value is one of:
dimdown
dim10%
dim20%
dim30%
dim40%
dim50%
dim60%
dim70%
dim80%
dim90%
dim100%
dim[0-100]%
dimup
off
on
toggle
Examples:
set lamp1 onset lamp1 dim11%set lamp2 toggledefine <name> ALL4000T <ip-address> <port> <delay>
define AUSSEN.POOL.TEMP.vorlauf ALL4000T 192.168.68.20 t2 120define <name> ALL4027 <ip-address> <port> <relay_nr> <delay>
define lamp1 ALL4027 192.168.8.200 0 7 60set <name> <value>
value is one of:
off
on
on-for-timer <Seconds>
toggle
Examples:
set poolpump onbrightness) and
the brightness in lux (reading lux). The flags
reading is always zero. The meaning of these readings is explained in more
detail on the above mentioned wiki page.define <name> BS <sensor#> [<RExt>]
<sensor#> is the number of sensor in the brightness
sensor address system that runs from 1 to 9.<RExt> is the value of the resistor on your brightness
sensor in Ω (Ohm). The brightness reading in % is proportional to the resistance, the
lux reading is proportional to the resistance squared. The value is
optional. The default resistance is RExt= 50.000Ω.define bs1 BS 1 40000define <name> CM11 <serial-device>
define <name> FHZ <serial-device> strangettydefine x10if CM11 /dev/ttyUSB3set <name> reopen
get <name> fwrev
error
if the serial connection to the device times out. Can be used for error
detection.
get <name> time
error
if the serial connection to the device times out. Can be used for error
detection.
|
The CUL/CUR/CUN is a family of RF devices sold by busware.de.
With the opensource firmware (see this link) they are capable
to receive and send different 868MHz protocols (FS20/FHT/S300/EM/HMS).
It is even possible to use these devices as range extenders/routers, see the
CUL_RFR module for details.
Some protocols (FS20, FHT and KS300) are converted by this module so that the same logical device can be used, irrespective if the radio telegram is received by a CUL or an FHZ device. Other protocols (S300/EM) need their own modules. E.g. S300 devices are processed by the CUL_WS module if the signals are received by the CUL, similarly EMWZ/EMGZ/EMEM is handled by the CUL_EM module. It is possible to attach more than one device in order to get better reception, fhem will filter out duplicate messages. Note: this module may require the Device::SerialPort or Win32::SerialPort module if you attach the device via USB and the OS sets strange default parameters for serial devices. |
|
define <name> CUL <device> <FHTID> fhtbuf returns the free memory in this buffer (in hex),
an empty buffer in the CUL-V2 is 74 bytes, in CUL-V3/CUN 200 Bytes.
A message occupies 3 + 2x(number of FHT commands) bytes,
this is the second reason why sending multiple FHT commands with one
set is a good idea. The first reason is, that
these FHT commands are sent at once to the FHT.
2012-05-17 09:44:22.515 CUL CULHM RCV L:0B N:81 CMD:A258 SRC:...... DST:...... 0000 (TYPE=88,WAKEMEUP,BIDI,RPTEN)
define <name> CUL_EM <code> [corr1 corr2
CostPerUnit BasicFeePerMonth]
define emwz 1 75 900 0.15 12.50
CUM_DAY: 6.849 CUM: 60123.4 COST: 1.02
CUM_MONTH: 212.319 CUM: 60123.4 COST: 44.34
define <name> CUL_FHTTK <devicecode>
<devicecode> is a six digit hex number, given to the FHT80 TF during
production, i. e. it is not changeable. (Yes, it keeps this code after changing batteries
as well.)define TK_TEST CUL_FHTTK 965AB0
define <name> CUL_HM <6-digit-hex-code|8-digit-hex-code>
define livingRoomSwitch CUL_HM 123456
define LivingroomMainLight CUL_HM 12345601
define LivingroomBackLight CUL_HM 12345602
set mydimmer getRegRaw List1
set mydimmer getRegRaw List3 all
# Block operation
set keymatic inhibit on
set myChannel peerBulk 12345601,
set myChannel peerBulk self01,self02,FB_Btn_04,FB_Btn_03,
set myChannel regBulk RegL_00: 02:01 0A:17 0B:43 0C:BF 15:FF 00:00
RegL_03:FB_Btn_07
01:00 02:00 03:00 04:32 05:64 06:00 07:FF 08:00 09:FF 0A:01 0B:44 0C:54 0D:93 0E:00 0F:00 11:C8 12:00 13:00 14:00 15:00 16:00 17:00 18:00 19:00 1A:00 1B:00 1C:00 1D:FF 1E:93 1F:00 81:00 82:00 83:00 84:32 85:64 86:00 87:FF 88:00 89:FF 8A:21 8B:44 8C:54 8D:93 8E:00 8F:00 91:C8 92:00 93:00 94:00 95:00 96:00 97:00 98:00 99:00 9A:00 9B:00 9C:00 9D:05 9E:93 9F:00 00:00
set myblind regBulk 01 0B:10
set myblind regBulk 01 0C:00
set regSet ? 0 0set regSet <regname> ? 0
define vRemote CUL_HM 100000 # the selected HMid must not be in use
set vRemote virtual 20 # define 20 button remote controll
set vRemote_Btn4 peerChan 0 <actorchannel> # peers Button 4 and 5 to the given channel
set vRemote_Btn4 press
set vRemote_Btn5 press long
set <name> on-till 20:32:10
set myRemote peerChan 2 mySwActChn single set #peer second button to an actuator channel
set myRmtBtn peerChan 0 mySwActChn single set #myRmtBtn is a button of the remote. '0' is not processed here
set myRemote peerChan 2 mySwActChn dual set #peer button 3 and 4
set myRemote peerChan 3 mySwActChn dual unset #remove peering for button 5 and 6
set myRemote peerChan 3 mySwActChn dual unset aktor #remove peering for button 5 and 6 in actor only
set myRemote peerChan 3 mySwActChn dual set remote #peer button 5 and 6 on remote only. Link settings il mySwActChn will be maintained
set 4Dis text 1 on On Lamp
set 4Dis text 1 off Kitchen Off
set 4Dis_chn4 text Kitchen Off
# "hello" in display, symb bulb on, backlight, beep
set cfm_Mp3 playTone 3 # MP3 title 3 once
set cfm_Mp3 playTone 3 3 # MP3 title 3 3 times
set cfm_Mp3 playTone 3,6,8,3,4 # MP3 title list 3,6,8,3,4 once
set cfm_Mp3 playTone 3,6,8,3,4 255# MP3 title list 3,6,8,3,4 255 times
set cfm_Mp3 playTone replay # repeat last sequence
set cfm_Led led redL 4 # led red blink 3 times long
set cfm_Led led redS,redS,redS,redL,redL,redL,redS,redS,redS 255 # SOS 255 times
# "hello" in display, symb bulb on, backlight, beep
set FB1 display Hello no off 1 on bulb
# "1234,5" in display with unit 'W'. Symbols scene,phone,bell and
# clock are active. Backlight flashing fast, Beep is second tone
set FB1 display 12345 comma Watt 2 fast scene,phone,bell,clock
set hm1 raw ++A001F100001234560105000000001\
++A001F10000123456010802010AF10B000C00\
++A001F1000012345601080801\
++A001F100001234560106
Recommended work-order for device 'HMdev':
set HMdev clear msgEvents # clear old events to better check flow
set HMdev getConfig # read device & channel inforamtion
# wait untill operation is complete
# protState should be CMDs_done
# there shall be no warnings amongst prot... variables
get configSave myActorFile
define <name> CUL_HOERMANNEM <10-digit-hex-code>
define IR-Dev CUL_IR CUNO1
Set
set IR-Dev irSend ButtonA001If defining an IR-Code directly the following Code-Syntax needs to be followed:
IRCode: <PP><AAAA><CCCC><FF>with P = Protocol; A = Address; C = Command; F = Flags
set IR-Dev irSend 0A07070F0F02
set IR-Dev irSend I0A07070F0F00
Button<learnprefix><learncount>
When the CUL_IR device is set into learning mode it will generate a
new button-attribute for each new IR-Code received.This is done according to the following syntax:
<Button-Attribute-Name> <IR-Code>
Examples of learnt button-attributes with EMPTY <learnprefix> and <learncount> starting from 1:
Button001 I02029A000000
Button002 I02029A000001
To make sure that something happens when this IR-code is received later on one has to modify the attribute
and to add commands as attribute values.
Examples:
Button001 I02029A000000 set WZ_Lamp on
Button002 I02029A000001 set Switch on
The syntax for this is:
attr <device-name> <attribute-name> <IR-Code> <command>
<Group-Attribute-Name> <IR-Code>
Examples of a group-attribute is:
Group001 I02029A
With this all IR-Codes starting with I02029A will match the Group001.
Button<learnprefix><learncount>
If learnprefix is empty the button-attribute-name only contains the term
"Button" and the actual number of learncount.
attr CUL0 rfmode MAX.define <name> CUL_MAX <addr>
|
The CUL_RFR module is used to "attach" a second CUL to your base CUL, and
use it as a repeater / range extender. RFR is shorthand for RF_ROUTER.
Transmission of the data uses the CC1101 packet capabilities with GFSK
modulation at 250kBaud after pinging the base CUL at the usual 1kBaud. When
configured, the RFR device can be used like another CUL connected directly to
fhem.
Before you can use this feature in fhem, you have to enable/configure RF ROUTING in both CUL's:
|
|
define <name> CUL_RFR <own-id> <base-id> set MyCUL raw ui0100set MyCUL raw ui0201define MyRFR CUL_RFR 02 01define <name> CUL_TX <code> [corr] [minsecs] define <name> CUL_WS <code> [corr1...corr4] CULflash <CUL-Name> <CUL-Version> CULflash CUL CUL_V3
CULflash none CUL_V3
define <name> Calendar ical url <URL> [<interval>]https://, the perl module IO::Socket::SSL must be installed
(use cpan -i IO::Socket::SSL).https:// and the perl module IO::Socket::SSL is not installed on your system, you can
replace it by http://.interval is the time between subsequent updates
in seconds. It defaults to 3600 (1 hour).
define MyCalendar Calendar ical url https://www.google.com/calendar/ical/john.doe%40example.com/private-foo4711/basic.ics
define YourCalendar Calendar ical url http://www.google.com/calendar/ical/jane.doe%40example.com/private-bar0815/basic.ics 86400
set <name> updateinterval seconds later.get <name> full|text|summary|location|alarm|start|end <reading>|<uid>get <name> find <regexp>A calendar event is identified by its UID. The UID is taken from the source calendar. All non-alphanumerical characters are stripped off the UID to make your life easier.
A calendar event can be in one of the following states:
| new | The calendar event was first seen at the most recent update. Either this was your first retrieval of the calendar or you newly added the calendar event to the source calendar. |
| known | The calendar event was already there before the most recent update. |
| updated | The calendar event was already there before the most recent update but it has changed since it was last retrieved. |
| deleted | The calendar event was there before the most recent update but is no longer. You removed it from the source calendar. The calendar event will be removed from all lists at the next update. |
A calendar event can be in one of the following modes:
| upcoming | Neither the alarm time nor the start time of the calendar event is reached. |
| alarm | The alarm time has passed but the start time of the calendar event is not yet reached. |
| start | The start time has passed but the end time of the calendar event is not yet reached. |
| end | The end time of the calendar event has passed. |
A calendar device has several readings. Except for calname, each reading is a semicolon-separated list of UIDs of
calendar events that satisfy certain conditions:
| calname | name of the calendar |
| all | all events |
| modeAlarm | events in alarm mode |
| modeAlarmOrStart | events in alarm or start mode |
| modeAlarmed | events that have just transitioned from upcoming to alarm mode |
| modeChanged | events that have just changed their mode somehow |
| modeEnd | events in end mode |
| modeEnded | events that have just transitioned from start to end mode |
| modeStart | events in start mode |
| modeStarted | events that have just transitioned to start mode |
| modeUpcoming | events in upcoming mode |
| stateChanged | events that have just changed their state somehow |
| stateDeleted | events in state deleted |
| stateNew | events in state new |
| stateUpdated | events in state updated |
When a calendar event has changed, an event is created in the form
changed: UID mode with mode being the current mode the calendar event is in after the change.
Usage scenarios
get MyCalendar full all
2767324dsfretfvds7dsfn3e4dsa234r234sdfds6bh874googlecom known alarm 31.05.2012 17:00:00 07.06.2012 16:30:00-07.06.2012 18:00:00 Erna for coffee
992hydf4y44awer5466lhfdsrgl7tin6b6mckf8glmhui4googlecom known upcoming 08.06.2012 00:00:00-09.06.2012 00:00:00 Vacation
text 20 60 { fhem("get MyCalendar text modeAlarmOrStart") }
07.06.12 16:30 Erna for coffee
08.06.12 00:00 Vacation
get MyCalendar find .*Erna.*
2767324dsfretfvds7dsfn3e4dsa234r234sdfds6bh874googlecom
define ErnaComes notify MyCalendar:modeStarted.*2767324dsfretfvds7dsfn3e4dsa234r234sdfds6bh874googlecom.* set MyLight on
define LogErna notify MyCalendar:modeAlarmed.*2767324dsfretfvds7dsfn3e4dsa234r234sdfds6bh874googlecom.* { Log 1, "ALARM name=%NAME event=%EVENT part1=%EVTPART0 part2=%EVTPART1" }
define SwitchActorOn notify MyCalendar:modeStarted.* {
my $reading="%EVTPART0";;
my $uid= "%EVTPART1";;
my $actor= fhem("get MyCalendar summary $uid");;
if(defined $actor) {
fhem("set $actor on")
}
}
define SwitchActorOff notify MyCalendar:modeEnded.* {
my $reading="%EVTPART0";;
my $uid= "%EVTPART1";;
my $actor= fhem("get MyCalendar summary $uid");;
if(defined $actor) {
fhem("set $actor off")
}
}
define LogActors notify MyCalendar:mode(Started|Ended).* { my $reading= "%EVTPART0";; my $uid= "%EVTPART1";; my $actor= fhem("get MyCalendar summary $uid");; Log 1, "Actor: $actor, Reading $reading" }
define <name> DbLog <configfilename> <regexp>
<configfilename> (see sample configuration file
contrib/dblog/db.conf). The configuration is stored in a separate file
to avoid storing the password in the main configuration file and to have it
visible in the output of the list command.
DBI and DBD::<dbtype>
need to be installed (use cpan -i <module>
if your distribution does not have it).
<regexp> is the same as in FileLog.
<DBType>_create.sql.
The database contains two tables: current and
history. The latter contains all events whereas the former only
contains the last event for any given reading and device.
The columns have the following meaning:
2007-12-30 21:45:22WetterstationKS300humidity: 71 (%)humidity71%yes is translated to 1
get myDbLog - - 2012-11-10 2012-11-10 KS300:temperature::
# log everything to databasedefine myDbLog DbLog /etc/fhem/db.conf .*:.*
get <name> <infile> <outfile> <from>
<to> <column_spec>
--
to check the output for plot-computing.all to get all columns from Database.YYYY-MM-DD_HH24:MI:SSget myDbLog - - 2012-11-10 2012-11-20 KS300:temperatureget myDbLog - - 2012-11-10_10 2012-11-10_20 KS300:temperature::int1get myDbLog - all 2012-11-10 2012-11-20 KS300:temperatureget myDbLog - - 2012-11-10 2012-11-20 KS300:temperature KS300:rain::delta-h KS300:rain::delta-dget myDbLog - - 2012-11-10 2012-11-20 MyFS20:data:::$val=~s/(on|off).*/$1eq"on"?1:0/egget myDbLog - - 2012-11-10 2012-11-20 Bodenfeuchte:data:::$val=~s/.*B:\s([-\.\d]+).*/$1/eg"A: 49.527 % B: 66.647 % C: 9.797 % D: 0.097 V"2012-11-20_10:23:54 66.647get <name> <infile> <outfile> <from>
<to> <device> <querytype> <xaxis> <yaxis> <savename>
-webchart
to use the charting related get function.
YYYY-MM-DD_HH24:MI:SSgetreadings to retrieve the possible readings for a given devicegetdevices to retrieve all available devicestimerange to retrieve charting data, which requires a given xaxis, yaxis, device, to and fromsavechart to save a chart configuration in the database. Requires a given xaxis, yaxis, device, to and from, and a 'savename' used to save the chartdeletechart to delete a saved chart. Requires a given id which was set on save of the chartgetcharts to get a list of all saved charts.getTableData to get jsonformatted data from the database. Uses paging Parameters like start and limit.hourstats to get statistics for a given value (yaxis) for an hour.daystats to get statistics for a given value (yaxis) for a day.weekstats to get statistics for a given value (yaxis) for a week.monthstats to get statistics for a given value (yaxis) for a month.yearstats to get statistics for a given value (yaxis) for a year.get logdb - webchart "" "" "" getchartsget logdb - webchart "" "" "" getdevicesget logdb - webchart "" "" ESA2000_LED_011e getreadingsget logdb - webchart 2013-02-11_00:00:00 2013-02-12_00:00:00 ESA2000_LED_011e timerange TIMESTAMP day_kwh[{'TIMESTAMP':'2013-02-11 00:10:10','VALUE':'0.22431388090756'},{'TIMESTAMP'.....}]get logdb - webchart 2013-02-11_00:00:00 2013-02-12_00:00:00 ESA2000_LED_011e savechart TIMESTAMP day_kwh tageskwhget logdb - webchart "" "" "" deletechart "" "" 7A physical ECMD device can host any number of logical ECMD devices. Logical devices are defined as ECMDDevices in fhem. ADC 0 to 3 and I/O port 0 to 3 of the above mentioned board are examples of such logical devices. ADC 0 to 3 all belong to the same device class ADC (analog/digital converter). I/O port 0 to 3 belong to the device class I/O port. By means of extension boards you can make your physical device drive as many logical devices as you can imagine, e.g. IR receivers, LC displays, RF receivers/transmitters, 1-wire devices, etc.
Defining one fhem module for any device class would create an unmanageable
number of modules. Thus, an abstraction layer is used. You create a device class
on the fly and assign it to a logical ECMD device. The
class definition
names the parameters of the logical device, e.g. a placeholder for the number
of the ADC or port, as well as the get and set capabilities. Worked examples
are to be found in the documentation of the ECMDDevice device.
Note: this module requires the Device::SerialPort or Win32::SerialPort module
if the module is connected via serial Port or USB.
Define
define <name> ECMD telnet <IPAddress:Port>define <name> ECMD serial <SerialDevice>[<@BaudRate>]
telnet or
serial are fixed.define AVRNETIO ECMD telnet 192.168.0.91:2701define AVRNETIO ECMD serial /dev/ttyS0define AVRNETIO ECMD serial /sev/ttyUSB0@38400set <name> classdef <classname> <filename>
<classname> for logical devices.
The class definition is in the file <filename>. You must
create the device class before you create a logical device that adheres to
that definition.
define AVRNETIO classdef /etc/fhem/ADC.classdefset <name> reopen
get <name> raw <command>
<command> to the physical ECMD device
<name> and reads the response.
params <parameter1> [<parameter2> [<parameter3> ... ]]set <commandname> cmd { <perl special> }
<commandname>.
get <commandname> cmd { <perl special> }
<commandname>.
set <commandname> postproc { <perl command> }get <commandname> postproc { <perl command> }
<commandname>.
set <commandname> params <parameter1> [<parameter2> [<parameter3> ... ]]get <commandname> params <parameter1> [<parameter2> [<parameter3> ... ]]
<commandname>. Be careful not to use a parameter name that
is already used in the device definition (see params above).
%NAME will expand to the device name (same
as @).%<parameter> will expand to the
current value of the named parameter. This can be either a parameter
from the device definition or a parameter from the set or get
command.<perl command> in the postprocessor definitions apply.
Note: Beware of undesired side effects from e.g. doubling of semicolons!
The perl command acts on $_. The result of the perl command is the
final result of the get or set command.
define <name> ECMDDevice <classname> [<parameter1> [<parameter2> [<parameter3> ... ]]]
<classname>.
define myADC ECMDDevice ADCdefine myRelais1 ECMDDevice relais 8set <name> <commandname> [<parameter1> [<parameter2> [<parameter3> ... ]]]
<commandname> definition in
the class definition.set <commandname> is invoked the perl special in curly brackets from the command definition
is evaluated and the result is sent to the physical ECMD device.
set myRelais1 onget <name> <commandname> [<parameter1> [<parameter2> [<parameter3> ... ]]]
<commandname> definition in
the class definition.get <commandname> is invoked the perl special in curly brackets from the command definition
is evaluated and the result is sent to the physical ECMD device. The response from the physical ECMD device is returned
and the state of the logical ECMD device is updated accordingly.
get myADC value 3/etc/fhem/ADC.classdef looks as follows:
get value cmd {"adc get %channel"}
get value params channel
define AVRNETIO ECMD telnet 192.168.0.91:2701 # define the physical device
set AVRNETIO classdef ADC /etc/fhem/ADC.classdef # define the device class ADC
define myADC ECDMDevice ADC # define the logical device myADC with device class ADC
get myADC value 1 # retrieve the value of analog/digital converter number 1
get value has one named parameter
channel. In the example the literal 1 is given and thus %channel
is replaced by 1 to yield "adc get 1" after macro substitution. Perl
evaluates this to a literal string which is send as a plain ethersex command to the AVR-NET-IO. The
board returns something like 024 for the current value of analog/digital converter number 1.
/etc/fhem/relais.classdef looks as follows:
params pinmask
set on cmd {"io set ddr 2 ff\nioset port 2 0%pinmask\nwait 1000\nio set port 2 00"}
set on postproc {s/^OK\nOK\nOK\nOK$/success/; "$_" eq "success" ? "ok" : "error"; }
define AVRNETIO ECMD telnet 192.168.0.91:2701 # define the physical device
set AVRNETIO classdef relais /etc/fhem/relais.classdef # define the device class relais
define myRelais ECMDDevice 8 # define the logical device myRelais with pin mask 8
set myRelais on # execute the "on" command
%pinmask
is replaced by 8 to yield
"io set ddr 2 ff\nioset port 2 08\nwait 1000\nio set port 2 00" after macro substitution. Perl
evaluates this to a literal string. This string is split into lines (without trailing newline characters)
- io set ddr 2 ff
- ioset port 2 08
- wait 1000
- io set port 2 00
These lines are sent as a plain ethersex commands to the AVR-NET-IO one by one. Each line is terminated with
a newline character unless the nonl attribute of the ECMDDevice is set. After
each line the answer from the ECMDDevice is read back. They are concatenated with newlines and returned
for further processing, e.g. by the postproc command.
For any of the four plain ethersex commands, the AVR-NET-IO returns the string OK. They are
concatenated and separated by line breaks (\n). The postprocessor takes the result from $_,
substitutes it by the string success if it is OK\nOK\nOK\nOK, and then either
returns the string ok or the string error.
define <name> EIB <main group> [<additional group> ..]
define lamp1 EIB 0/10/12define lamp1 EIB 0/10/12 0/0/5define lamp1 EIB 0A0Cset <name> <value> [<time> g<groupnr>]define <name> EM <em1010pc-device>
define em EM /dev/elv_em1010pcset EM <value>
value is either time or reset.get EM <value>
value is either version or time.
define <name> EMEM <device-number>
define emem EMEM 5get EMEM status
define <name> EMGZ <device-number>
define emgz EMGZ 9set EMGZdevice <param> <value>get EMGZ status
define <name> EMWZ <device-number>
define emwz EMWZ 1set EMWZdevice <param> <value>get EMWZ status
define <name> ESA2000 <code>
[base1 base2] attr <name> blockSenderID own
to block receiving telegrams with a TCM SenderIDs.
define <name> EnOcean <def>
define switch1 EnOcean ffc54500get <tcm> baseID command
for the BaseID. You can use up to 127 IDs starting with the BaseID + 1 shown there.
The BaseID is used for A5 devices with a bidectional teach-in only. If you
are using an Fhem SenderID outside of the allowed range, you will see an
ERR_ID_RANGE message in the Fhem log.set <name> pairForSec <t/s>
name is the name of the TCM Module . t/s is the
time for the teach-in period.
set TCM_0 pairForSec 600
set <name> <value>
value is one of A0, AI, B0, BI, C0, CI, D0, DI,
combinations of these and released. First and second action can be sent
simultaneously. Separate first and second action with a comma.on and off
mappings.
set switch1 BI
set switch1 B0,CI
attr eventMap BI:on B0:off
set switch1 on
set <name> <value>
value is
set <name> <value>
value is
set <name> <value>
value is
set <name> <value>
value is
set <name> <value>
value is
set <name> <value>
value is
set <name> <value>
value is
set <name> <value>
value is
set <name> <value>
value is
set <name> <value>
value is
set <name> <value>
value is
set <name> <value>
value is
set <name> <value>
value is
get <tcm> idbase" command. You can use
up to 128 IDs starting with the base shown there.direction switch on/off commands are
accepted, e. g. B0, BI, released. Fhem can control an device with this
sensor type unique. This is the default function and should be
preferred.universal switch
or pushbutton. With a Fhem command, for example,
B0 or BI is switched between two states. In this case Fhem cannot
control this device unique. But if the Attribute switchType
is set to universal Fhem synchronized with
a bidirectional device and normal on/off commands can be used.
If the bidirectional device response with the channel B
confirmation telegrams also B0 and BI commands are to be sent,
e g. channel A with A0 and AI. Also note that confirmation telegrams
needs to be sent.central two different SenderID
are required. In this case set the Attribute switchType to
central and define the Attributes
subDef0 and subDefI.
set <name> dim <value>.define <name> FBAHA <device>
define fb1 FBAHA fritz.box:2002define fb1 FBAHA UNIX:SEQPACKET:/var/tmp/me_avm_home_external.ctldefine <name> FBDECT <homeId> <id> [classes]
define lamp FBDECT 16 switch,powerMeter#96*5* - for activating
#96*4* - for deactivating
define <name> FB_CALLMONITOR <ip-address>[:port]define <name> FHEM2FHEM <host>[:<portnr>][:SSL] [LOG:regexp|RAW:devicename] {portpassword}
define ds1 FHEM2FHEM 192.168.178.22:7072 LOG:.*define RpiCUL CUL none 0000define ds2 FHEM2FHEM 192.168.178.22:7072 RAW:RpiCULrename CUL_0 RpiCULdefine <name> FHEMWEB <tcp-portnr> [global]
set <name> rereadicons
get myFHEMWEB icon FS20.on
/data/Homeautomation/fhem/FHEM/FS20.on.png
attr WEB basicAuth { "$user:$password" eq "admin:secret" }
attr WEB basicAuth {use FritzBoxUtils;;FB_checkPw("localhost","$password") }
or if you defined multiple users on the Fritzbox:
attr WEB basicAuth {use FritzBoxUtils;;FB_checkPw("localhost","$user", "$password") }
define <name> FHT <housecode>
<housecode> is a four digit hex number,
corresponding to the address of the FHT80b device.
define wz FHT 3232set <name> <valuetype> <value>
value is one of:
desired-temp
day-temp night-temp
report1 report2
refreshvalues
mode
holiday1 holiday2 # see mode holiday_short or holiday
manu-temp # No clue what it does.
year month day hour minute
time date
lowtemp-offset # Alarm-Temp.-Differenz
windowopen-temp
mon-from1 mon-to1 mon-from2 mon-to2
tue-from1 tue-to1 tue-from2 tue-to2
wed-from1 wed-to1 wed-from2 wed-to2
thu-from1 thu-to1 thu-from2 thu-to2
fri-from1 fri-to1 fri-from2 fri-to2
sat-from1 sat-to1 sat-from2 sat-to2
sun-from1 sun-to1 sun-from2 sun-to2
set wz desired-temp 22.5set fl desired-temp 20.5 day-temp 19.0 night-temp 16.0measured-temp actuator actuator1...actuator8
warningsfhtbuf entry in the
get section.*-temp values need a temperature
as argument, which will be rounded to 0.5 Celsius.mode is one of auto, manual, holiday or
holiday_short.set FHT1 mode holiday holiday1 24 holiday2 12 desired-temp 14
*-from1/*-from2/*-to1/*-to2 valuetypes need a time
spec as argument in the HH:MM format. They define the periods, where
the day-temp is valid. The minute (MM) will be rounded to 10, and
24:00 means off.define fht_sync at +*3:30 set TYPE=FHT time
report1 with parameter 255 requests all settings for
monday till sunday to be sent. The argument is a bitfield, to request
unique values add up the following:
report2 with parameter 255 requests the following
settings to be reported: day-temp night-temp windowopen-temp
lowtemp-offset desired-temp measured-temp mode warnings.
The argument is (more or less) a bitfield, to request unique values
add up the following:
lowtemp-offset needs a temperature as argument, valid
values must be between 1.0 and 5.0 Celsius.desired-temp - measured-temp >
lowtemp-offset in a room for at least 1.5 hours after the last
desired-temp change.desired-temp,mode,report1,report2,
holiday1,holiday2,day-temp,night-temp, [all other commands]
retrycount times if after 240 seconds
no confirmation message is received from the corresponding FHT
device.define <name> FHT <housecode> [IODev]
<housecode> is a four digit hex number,
and must have the following relation to the housecode of the corresponding CUL
device:
<IODev> must be specified if the last defined CUL device
is not the one to use. Usually this is done voa the IODev attribute, but as the address checked is performed
at the definition, we must use an exception here.
define wz FHT8V 3232define <name> FHZ <serial-device> define
<name> FHZ <serial-device> strangettyset FHZ <variable> [<value>]
value is one of:define fhz_timer at +*00:01:00 set FHZ timeset FHZ initfullset FHZ reopeninitfull issues the initialization sequence for the FHZ
device:
get FHZ init2
get FHZ serial
set FHZ initHMS
set FHZ initFS20
set FHZ time
set FHZ raw 04 01010100010000
reopen closes and reopens the serial device port. This
implicitly initializes the FHZ and issues the
initfull command sequence.stopHMS probably is the inverse of initHMS
(I don't have authoritative info on what exactly it does).close closes and frees the serial device port until you open
it again with open, e.g. useful if you need to temporarily
unload the ftdi_sio kernel module to use the bit-bang mode.get FHZ <value>
value is one of:list FHZ
fhtbuf returns the free memory in this buffer (in hex),
an empty buffer in the FHZ1000 is 2c (42 bytes), in the FHZ1300 is 4a
(74 bytes). A message occupies 3 + 2x(number of FHT commands) bytes,
this is the second reason why sending multiple FHT commands with one
set is a good idea. The first reason is, that
these FHT commands are sent at once to the FHT.
define <name> FLOORPLAN
define Groundfloor FLOORPLAN
fp_Groundfloor.png
attr lamp1 fp_Groundfloor 100,100 | #display lamp1 with icon only at screenposition 100,100 |
attr lamp2 fp_Groundfloor 100,140,1,Art-Deco | #display lamp2 with description 'Art-Deco-Light' at 100,140 |
attr lamp2 fp_FirstFloor 130,100,1 | #display the same device at different positions on other floorplans |
attr myFHT fp_Groundfloor 300,20,10,Temperature | #display given Text + FHT-temperature |
attr Groundfloor fp_arrange 1attr Groundfloor fp_arrange detail #displays the devices with infos room, type, aliasattr Groundfloor fp_arrange WEB #activates arrange mode for frontend-device WEB onlyfloorplanstyle.css. If the stylesheetPrefix is set for the corresponding FHEMWEB instance, this same
stylesheetPrefix is also prepended to the stylesheet for floorplans.floorplanstyle.css in the same folder.attr Groundfloor stylesheet myfloorplanstyle.cssattr Groundfloor fp_default 1attr Groundfloor fp_noMenu 1attr Groundfloor commandfield 1attr Groundfloor fp_backgroundimg foobar.pngdefine <name> FRM {<device> | <port> [global]} define <name> FRM_AD <pin> define <name> FRM_I2C <i2c-address> <register> <bytes-to-read> define <name> FRM_IN <pin> define <name> FRM_LCD i2c <size-x> <size-y> <i2c-address> set <name> text <text to be displayed>define <name> FRM_OUT <pin> set <name> on|offdefine <name> FRM_PWM <pin> set <name> value <value>define <name> FRM_SERVO <pin> set <name> angle <value>define <name> FS20 <housecode> <button>
[fg <fgaddr>] [lm <lmaddr>] [gm FF]
<housecode> is a 4 digit hex or 8 digit ELV4 number,
corresponding to the housecode address.<button> is a 2 digit hex or 4 digit ELV4 number,
corresponding to a button of the transmitter.<fgaddr> specifies the function group.
It is a 2 digit hex or 4 digit ELV address. The first digit of the hex
address must be F or the first 2 digits of the ELV4 address must be
44.<lmaddr> specifies the local
master. It is a 2 digit hex or 4 digit ELV address. The last digit of the
hex address must be F or the last 2 digits of the ELV4 address must be
44.define lamp FS20 7777 00 fg F1 gm Fdefine roll1 FS20 7777 01define otherlamp FS20 24242424 1111 fg 4412 gm 4444define otherroll1 FS20 24242424 1114
set <name> <value> [<time>]
value is one of:
dim06% dim12% dim18% dim25% dim31% dim37% dim43% dim50%
dim56% dim62% dim68% dim75% dim81% dim87% dim93% dim100%
dimdown
dimup
dimupdown
off
off-for-timer
on # dimmer: set to value before switching it off
on-for-timer # see the note
on-old-for-timer # set to previous (before switching it on)
ramp-on-time # time to reach the desired dim value on dimmers
ramp-off-time # time to reach the off state on dimmers
reset
sendstate
timer
toggle # between off and previous dim val
on-till # Special, see the note
set lamp onset lamp1,lamp2,lamp3 onset lamp1-lamp3 onset lamp on-for-timer 12time argument ranges from 0.25sec to 4 hours and 16
minutes. As the time is encoded in one byte there are only 112
distinct values, the resolution gets coarse with larger values. The
program will report the used timeout if the specified one cannot be
set exactly. The resolution is 0.25 sec from 0 to 4 sec, 0.5 sec
from 4 to 8 sec, 1 sec from 8 to 16 sec and so on. If you need better
precision for large values, use at which has a 1
sec resolution.
attr store eventMap on:open off:closed
attr store eventMap /on-for-timer 10:open/off:closed/
set store open
a-z 0-9 and - (dash),
other characters should be ommited. Here is a list of "official"
devices:define <name> FileLog <filename> <regexp>
<filename>. The log format is
YYYY:MM:DD_HH:MM:SS <device> <event>
<filename> may contain %-wildcards of the
POSIX strftime function of the underlying OS (see your strftime manual).
Common used wildcards are:
%d day of month (01..31)%m month (01..12)%Y year (1970...)%w day of week (0..6); 0 represents Sunday%j day of year (001..366)%U week number of year with Sunday as first day of week (00..53)%W week number of year with Monday as first day of week (00..53)%L by the value of the global logdir attribute.%V for ISO 8601 week numbers check if it is
correctly supported by your system (%V may not be replaced, replaced by an
empty string or by an incorrect ISO-8601 week number, especially
at the beginning of the year)
If you use %V you will also have to use %G
instead of %Y for the year!define lamplog FileLog %L/lamp.log lampdefine wzlog FileLog /var/tmp/wz-%Y-%U.log
wz:(measured-temp|actuator).*define wzlog FileLog /var/tmp/wz-%G-%V.log
wz:(measured-temp|actuator).*get <name> <infile> <outfile> <from>
<to> <column_spec>
get outlog out-2008.log - 2008-01-01 2008-01-08 4:IR:int: 9:IR::
define fhtlog1 FileLog log/fht1-%Y-%U.log fht1:.*(temp|actuator).*
define <name> HCS <device>
<device> the name of a predefined device to switch.attr <name> event-on-change-reading state,devicestate,eco,overdrive
idleperiod.
valueseco <on>|<off>on) or disable (off) the economic mode.
interval <value>value modifies the interval of reading the actual valve positions.
The unit is minutes.
mode <thermostat>|<valve>thermostat controls the heating demand by defined temperature
thresholds.valve controls the heating demand by defined valve position thresholds.
onoff switch.offon command.
deviceCmdOn (mandatory)on.
Default value: on
deviceCmdOff (mandatory)off.
Default value: off
ecoTemperatureOn (Required by eco mode)ecoTemperatureOff (Required by eco mode)exclude (optional)idleperiod (mandatory)10
mode (mandatory)thermostat controls the heating demand by defined temperature
thresholds.valve controls the heating demand by defined valve position thresholds.thermostat
sensor (optional)sensorThresholdOn (Required by sensor)sensor has been defined
sensorThresholdOff (Required by sensor)sensor has been defined
sensorReading (Required by sensor)thermostatThresholdOn (Required by operational mode thermostat)0.5
thermostatThresholdOff (Required by operational mode thermostat)0.5
valveThresholdOn (Required by operational mode valve)40
valveThresholdOff (Required by operational mode valve)35
disabledo_not_notifyevent-on-change-readingstate,devicestate,eco,overdrive
event-on-update-readinglogleveldefine <name> HMLAN <ip-address>[:port]define <name> HMS <housecode>
<housecode> is a four digit hex number,
corresponding to the address of the HMS device.
define temp HMS 1234set <name> <cmd> <filter> [<param>]
set hm param -d -f dim state # display param 'state' for all devices whos name contains dim
set hm param -c -f ^dimUG$ peerList # display param 'peerList' for all channels whos name is dimUG
set hm param -dcv expert # get attribut expert for all channels,devices or virtuals
define <name> HMinfoHTTPSRV is an extension to FHEMWEB. You must install FHEMWEB to use HTTPSRV.
Definedefine <name> <infix> <directory> <friendlyname><infix> is the portion behind the FHEMWEB base URL (usually
http://hostname:8083/fhem), <directory> is the absolute path the
files are served from, and <friendlyname> is the name displayed in the side menu of FHEMWEB.Example:
define myJSFrontend HTTPSRV jsf /usr/share/jsfrontend My little frontendindex.html.http://hostname:8083/fhem will return the file
/usr/share/jsfrontend/foo.html for http://hostname:8083/fhem/jsf/foo.html.
If no filename is given, the filename prescribed by the directoryindex attribute is returned.
Notice: All links are relative to http://hostname:8083/fhem.
JSON.cpan install JSON' or your method of choice.define <name> HUEBridge [<host>] [<interval>]define bridge HUEBridge 10.0.1.1define <name> HUEDevice <id> [<interval>]define bulb HUEDevice 1define LC HUEDevice 2:set LC on : transitiontime 100set bulb on : bri 100 : color 4000{CommandGet("","<name> devStateIcon")} to show device color as default in room overview.rgb:rgb FF0000:rgb C8FF12:rgb 0000FF:toggle:on:off to show colorpicker and 3 color preset buttons in room overview.define <name> Heating_Control <device> <profile> <command>|<condition>
set <device> (desired-temp|desiredTemerature) <temp>The following parameter are defined:
Example:
define HCB Heating_Control Bad_Heizung 12345|05:20|21 12345|05:25|comfort 17:20|21 17:25|eco
define HCW Heating_Control WZ_Heizung 07:00|16 Mo,Tu,Th-Fr|16:00|18.5 20:00|12
{fhem("set dummy on"); fhem("set @ desired-temp %");}
At the given times and weekdays only(!) the command will be executed.
define HCW Heating_Control WZ_Heizung Sa-Su,We|08:00|21 (ReadingsVal("WeAreThere", "state", "no") eq "yes")
The temperature is only set if the dummy variable WeAreThere is "yes".
define <name> IPCAM <ip[:port]>
define ipcam IPCAM 192.168.1.205attr ipcam delay 10attr ipcam path snapshot.cgi?user=foo&pwd=barattr ipcam snapshots 5attr ipcam storage /srv/share/surveillance/snapshotsdefine MOTION.not.01 notify GH.ga.SEC.MD.01:.*on.* get ipcam imagedefine MOTION.not.02 notify ipcam:.*snapshots.* { myEmailFunction("%NAME") }define schloss IPCAM www2.braunschweig.deattr schloss path webcam/schloss.jpgattr schloss storage /srv/share/surveillance/snapshotsdefine snapshot_schloss at +*00:01:00 get schloss imageset ipcam tilt up
set ipcam pos 4
set <name> <value> <argument>
value is one of:
cmd 1 .. 15cmd<number>.
pan <direction> [steps]<direction>, where <direction>
could be left or right.
cmdPan<direction>.
cmdStep.
pos 1 .. 15|homecmdPos<number>.
tilt <direction> [steps]<direction>, where <direction>
could be up or down.
cmdPan<direction>.
cmdStep.
raw <argument>argument.
get <name> <value>
value is one of:
imagesnapshots and delay.
lastsnapshotshttp://username:password@domain.com/, you
can store your creditials within the basicauth attribute.credentials)
you have to set the placeholder {USERNAME} and {PASSWORD} in the basicauth string.
These placeholders will be replaced with the values from the credentials file.attr ipcam3 basicauth {USERNAME}:{PASSWORD}
attr ipcam cmd01 led_mode=0attr ipcam cmd02 resolution=8attr ipcam cmdTiltUp command=0attr ipcam cmdTiltDown command=2attr ipcam cmdPanLeft command=4attr ipcam cmdPanRight command=6attr ipcam cmdStep onstepattr ipcam cmdPosHome command=25attr ipcam cmdPos01 command=31attr ipcam cmdPos02 command=33path and query), set the full path
with filename on this attribute.attr ipcam3 credentials /etc/fhem/ipcam.conf
#
# Webcam credentials
#
$credentials{<name_cam1>}{username} = "<your_username>";
$credentials{<name_cam1>}{password} = "<your_password>";
$credentials{<name_cam2>}{username} = "<your_username>";
$credentials{<name_cam2>}{password} = "<your_password>";
...
Replace <name_cam1> respectively <name_cam2>
with the names of your defined ip-cams and <your_username> respectively
<your_password> with your credentials (all without the brackets
< and >!).
attr ipcam3 delay 10
http://CAMERA_IP/snapshot.cgi?user=admin&pwd=password,
then only the path and query part is specified here (without the leading slash (/).attr ipcam3 path snapshot.cgi?user=admin&pwd=passwordcredentials)
you have to set the placeholder {USERNAME} and {PASSWORD} in the path string. These placeholders
will be replaced with the values from the credentials file.attr ipcam3 path snapshot.cgi?user={USERNAME}&pwd={PASSWORD}
attr ipcam3 pathCmd set_misc.cgi
pan, tilt and pos,
if it is necessary.attr ipcam3 pathPanTilt decoder_control.cgi?user={USERNAME}&pwd={PASSWORD}
get <name> image command.
If this attribute is not defined, then the default value is 1.storage and are
numbered sequentially (starts with 1) like snapshot_01, snapshot_02, etc.
Furthermore, an additional file last will be saved, which is identical with
the last snapshot-image. The module checks the imagetype and stores all these files with
the devicename and a correct extension, e.g. <devicename>_snapshot_01.jpg.timestamp.get <name> image command (except: snapshots
with a timestamp. So, keep an eye on your diskspace if you use a timestamp extension!).attr ipcam3 snapshots 5
$modpath/www/snapshotsattr ipcam3 storage /srv/share/surveillance/snapshots
<devicename>_snapshot_01.jpg, <devicename>_snapshot_02.jpg, etc.<devicename>_20121023_002602.jpg,
set this attribute to 1.
define <name> IPWE <hostname> [<delay>]
delay: seconds between read accesses(default 300s)define ipwe IPWE ipwe1 120attr ipwe delay 600 : 10min between readoutsget <name> status
get <name> <sensorname>
define <name> IT <housecode> <on-code> <off-code>
[<dimup-code>] [<dimdown-code>]
define <name> IT <ITRotarySwitches|FLS100RotarySwitches>
<housecode> is a 10 digit tri-state number (0/1/F) depending on
your device setting (see list below).<on-code> is a 2 digit tri-state number for switching your device on;
It is appended to the housecode to build the 12-digits IT-Message.<off-code> is a 2 digit tri-state number for switching your device off;
It is appended to the housecode to build the 12-digits IT-Message.<dimup-code> is a 2 digit tri-state number for dimming your device up;
It is appended to the housecode to build the 12-digits IT-Message.<dimdown-code> is a 2 digit tri-state number for dimming your device down;
It is appended to the housecode to build the 12-digits IT-Message.define lamp IT 01FF010101 11 00 01 10define roll1 IT 111111111F 11 00 01 10define otherlamp IT 000000000F 11 10 00 00define otherroll1 IT FFFFFFF00F 11 10define itswitch1 IT A1define lamp IT J10define flsswitch1 IT IV1define lamp IT II2
set <name> <value> [<time>]
value is one of:
dimdown
dimup
off
on
on-till # Special, see the note
Examples:
set lamp onset lamp1,lamp2,lamp3 onset lamp1-lamp3 onset lamp off
attr store eventMap on:open off:closed
attr store eventMap /on-for-timer 10:open/off:closed/
set store open
a-z 0-9 and - (dash),
other characters should be ommited. Here is a list of "official"
devices:define <name> ITACH_RELAY <ip-address> <port>
define motor1 ITACH_RELAY 192.168.8.200 1set <name> <value>
value is one of:
off
on
toggle
Examples:
set motor1 onjsonlist [<devspec>|<typespec>|ROOMS]
fhem> jsonlist
{
"ResultSet": "full",
"Results": [
{
"list": "Global",
"devices": [
{
"DEF": "",
"NAME": "global",
"NR": "1",
"STATE": "",
"TYPE": "Global",
"currentlogfile": "/var/log/fhem/fhem-2011-12.log",
"logfile": "/var/log/fhem/fhem-%Y-%m.log",
"ATTR": {
"configfile": "/etc/fhem/fhem.conf",
"logfile": "/var/log/fhem/fhem-%Y-%m.log",
"modpath": "/usr/share/fhem",
"pidfilename": "/var/run/fhem.pid",
"port": "7072 global",
"room": "Server",
"statefile": "/var/cache/fhem/fhem.save",
"verbose": "4",
"version": "=VERS= from =DATE= ($Id: 98_JsonList.pm 2102 2012-11-08 23:18:44Z mfr69bs $)"
},
"READINGS": []
}
]
},
{
"list": "CM11",
"devices": [
{
"DEF": "/dev/cm11",
"DeviceName": "/dev/cm11",
"FD": "14",
"NAME": "CM11",
"NR": "19",
"PARTIAL": "null",
"STATE": "Initialized",
"TYPE": "CM11",
"ATTR": {
"model": "CM11"
},
"READINGS": []
}
]
},
{
[...placeholder for more entrys...]
},
],
"totalResultsReturned": 235
}
If specifying <devspec>, then a detailed status for
<devspec> will be displayed, e.g.:
fhem> jsonlist lamp1
{
"ResultSet": {
"Results": {
"ATTRIBUTES": {
"alias": "Lamp on Sideboard",
"model": "fs20st",
"room": "Livingroom"
},
"BTN": "01",
"CHANGED": "ARRAY",
"CHANGETIME": "ARRAY",
"CODE": {
"1": "0b0b 01",
"2": "0b0b 0f",
"3": "0b0b f0",
"4": "0b0b ff"
},
"DEF": "12341234 1112 lm 1144 fg 4411 gm 4444",
"IODev": "CUN868",
"NAME": "lamp1",
"NR": "155",
"READINGS": {
"state": {
"TIME": "2011-12-01 16:23:01",
"VAL": "on"
}
},
"STATE": "on",
"TYPE": "FS20",
"XMIT": "0b0b"
}
}
}
If specifying <typespec>, then a list with the status for
the defined <typespec> devices will be displayed, e.g.:
fhem> jsonlist HMS
{
"ResultSet": "devices#HMS",
"Results": [
{
"name": "KG.ga.WD.01",
"state": "Water Detect: off"
},
{
"name": "KG.hz.GD.01",
"state": "Gas Detect: off"
},
{
"name": "KG.k1.TF.01",
"state": "T: 16.6 H: 51.2 Bat: ok"
},
{
"name": "NN.xx.RM.xx",
"state": "smoke_detect: off"
}
],
"totalResultsReturned": 4
}
If specifying ROOMS, then a list with the defined rooms
will be displayed, e.g.:
fhem> jsonlist ROOMS
{
"ResultSet": "rooms",
"Results": [
"Bathroom",
"Bedroom",
"Children",
"Diningroom",
"Garden",
"House",
"Livingroom",
"Office",
"hidden"
],
"totalResultsReturned": 15
}
define <name> KM271 <serial-device-name>
define KM271 KM271 /dev/ttyS0@2400set KM271 <param> [<value> [<values>]]set KM271 hk1_timer 1 mo 06:30 mo 08:20define <name> KS300 <housecode> [ml/raincounter [wind-factor]]
<housecode> is a four digit hex number,
corresponding to the address of the KS300 device, right now it is ignored.
The ml/raincounter defaults to 255 ml, but it must be specified if you wish
to set the wind factor, which defaults to 1.0.
define ks1 KS300 1234define <name> LGTV
define 47LG7000 LGTVattr 47LG7000 IODev myLG7k
set <name> <what> <value>
power on power off input AV1 input AV2 input AV3 input AV3 input Component input RGB input HDMI1 input HDMI2 input HDMI3 input HDMI4 input DVBT input PAL audio mute audio normalGet
get <name> <what>
power input audioAttributes
begin
prog = fhem
button = pwr
config = IrPower
end
and you press the pwr button the IrPower toggle event occures at fhem.
define IrPower01 notify Lirc:IrPower set lamp toggle
turns the lamp on and off.
If you want a faster reaction to keypresses you have to change the
defaultvalue of readytimeout from 5 seconds to e.g. 1 second in fhem.pl
define <name> LUXTRONIK2 <IP-address> [<poll-interval>]
define Heizung LUXTRONIK2 192.168.0.12 600
define <name> LightScene [<dev1>] [<dev2>] [<dev3>] ... define light_group LightScene Lampe1 Lampe2 Dimmer1define <name> M232 <m232-device>
define m232 M232 /dev/ttyUSB2set <name> stop
set <name> start
set <name> octet
set <name> io0..io7 0|1
get <name> [an0..an5]
get <name> [io0..io7]
get <name> octet
get <name> counter
define <name> M232Counter [unit [factor [deltaunit [deltafactor]]]]
unit is the unit
name, factor is used to calculate the reading of the counter
from the number of ticks. deltaunit is the unit name of the counter
differential per second, deltafactor is used to calculate the
counter differential per second from the number of ticks per second.define counter M232Counter turnsdefine counter M232Counter kWh 0.0008 kW 2.88
(one tick equals 1/1250th kWh)set .. start for
M232) or to start the counter and set the reading to a specified value
(with set ... value for M232Counter).set <name> value <value>
set <name> interval <interval>
get <name> status
define statement. Wraparounds of the counter are accounted for
by an offset (see reading basis in the output of the
list statement for the device).
define <name> M232Voltage [an0..an5] [unit [factor]]
unit is the unit name, factor is used to
calibrate the reading of the analog input.define volt M232Voltage an0define brightness M232Voltage an5 lx 200.0get <name> status
define <name> MAX <type> <addr>
attr MAX_123456 event-on-change-reading .*
because the polling mechanism will otherwise create events every 10 seconds.define switch1 MAX PushButton ffc545set MAX_12345 weekProfile Fri 24.5,6:00,12,15:00,5 Sat 7,4:30,19,12:55,6Friday: 24.5 °C for 0:00 - 6:00, 12 °C for 6:00 - 15:00, 5 °C for 15:00 - 0:00
Saturday: 7 °C for 0:00 - 4:30, 19 °C for 4:30 - 12:55, 6 °C for 12:55 - 0:00define <name> MAXLAN <ip-address>[:port] [<pollintervall> [ondemand]]ondemand forcing the MAXLAN module to tear-down the connection as often as possible
thus making the cube usable by other applications or the web portal.
attr ml set-clock-on-initdefine <name> MSG set <name> send|write <devicename>define myMsg MSG
define <name> MSGFile <filename>define myFile MSGFile
set <name> add|clear|list [text]set myFile add Dies ist Textzeile 1set myFile add Dies ist Textzeile 2set myFile cleardefine myMsg MSGdefine myFile MSGFile /tmp/fhemtest.txtattr myFile filemode appendset myFile add Textzeile 1set myFile add Textzeile 2set myMsg write myFileset myFile cleardefine <name> MSGMail <from> <to> <smtphost> <authfile>define myMail MSGMail from@address.com to@address.com smtp.provider.host /etc/msgauthfile
set <name> add|clear|list [text]set myMail add Dies ist Textzeile 1set myMail add Dies ist Textzeile 2set myMail cleardefine myMsg MSGdefine myMail MSGMail donald.duck@entenhausen.com dagobert.duck@duck-banking.com smtp.entenhausen.net /etc/fhem/msgmailauthattr myMail smtpport 9999attr myMail subject i need more moneyattr myMail CR 0set myMail add Please send me set myMail add 1.000.000 Talerset myMsg send myMailset myMail clear123user45strenggeheimfhem-module for NetIO 230B Power Distribution Unit (see: NetIO 230B (koukaam.se))
Note: this module needs the HTTP::Request and LWP::UserAgent perl modules.define <name> NetIO230B <ip-address> <socket number(s)
> [<user name> <password>]define <name> NetIO230B <ip-address> <socket number(s)
> [<config file path>]Defines a switching device, where sockets can be switched
User name and password are optional. When no user name or password is passed, the module looks for a configfile at '/var/log/fhem/netio.conf'. If no config file is found, it uses 'admin/admin' as user/pass, since this is the default configuration for the device.
Alternatively you can pass a path to a configfile instead of
the user/pass combo. (e.g. /var/tmp/tmp.conf)
Configfile-Format:
%config= (
host => "192.168.61.40",
user => "admin",
password => "admin"
);
Examples:
define Socket3 NetIO230B 192.168.178.10 3define Socket1_and_4 NetIO230B 192.168.178.10 14define coffeemaker NetIO230B 192.168.178.10 1 username secretpassworddefine coffeemaker_and_light NetIO230B 192.168.178.10 23 /var/log/kitchen.confget <name> state
get coffeemaker_and_light => on or offset <name> <value>
value is one of:on offExamples:
set coffeemaker_and_light ondefine <name> OREGON <deviceid> define Kaminzimmer OREGON BTHR918N_ab
FHEM module to commmunicate with 1-Wire A/D converters
This 1-Wire module works with the OWX interface module or with the OWServer interface module
(prerequisite: Add this module's name to the list of clients in OWServer).
Please define an OWX device or OWServer device first.
define OWX_AD OWAD 724610000000 45
attr OWX_AD DAlarm high
attr OWX_AD DFactor 31.907097
attr OWX_AD DHigh 50.0
attr OWX_AD DName RelHumidity|humidity
attr OWX_AD DOffset -0.8088
attr OWX_AD DUnit percent|%
define <name> OWAD [<model>] <id> [<interval>] or
define <name> OWAD <fam>.<id> [<interval>]
Define a 1-Wire A/D converter.
[<model>]<fam>
<id>
<interval>
set <name> interval <int>get <name> id
get <name> present
get <name> intervalget <name> readingget <name> alarmget <name> statusattr <name> stateAL0 <string>
attr <name> stateAH0 <string>
attr <name> stateAL1 <string>
attr <name> stateAH1 <string>
attr <name> <channel>Name
<string>|<string>
attr <name> <channel>Unit
<string>|<string>
attr <name> <channel>Offset
<float>
attr <name> <channel>Factor
<float>
attr <name> <channel>Function
<string>
attr <name> <channel>Alarm
<string>
attr <name> <channel>Low
<float>
attr <name> <channel>High
<float>
FHEM module to commmunicate with 1-Wire Counter/RAM DS2423
This 1-Wire module works with the OWX interface module or with the OWServer interface module
(prerequisite: Add this module's name to the list of clients in OWServer).
Please define an OWX device or OWServer device first.
define OWC OWCOUNT 1D.CE780F000000 60
attr OWC AName Energie|energy
attr OWC AUnit kWh|kWh
attr OWC APeriod hour
attr OWC ARate Leistung|power
attr OWX_AMode daily
define <name> OWCOUNT [<model>] <id> [<interval>] or
define <name> OWCOUNT <fam>.<id> [<interval>]
Define a 1-Wire counter.
[<model>]<fam>
<id>
<interval>
set <name> interval <int>set <name> memory <page>set <name> midnight <channel-name>get <name> id
get <name> present
get <name> intervalget <name> memory <page>get <name> midnight <channel-name>get <name> counter <channel-name>get <name> countersattr <name> LogM
<string>|
attr <name> LogY
<string>|
For each of the following attributes, the channel identification A,B may be used.
attr <name> <channel>Name
<string>|<string>
attr <name> <channel>Unit
<string>|<string>
attr <name> <channel>Rate
<string>|<string>
attr <name> <channel>Offset
<float>
attr <name> <channel>Factor
<float>
attr <name> <channel>Mode daily |
normal
define <name> OWDevice <address> [<interval>]
list <name> command.
OWDevice_GetDetails).
define myOWServer localhost:4304
get myOWServer devices
10.487653020800 DS18S20
define myT1 10.487653020800
list myT1 10.487653020800
Internals:
...
Readings:
2012-12-22 20:30:07 temperature 23.1875
Fhem:
...
getters:
address
family
id
power
type
temperature
templow
temphigh
polls:
temperature
setters:
alias
templow
temphigh
...
set <name> interval <value>
value modifies the interval for polling data. The unit is in seconds.
set <name> <reading> <value>
set myT1 templow 5get <name> <reading> <value>
get myT1 temperaturedefine <name> OWFS <owserver-ip:port> <model> [<id>]
<owserver-ip:port>
<model>
DS1420, DS9097 (for passive Adapter)
<id>
owserver-ip:port is called none, then
no device will be opened, so you can experiment without hardware attached.#define an active Adapter:
define DS9490R OWFS 127.0.0.1:4304 DS1420 93302D000000#define a passive Adapter:
define DS9097 OWFS 127.0.0.1:4304 DS9097get <name> <value>
value is one of (not supported by passive Devices e.g. DS9097):address (read-only)crc8 (read-only)family (read-only)id (read-only)locator (read-only)present (read-only)type (read-only)get DS9490R typeDS9490R type => DS1420get DS9490R addressDS9490R address => 8193302D0000002B
CFKRFHEM module for 1-Wire devices that know only their unique ROM ID
This 1-Wire module works with the OWX interface module or with the OWServer interface module
Please define an OWX device or OWServer device first.
define ROM1 OWX_ID OWCOUNT 09.CE780F000000 10
define <name> OWID <fam> <id> [<interval>] or
define <name> OWID <fam>.<id> [<interval>]
Define a 1-Wire device.
<fam>
<id>
<interval>
set <name> interval <int>get <name> id
get <name> present
FHEM module to commmunicate with the 1-Wire LCD controller
from Louis Swart (1-Wire family id FF). See also the corresponding Wiki page.
Note:
This 1-Wire module so far works only with the OWX interface module. Please
define an OWX device first.
define OWX_LCD OWLCD 9F0700000100
define <name> OWLCD <id> or
define <name> OWLCD FF.<id>
Define a 1-Wire LCD device.
<id>
set <name> icon <int> on|off|blinkset <name> icon 15 0..6set <name> icon noneset <name> line <int> <string>set <name> memory <page> <string>set <name> gpio <value>set <name> backlight ON|OFFset <name> lcd ON|OFFset <name> resetset <name> testget <name> id
get <name> present
get <name> memory <page>get <name> gpioget <name> gpioget <name> versionFHEM module to commmunicate with 1-Wire multi-sensors, currently the DS2438 smart battery
monitor
This 1-Wire module works with the OWX interface module or with the OWServer interface module
(prerequisite: Add this module's name to the list of clients in OWServer).
Please define an OWX device or OWServer device first.
define OWX_M OWMULTI 7C5034010000 45
attr OWX_M VName relHumidity|humidity
attr OWX_M VUnit percent|%
attr OWX_M VFunction (161.29 * V / VDD - 25.8065)/(1.0546 - 0.00216 * T)
define <name> OWMULTI [<model>] <id> [<interval>] or
define <name> OWMULTI <fam>.<id> [<interval>]
Define a 1-Wire multi-sensor
[<model>]<fam>
<id>
<interval>
set <name> interval <int>get <name> id
get <name> present
get <name> intervalget <name> readingget <name> VADget <name> temperatureget <name> VDDget <name> V or get <name>
rawattr <name> VName
<string>|<string>
attr <name> VUnit
<string>|<string>
attr <name> VFunction
<string>
attr <name> tempOffset <float>
attr <name> tempUnit
Celsius|Kelvin|Fahrenheit|C|K|F
FHEM module to commmunicate with 1-Wire Programmable Switches
This 1-Wire module works with the OWX interface module or with the OWServer interface module
(prerequisite: Add this module's name to the list of clients in OWServer).
Please define an OWX device or OWServer device first.
define OWX_S OWSWITCH DS2413 B5D502000000 60
attr OWX_S AName Lampe|light
attr OWX_S AUnit AN|AUS
define <name> OWSWITCH [<model>] <id> [<interval>] or
define <name> OWSWITCH <fam>.<id> [<interval>]
Define a 1-Wire switch.
[<model>]<fam>
<id>
<interval>
set <name> interval <int>set <name> output <channel-name> on | off | on-for-timer <time> | off-for-timer <time>
set <name> gpio <value>set <name> init yesget <name> id
get <name> present
get <name> intervalget <name> input <channel-name>get <name> gpioattr <name> <channel>Name
<string>|<string>
attr <name> <channel>Unit
<string>|<string>
define <name> OWServer <protocol>
define myLocalOWServer OWServer localhost:4304define myRemoteOWServer OWServer raspi:4304localhost and the FQDN of your owserver as server directives
to the owserver configuration file
on the remote host.
set <name> <value>
value is one ofreopentimeout/directorytimeout/ftptimeout/ha7timeout/networktimeout/presencetimeout/serialtimeout/servertimeout/stabletimeout/uncachedtimeout/usbtimeout/volatiletimeout/w1units/pressure_scaleunits/temperature_scaleget <name> <value>
value is one ofdeviceserrors/settings/timeout/directory/settings/timeout/ftp/settings/timeout/ha7/settings/timeout/network/settings/timeout/presence/settings/timeout/serial/settings/timeout/server/settings/timeout/stable/settings/timeout/uncached/settings/timeout/usb/settings/timeout/volatile/settings/timeout/w1/settings/units/pressure_scale/settings/units/temperature_scale attr <name> nonblocking 1
define <name> OWTEMP <id> [<interval>] [<alarminterval>]
<id>
nonefor demo mode.
<interval>
<alarminterval>
DS18S20.define KG.hz.TF.01 OWTEMP 14B598010800 300 60set <name> <value>
value is one of:templow (read-write)temphigh (read-write)ALARMINT (write-only)INTERVAL (write-only)get <name> <value>
value is one of:temperature (read-only)get KG.hz.TF.01 typeKG.hz.TF.01 type => DS18S20get KG.hz.TF.01 temperatureKG.hz.TF.01 temperature => 38.2500 (Celsius)
FHEM module to commmunicate with 1-Wire bus digital thermometer devices
This 1-Wire module works with the OWX interface module or with the OWServer interface module
(prerequisite: Add this module's name to the list of clients in OWServer).
Please define an OWX device or OWServer device first.
define OWX_T OWTHERM DS18B20 E8D09B030000 300
attr OWX_T tempUnit Kelvin
define <name> OWTHERM [<model>] <id> [<interval>] or
define <name> OWTHERM <fam>.lt;id> [<interval>]
Define a 1-Wire digital thermometer device.
[<model>]<fam>
<id>
<interval>
set <name> interval <int>set <name> tempHigh <float>
set <name> tempLow <float>
get <name> id
get <name> present
get <name> intervalget <name> temperatureget <name> alarmattr <name> stateAL <string>
attr <name> stateAH <string>
attr <name> tempConv onkick|onread
attr <name> tempOffset <float>
attr <name> tempUnit
Celsius|Kelvin|Fahrenheit|C|K|F
attr <name> tempHigh <float>
attr <name> tempLow <float>
FHEM module to commmunicate with 1-Wire bus devices
define OWio1 OWX /dev/ttyUSB1
define OWio2 OWX COC
define OWio3 OWX 10
define <name> OWX <serial-device> or
define <name> OWX <cuno/coc-device> or
define <name> OWX <arduino-pin>
Define a 1-Wire interface to communicate with a 1-Wire bus.
<serial-device> The serial device (e.g. USB port) to which the
1-Wire bus is attached.<cuno-device> The previously defined CUNO to which the 1-Wire bus
is attached. <arduino-pin> The pin of the previous defined FRM
to which the 1-Wire bus is attached. If there is more than one FRM device defined
use IODev attribute to select which FRM device to use.set <name> interval <value>
set <name> followAlarms on|off
get <name> alarms
get <name> devices
attr <name> buspower real|parasitic
attr <name> IODev
define <name> PID sensor[:reading:regexp] actor[:cmd:min:max] [p i d]
sensor[:reading:regexp] specifies the sensor, which is an
already defined fhem device, e.g. a S300TH temperature sensor. The reading
and regexp fields are necessary only for unknown devices (currently CUL_WS and HMS devices are "known").
Reading specifies the READINGS field of the sensor, and the regexp extracts
the number from this field. E.g. for the complete definition for a CUL_WS
device is: s300th_dev:temperature:([\d\.]*)
actor[:cmd:min:max] specifies the actor, which is an
already defined fhem device, e.g. an FHT8V valve. The cmd, min and max
fields are necessary only for unknown devices (currently FHT8V is "known"). cmd specifies the command name for the
actor, min the minimum value and max the maximum value. The complete
definition for an FHT8V device is:fht8v_dev:valve:0:100
define wz_pid PID wz_th wz_fht8vdefine <name> POKEYS <ip-address> <pin> <io-state> [<time in ms>] <ip-address> the IP address where the POKEYS device can be accessed<pin> the pin number which should be configured<io-state> the new io state of the pin Obsolete(=undef) DigIn DigOut AdcIn DigInCtRise DigInCtFall ExtDigOut GetBasic <time in ms> optional else 1000ms: cyclic update time for Input pin define PoInfo POKEYS 192.168.178.34 0 GetBasicget commanddefine Pin44in POKEYS 192.168.178.34 44 DigIn 200define Pin25out POKEYS 192.168.178.34 25 DigOutset <name> <state> [<time in ms>] <state> can be OFF ON OFF_PULSE ON_PULSE <time in ms> optional else 1000ms hold time for the ON_PULSE OFF_PULSE stateset Pin25out ONget <name> <type> GetBasic<type> can be Version DevName Serial User CPUloadget PoInfo Versiondefine <name> PRESENCE lan-ping <ip-address> [ <check-interval> [ <present-check-interval> ] ]define iPhone PRESENCE lan-ping 192.168.179.21define <name> PRESENCE fritzbox <device-name> [ <check-interval> [ <present-check-interval> ] ]define iPhone PRESENCE fritzbox iPhone-4Sdefine <name> PRESENCE local-bluetooth <bluetooth-address> [ <check-interval> [ <present-check-interval> ] ]define iPhone PRESENCE local-bluetooth 0a:8d:4f:51:3c:8fdefine <name> PRESENCE function {...} [ <check-interval> [ <present-check-interval> ] ]define iPhone PRESENCE function {snmpCheck("10.0.1.1","0x44d77429f35c")}define <name> PRESENCE shellscript "<path> [<arg1>] [<argN>]..." [ <check-interval> [ <present-check-interval> ] ]define iPhone PRESENCE shellscript "/opt/check_device.sh iPhone"define <name> PRESENCE lan-bluetooth <ip-address>[:port] <bluetooth-address> [ <check-interval> ]define iPhone PRESENCE lan-bluetooth 127.0.0.1:5222 0a:4f:36:d8:f9:89
Usage:
presenced -d [-p <port>] [-P <filename>]
presenced [-h | --help]
Options:
-p, --port
TCP Port which should be used (Default: 5111)
-P, --pid-file
PID file for storing the local process id (Default: /var/run/presenced.pid)
-d, --daemon
detach from terminal and run as background daemon
-v, --verbose
Print detailed log output
-h, --help
Print detailed help screen
It uses the hcitool command (provided by a bluez installation)
to make a paging request to the given bluetooth address (like 01:B4:5E:AD:F6:D3). The devices must not be visible, but
still activated to receive bluetooth requests.
Usage:
collectord -c <configfile> [-d] [-p <port>] [-P <pidfile>]
collectord [-h | --help]
Options:
-c, --configfile <configfile>
The config file which contains the room and timeout definitions
-p, --port
TCP Port which should be used (Default: 5222)
-P, --pid-file
PID file for storing the local process id (Default: /var/run/collectord.pid)
-d, --daemon
detach from terminal and run as background daemon
-v, --verbose
Print detailed log output
-l, --logfile <logfile>
log to the given logfile
-h, --help
Print detailed help screen
Before the collectord can be used, it needs a config file, where all different rooms, which have a presenced detector, will be listed. This config file looks like:
# room definition
# ===============
#
[room-name] # name of the room
address=192.168.0.10 # ip-address or hostname
port=5111 # tcp port which should be used (5111 is default)
presence_timeout=120 # timeout in seconds for each check when devices are present
absence_timeout=20 # timeout in seconds for each check when devices are absent
[living room]
address=192.168.0.11
port=5111
presence_timeout=180
absence_timeout=20
If a device is present in any of the configured rooms, this is send to FHEM, as well as the device name as reading and the room which has detected the device.define <name> PachLog <Pachube-API-Key> set <NAME> ADD <FHEM-DEVICENAME> FEED-NR:ID:READING:ID:READING| ID | 0 | temperature |
| ID | 1 | humidity |
| ID | 2 | wind |
| ID | 3 | rain |
set <NAME> ADD <My-KS300> 1234:0temperature:1:humidity:2:wind:3:rainset <NAME> DEL <FHEM-DEVICENAME>|
This module is for the old RFXCOM USB or LAN based 433 Mhz RF receivers and transmitters (order order code 80002 and others). It does not support the new RFXtrx433 transmitter because it uses a different protocol. See RFXTRX for support of the RFXtrx433 transmitter. These receivers supports many protocols like Oregon Scientific weather sensors, RFXMeter devices, X10 security and lighting devices and others. Currently the following parser modules are implemented:
Note: this module requires the Device::SerialPort or Win32::SerialPort module if the devices is connected via USB or a serial port. Define define <name> RFXCOM <device> [noinit] USB-connected (80002):
Example: define RFXCOMUSB RFXCOM /dev/ttyUSB0
Network-connected devices:
Example: define RFXCOMTCP RFXCOM 192.168.1.5:10001
define RFXCOMTCP2 RFXCOM 192.168.1.121:10001 noinit
|
# Do not use any long IDs for any devices: attr RFXCOMUSB longids 0 # Use any long IDs for all devices (this is default): attr RFXCOMUSB longids 1 # Use longids for BTHR918N devices. # Will generate devices names like BTHR918N_f3. attr RFXCOMUSB longids BTHR918N # Use longids for TX3_T and TX3_H devices. # Will generate devices names like TX3_T_07, TX3_T_01 ,TX3_H_07. attr RFXCOMUSB longids TX3_T,TX3_H
define <name> RFXMETER <deviceid> [<scalefactor>] [<unitname>] define RFXWater RFXMETER 00 0.5 ltr
define RFXPower RFXMETER 01 0.001 kwh
define RFXGas RFXMETER 02 0.01 cu_m
define <name> RFXX10REC <type> <deviceid> <devicelog> [<deviceid> <devicelog>] <type>
ds10a (X10 security ds10a Door/Window Sensor or compatible devices. This device type reports the status of the switch [Open/Closed], status of the delay switch [min|max]], and battery status [ok|low].)ms10a (X10 security ms10a motion sensor. This device type reports the status of motion sensor [normal|alert] and battery status [ok|low].))sd90 (Marmitek sd90 smoke detector. This device type reports the status of the smoke detector [normal|alert] and battery status [ok|low].)kr18 (X10 security remote control. Report the Reading "Security" with values [Arm|Disarm], "ButtonA" and "ButtonB" with values [on|off] )ms14a (X10 motion sensor. Reports [normal|alert] on the first deviceid (motion sensor) and [on|off] for the second deviceid (light sensor)) x10 (All other x10 devices. Report [on|off] on both deviceids.)<deviceid>
<devicelog>
<deviceid2>
<devicelog2>
<deviceid2>.
define livingroom_window RFXX10REC ds10a 72cd Window
define motion_sensor1 RFXX10REC ms10a 55c6 motion
define smoke_sensor1 RFXX10REC sd90 54d3 Smoke 54d3 Smoketest
define motion_sensor2 RFXX10REC ms14a A1 motion A2 light
Currently a media RSS feed delivering status pictures in JPEG format is supported. This media RSS feed can be used to feed a status display to a network-enabled photo frame.
You need to have the perl module GD installed. This module is most likely not
available for small systems like Fritz!Box.
RSS is an extension to FHEMWEB. You must install FHEMWEB to use RSS.
Definedefine <name> RSS jpg <hostname> <filename>jpg is a fixed literal to allow for future
extensions. <hostname> is the hostname of the fhem server as
seen from the consumer of the RSS feed. <filename> is the
name of the file that contains the layout definition.Examples:
define FrameRSS RSS jpg host.example.org /etc/fhem/layoutdefine MyRSS RSS jpg 192.168.1.222 /var/fhem/conf/layout.txtset <name> rereadcfg
<width>x<height>.tmin seconds,
no matter how frequently the RSS feed consumer accesses the page.RSS appears in the FHEMWEB
side menu. If you click it you get a list of all defined RSS feeds. The URL of any such is
RSS feed is http://hostname:port/fhem/rss/name.rss with hostname and
name from the RSS feed's definition and the port
(usually 8083) and literal /fhem from the underlying FHEMWEB
definition.Example:
http://host.example.org:8083/fhem/rss/FrameRSS.rss
The media RSS feed points to a dynamically generated JPEG picture. The URL of the JPEG picture
belonging to the RSS feed is http://hostname:port/fhem/rss/name.jpg, i.e. the URL
of the RSS feed with the extension rss changed to jpg.
Example:
http://host.example.org:8083/fhem/rss/FrameRSS.jpg
To render the JPEG picture the current, or, if tmin seconds have elapsed, the next
JPEG picture from the directory bg is chosen and scaled to the dimensions given
in size. The background is black if no usable JPEG picture can be found. Next the
script in the layout definition is used to superimpose items on
the background.
You can directly access the URL of the JPEG picture in your browser. Reload the page to see how it works.
The media RSS feed advertises to refresh after 1 minute (ttl). Some photo frames ignore it and use their preset refresh rate. Go for a photo frame with an adjustable refresh rate (e.g every 5 seconds) if you have the choice!
This is how the fhem config part might look like:
define ui FHEMWEB 8083 global
define FrameRSS RSS jpg host.example.org /etc/fhem/layout
attr FrameRSS size 800x600
attr FrameRSS bg /usr/share/pictures
attr FrameRSS tmin 10
Everything after a # is treated as a comment and ignored. You can fold long lines by putting a \ at the end.
Layout control commands
Arial) or the full path to a TrueType font
(e.g. /usr/share/fonts/truetype/arial.ttf),
whatever works on your system.FF0000 for red, C0C0C0 for light gray).{ <perl special> } for <text> to fully
access device readings and do some programming on the fly. See below for examples.gif, jpeg, png.
The picture is scaled by the factor <s> (a decimal value). If <srctype> is file, the picture
is loaded from the filename <arg>, if <srctype> is url, the picture
is loaded from the URL <arg>. You can use
{ <perl special> } for <arg>. See below for example.
Notice: do not load the image from URL that is served by fhem as it leads to a deadlock.
font /usr/share/fonts/truetype/arial.ttf # must be a TrueType font
rgb c0c0c0 # HTML color notation, RGB
pt 48 # font size in points
time 0.10 0.90
pt 24
text 0.10 0.95 { ReadingsVal("MyWeather","temperature","?"). "C" }
img 20 530 0.5 png file { "/usr/share/fhem/www/images/weather/" . ReadingsVal("MyWeather","icon","") . ".png" }
define <name> SCIVT <SCD-device>
define scd SCIVT /dev/ttyUSB2get SCVIT data
define <name> SISPM </path/to/sispmctl>
plug-2:# sispmctl -v -s -d 1 -g all -d 2 -g all SiS PM Control for Linux 2.7 (C) 2004, 2005, 2006, 2007, 2008 by Mondrian Nuessle, (C) 2005, 2006 by Andreas Neuper. This program is free software. [...] Gembird #0 is USB device 013.This device is a 4-socket SiS-PM. [...] Gembird #1 is USB device 015.This device is a 4-socket SiS-PM. [...] Accessing Gembird #1 USB device 015 Status of outlet 1: on Status of outlet 2: on Status of outlet 3: on Status of outlet 4: on Error performing requested action Libusb error string: error sending control message: Invalid argument Terminating *** glibc detected *** sispmctl: double free or corruption (fasttop): 0x000251e0 *** [...]Well, the fix is simple and will be sent upstream, but in case it's not incorporated at the time you need it, here it is; it's easy to apply even by hand ;-)
--- src/main.c-old 2010-01-19 16:56:15.000000000 +0100
+++ src/main.c 2010-01-19 16:54:56.000000000 +0100
@@ -441,7 +441,7 @@
}
break;
case 'd': // replace previous (first is default) device by selected one
- if(udev!=NULL) usb_close (udev);
+ if(udev!=NULL) { usb_close (udev); udev=NULL; }
devnum = atoi(optarg);
if(devnum>=count) devnum=count-1;
break;
chmod 4755 /path/to/sispmctl) or fiddle with
udev so that the devices of the Power Manager are owned by the user running FHEM.
After defining a SISPM device, a first test is done, identifying attached PMs. If this
succeeds, an internal task is scheduled to read the status every 30 seconds. (Reason
being that someone else could have switched sockets externally to FHEM.)
To actually control any power sockets, you need to define a SIS_PMS
device ;) If autocreate is enabled, those should be autocreated for your convenience as
soon as the first scan took place (30 seconds after the define).
Implementation of SISPM.pm tries to be nice, that is it reads from the pipe only
non-blocking (== if there is data), so it should be safe even to use it via ssh or
a netcat-pipe over the Internet, but this, as well, has not been tested extensively yet.
model: SISPM (ignored for now)define PMS_Terrarium SISPM /usr/bin/sispmctldefine <name> SIS_PMS <serial> <socket>
<serial> is the serial number of the Power Manager device, see above.<socket> is a number between 1 and 4 (for a 4 socket model)define lamp SIS_PMS 01:02:03:04:05 1define otherlamp SIS_PMS 01:02:03:04:05 3define tv SIS_PMS 01:01:38:44:55 1
set <name> <value> [<time>]
value is one of:
off
on
toggle
on-till # Special, see the note
off-till # Special, see the note
Examples:
set lamp onset lamp1,lamp2,lamp3 onset lamp1-lamp3 onset hql_lamp on-till 18:45
This module supports "Intelligenter Strom Zhler"(ENBW) and "Sparzhler" (Yellow Strom).
The electricity meter will be polled in a defined interval for new values.
define <name> SML <host> <port> [<interval> <timeout>]
Example:
define StromZ1 SML 192.168.178.20
define StromZ2 SML 192.168.10.25 300 60
TOTALPOWER YEARPOWER MONTHPOWER DAYPOWER Interval TOTALPOWERYEARPOWER MONTHPOWERDAYPOWER Interval
This module supports Samsung TV devices with few commands. It's developed and tested with Samsung LE39B650.
define <name> STV <host>]
Example:
define Television1 STV 192.168.178.20
mute volume call sms date sunrise, sunset, sunrise_rel, sunset_rel sunrise_abs, sunset_abs isdayperl functions, to be used in at or FS20 on-till commands.
# When sun is 6 degrees below horizon - same as sunrise();
sunrise("CIVIL");
# When sun is 3 degrees below (-3 above) horizon (Between real and civil sunset)
sunset("HORIZON=-3");
# When sun is 1 degree above horizon
sunset("HORIZON=1");
# Switch lamp1 on at real sunset, not before 18:00 and not after 21:00
define a15 at *{sunset("REAL",0,"18:00","21:00")} set lamp1 on
Define Sys::Statistics::Linux on Linux.cpan install Sys::Statistics::Linux'apt-get install libsys-statistics-linux-perl'
define sysstatlog FileLog /usr/local/FHEM/var/log/sysstat-%Y-%m.log sysstat
attr sysstatlog nrarchive 1
define wl_sysstat weblink fileplot sysstatlog:sysstat:CURRENT
attr wl_sysstat label "Load Min: $data{min1}, Max: $data{max1}, Aktuell: $data{currval1}"
attr wl_sysstat room System
#FileLog 4:/\x3a:0:' or '#FileLog 4:\s..\s:0:'
and not '#FileLog 4:/:0:' as the later will match all mount pointsdefine <name> SYSSTAT [<interval> [<interval_fs>] [<host>]]define sysstat SYSSTATdefine sysstat SYSSTAT 300define sysstat SYSSTAT 60 600get <name> <value>
value is one ofattr sysstat filesystems /dev/md0,/dev/md2attr sysstat filesystems /dev/.*attr <name> blockSenderID own
to block receiving telegrams with TCM SenderIDs.define <name> TCM [120|310] <device> device can take the same parameters (@baudrate, @directio,
TCP/IP, none) like the CUL, but you probably have
to specify the baudrate: the TCM120 should be opened with 9600 Baud, the
TCM310 with 57600 baud.
Example:
define BscBor TCM 120 /dev/ttyACM0@9600
define TCM310 TCM 310 /dev/ttyACM0@57600
set <name> desired <value>define <name> THRESHOLD <sensor>[:[<reading>][:[<hysteresis>][:<init_desired_value>]]] [AND|OR <sensor2>[:[<reading2>][:<state>]]] [<actor>][|[<cmd1>][|[<cmd2>][|[<cmd_default_index>][|[[<state_cmd1>][:<state_cmd2>]]]]]]define thermostat THRESHOLD temp_sens heatingset thermostat desired 20define thermostat THRESHOLD temp_sens OR win_sens heatingdefine W_ALL structure W1 W2 W3 ... attr W_ALL clientstate_behavior relativeattr W_ALL clientstate_priority closed opendefine thermostat THRESHOLD S1 OR W_ALL heatingdefine hygrostat THRESHOLD hym_sens:humidity dehydrator|set @ on|set @ off|1define hygrostat THRESHOLD hym_sens:humidity AND Sensor2:state:close dehydrator|set @ on|set @ off|1define thermostat THRESHOLD temp_sens:temperature:1 aircon|set @ on|set @ off|1define thermostat THRESHOLD temp_sens AND Sensor2:state:close aircon|set @ on|set @ off|1define hygrostat THRESHOLD hym_sens:humidity:20 watering|set @ off|set @ on|2define thermostat THRESHOLD sensor |set Switch1 on;set Switch2 on|set Switch1 off;set Switch2 off|1define thermostat THRESHOLD sensor alarm|{Log 2,"value is exceeded"}|set @ on;set Switch2 ondefine thermostat THRESHOLD sensor ||{Log 2,"value is reached"}|define thermostat THRESHOLD sensor heating|set @ off|set @ on|2|off:ondefine thermostat THRESHOLD sensor:temperature:0:30 ||||on:offset <name> desired <value>
Set the desired value. If no desired value is set, the module is not active.
set <name> deactivated <value>
Module is disabled.
set <name> active <value>
Module is activated again.
set <name> hysteresis <value>
Set hysteresis value.
|
This module is for the RFXCOM RFXtrx433 USB based 433 Mhz RF transmitters.
This USB based transmitter is able to receive and transmit many protocols like Oregon Scientific weather sensors, X10 security and lighting devices, ARC ((address code wheels) HomeEasy, KlikAanKlikUit, ByeByeStandBy, Intertechno, ELRO,
AB600, Duewi, DomiaLite, COCO) and others. Currently the following parser modules are implemented:
Note: this module requires the Device::SerialPort or Win32::SerialPort module if the devices is connected via USB or a serial port. Define define <name> TRX <device> [noinit] USB-connected:
Example: define RFXTRXUSB TRX /dev/ttyUSB0@38400
Network-connected devices:
Example: define RFXTRXTCP TRX 192.168.1.5:10001
define RFXTRXTCP2 TRX 192.168.1.121:10001 noinit
|
# Do not use any long IDs for any devices (this is default): attr RFXCOMUSB longids 0 # Use long IDs for all devices: attr RFXCOMUSB longids 1 # Use longids for BTHR918N devices. # Will generate devices names like BTHR918N_f3. attr RFXTRXUSB longids BTHR918N # Use longids for TX3_T and TX3_H devices. # Will generate devices names like TX3_T_07, TX3_T_01 ,TX3_H_07. attr RFXTRXUSB longids TX3_T,TX3_H
define <name> TRX_ELSE <hextype> <hextype>
define TRX_UNKNOWN_9A TRX_ELSE 9A
define <name> TRX_LIGHT <type> <deviceid> <devicelog> [<deviceid2> <devicelog2>] define <name> TRX_LIGHT PT2262 <deviceid> <devicelog> <commandcodes> <type>
MS14A (X10 motion sensor. Reports [normal|alert] on the first deviceid (motion sensor) and [on|off] for the second deviceid (light sensor)) X10 (All other x10 devices. Report [off|on|dim|bright|all_off|all_on] on both deviceids.)ARC (ARC devices. ARC is a protocol used by devices from HomeEasy, KlikAanKlikUit, ByeByeStandBy, Intertechno, ELRO, AB600, Duewi, DomiaLite and COCO with address code wheels. Report [off|on|all_off|all_on|chime].)AB400D (ELRO AB400D devices. Report [off|on].)WAVEMAN (Waveman devices. Report [off|on].)EMW200 (Chacon EMW200 devices. Report [off|on|all_off|all_on].)IMPULS (IMPULS devices. Report [off|on].)RISINGSUN (RisingSun devices. Report [off|on].)PHILIPS_SBC (Philips SBC devices. Send [off|on|all_off|all_on].)AC (AC devices. AC is the protocol used by different brands with units having a learning mode button: KlikAanKlikUit, NEXA, CHACON, HomeEasy UK. Report [off|on|level <NUM>|all_off|all_on|all_level <NUM>].)HOMEEASY (HomeEasy EU devices. Report [off|on|level|all_off|all_on|all_level].)ANSLUT (Anslut devices. Report [off|on|level|all_off|all_on|all_level].)PT2262 (Devices using PT2262/PT2272 (coder/decoder) chip. To use this enable Lighting4 in RFXmngr. Please note that this disables ARC. For more information see FHEM-Wiki
)<deviceid>
<devicelog>
<deviceid2>
<devicelog2>
<deviceid2>.
<commandcodes>
0:off,1:on'.
define motion_sensor2 TRX_LIGHT MS14A A1 motion A2 light
define Steckdose TRX_LIGHT ARC G2 light
define light TRX_LIGHT AC 0101010101 light
set <name> <value> [<levelnum>]
value is one of:
off
on
dim # only for X10, KOPPLA
bright # only for X10, KOPPLA
all_off # only for X10, ARC, EMW200, AC, HOMEEASY, ANSLUT
all_on # only for X10, ARC, EMW200, AC, HOMEEASY, ANSLUT
chime # only for ARC
level <levelnum> # only AC, HOMEEASY, ANSLUT: set level to <levelnum> (range: 0=0% to 15=100%)
on-till # Special, see the note
on-for-timer # Special, see the note
Example: set Steckdose on
on-till requires an absolute time in the "at" format
(HH:MM:SS, HH:MM) or { <perl code> }, where the perl code
returns a time specification).
If the current time is greater than the specified time, then the
command is ignored, else an "on" command is generated, and for the
given "till-time" an off command is scheduleld via the at command.
on-for-timer requires a relative time in the "at" format
(HH:MM:SS, HH:MM) or { <perl code> }, where the perl code
returns a time specification).
define <name> TRX_SECURITY <type> <deviceid> <devicelog> [<deviceid2> <devicelog2>] <type>
DS10A (X10 security ds10a Door/Window Sensor or compatible devices. This device type reports the status of the switch [Open/Closed], status of the delay switch [min|max]], and battery status [ok|low].)MS10A (X10 security ms10a motion sensor. This device type reports the status of motion sensor [normal|alert] and battery status [ok|low].))SD90 (Marmitek sd90 smoke detector. This device type reports the status of the smoke detector [normal|alert] and battery status [ok|low].)KR18 (X10 security remote control. Report the Reading "Security" with values [Arm|Disarm], "ButtonA" and "ButtonB" with values [on|off] )KD101 (KD101 smoke sensor. Report the Reading "smoke" with values [normal|alert])VISONIC_WINDOW (VISONIC security Door/Window Sensor or compatible devices. This device type reports the status of the switch [Open/Closed] and battery status [ok|low].)VISONIC_MOTION (VISONIC security motion sensor. This device type reports the status of motion sensor [normal|alert] and battery status [ok|low].))<deviceid>
<devicelog>
<deviceid2>
<devicelog2>
<deviceid2>.
define livingroom_window TRX_SECURITY ds10a 72cd Window
define motion_sensor1 TRX_SECURITY ms10a 55c6 motion
define smoke_sensor1 TRX_SECURITY sd90 54d3 Smoke 54d3 Smoketest
set <name> <value>
value is one of:
alert # only for KD101
pair # only for KD101
Example: set TRX_KD101_a5ca00 alert
define <name> TRX_WEATHER <deviceid> <deviceid>
define Tempsensor TRX_WEATHER TX3_Tdefine Tempsensor3 TRX_WEATHER THR128_3define Windsensor TRX_WEATHER WGR918_Adefine Regensensor TRX_WEATHER RGR918define <name> TRX_WEATHER <deviceid> [<scale_current> <scale_total> <add_total>] <deviceid>
"energy_current:":
energy_current * <scale_current>.
"energy_total:":
energy_total * <scale_total> + <add_total>.
define Tempsensor TRX_WEATHER CM160_1401define Tempsensor TRX_WEATHER CM180_1401 1 1 0define Tempsensor TRX_WEATHER CM180_1401 0.9 0.9 -1000|
The TUL module is the representation of a EIB / KNX connector in FHEM.
EIB instances represent the EIB / KNX devices and will need a TUL as IODev to communicate with the EIB / KNX network. The TUL module is designed to connect to EIB network either using EIBD or the TUL usb stick created by busware.de Note: this module may require the Device::SerialPort or Win32::SerialPort module if you attach the device via USB and the OS sets strange default parameters for serial devices. |
|
define <name> TUL <device> <physical address> define tul TUL tul:/dev/ttyACM0 1.1.249
define tul TUL eibd:localhost 1.1.249
define <name> TellStick </path/to/tdtool>
chmod o+rw /dev/tellstick should fix that; you may want to automate it
via udev or adding the fhem user to the proper group ;))define TStick TellStick /usr/bin/tdtooldefine Deckenfluter SIS_PMS te:ll:st:ck:01 2define <name> Twilight <latitude> <longitude> [<indoor_horizon> [<Weather_Position>]]0 - total night, sun is at least -18 degree below horizon1 - astronomical twilight, sun is between -12 and -18 degree below horizon2 - nautical twilight, sun is between -6 and -12 degree below horizon3 - civil twilight, sun is between 0 and -6 degree below horizon4 - indoor twilight, sun is between the indoor_horizon and 0 degree below horizon (not used if indoor_horizon=0)5 - weather twilight, sun is between indoor_horizon and a virtual weather horizon (the weather horizon depends on weather conditions (optional)6 - maximum daylightlatitude and longitude are decimal numbers which give the position on earth for which the twilight states shall be calculated.
define myTwilight Twilight 49.962529 10.324845 3 676757
get <name> <reading>| light | the current virtual daylight value |
| nextEvent | the name of the next event |
| nextEventTime | the time when the next event will probably happen (durint light phase 5 and 6 this is updated when weather conditions change |
| sr_astro | time of astronomical sunrise |
| sr_naut | time of nautical sunrise |
| sr_civil | time of civil sunrise |
| sr | time of sunrise |
| sr_indoor | time of indoor sunrise |
| sr_weather | time of weather sunrise |
| ss_weather | time of weather sunset |
| ss_indoor | time of indoor sunset |
| ss | time of sunset |
| ss_civil | time of civil sunset |
| ss_nautic | time of nautic sunset |
| ss_astro | time of astro sunset |
define <name> USBWX <serial device>
define <name> USBWX <code> [corr1...corr4]
define USBWDE1 USBWX /dev/ttyUSB0
define USBWX_1 USBWX 1
define USBWX_livingroom USBWX 2
define USBWX_ks300 USBWX 9
Set define <name> USF1000 <geometry>
<geometry> determines the form of the tank and the
position of the sensor. The following geometries are currently
supported:cub <length> <width> <height> <offset>cylv <diameter> <height> <offset>cub stands for a cuboid whose base is <length> × <width>.
cylv stands for a vertical cylinder whose diameter is <diameter>.
<height> is the distance of the surface of the liquid from the ground
if the tank is full. <offset> is the distance of the sensor relative to
the surface of the liquid. All quantities are expressed in meters.define MyTank USF1000 cylv 2 1 0.3: a cylindrical water tank with
2 meters diameter. The water stands 1 meter high if the tank is full. The
sensor is fixed 1,3 meters above ground.define <name> VIERA <host> [<interval>]
define myTV1 VIERA 192.168.178.20
define myTV1 VIERA 192.168.178.20 60 #with custom interval of 60 seconds
set <name> <command> [<value>]
off
mute [on|off]
volume <value>
remoteControl <command>
3D => 3D button
BLUE => Blue
CANCEL => Cancel / Exit
CHG_INPUT => AV
CH_DOWN => Channel down
CH_UP => Channel up
D0 => Digit 0
D1 => Digit 1
D2 => Digit 2
D3 => Digit 3
D4 => Digit 4
D5 => Digit 5
D6 => Digit 6
D7 => Digit 7
D8 => Digit 8
D9 => Digit 9
DISP_MODE => Display mode / Aspect ratio
DOWN => Control DOWN
ENTER => Control Center click / enter
EPG => Guide / EPG
FF => Fast forward
GREEN => Green
HOLD => TTV hold / image freeze
INDEX => TTV index
INFO => Info
INTERNET => VIERA connect
LEFT => Control LEFT
MENU => Menu
MUTE => Mute
PAUSE => Pause
PLAY => Play
POWER => Power off
P_NR => P-NR (Noise reduction)
REC => Record
RED => Red
RETURN => Return
REW => Rewind
RIGHT => Control RIGHT
R_TUNE => Seems to do the same as INFO
SD_CARD => SD-card
SKIP_NEXT => Skip next
SKIP_PREV => Skip previous
STOP => Stop
STTL => STTL / Subtitles
SUBMENU => Option
TEXT => Text / TTV
TV => TV
UP => Control UP
VIERA_LINK => VIERA link
VOLDOWN => Volume down
VOLUP => Volume up
VTOOLS => VIERA tools
YELLOW => Yellow
set <name> mute on
set <name> volume 20
set <name> remoteControl CH_DOWN
get <name> <what>
mute
volume
define <name> <ip-address> <port> <delay>
define AUSSEN.wetterstation VantagePro2 192.168.8.127 4999 60
fhem> list AUSSEN.wetterstation
Internals:
DEF 192.168.8.127 4999 60
Host 192.168.8.127
NAME AUSSEN.wetterstation
NR 5
Port 4999
STATE T-OUT: 22.78 T-IN: 26.50 H-OUT: 55 H-IN: 45 W: 1.61 W-AV: 1.61 WS 257 R: 0.00 S: 770 UV: 4.1 RD: 0 RM: 41 RY: 241 BM: 76.27 BT: Steady
TYPE VantagePro2
Readings:
2010-08-04 10:15:17 10 min. average windspeed 1.61 (km/h)
2010-08-04 10:15:17 UV 4.1 (UV/Index)
2010-08-04 10:15:17 barometer 76.27 (Millimeters)
2010-08-04 10:15:17 barometer trend Steady
2010-08-04 10:15:17 day rain 0 (mm/day)
2010-08-04 10:15:17 humidity inside 45 (%)
2010-08-04 10:15:17 humidity outside 55 (%)
2010-08-04 10:15:17 month rain 41 (mm/month)
2010-08-04 10:15:17 rainrate 0.00 (mm/h)
2010-08-04 10:15:17 solar 770 (Watt/m^2)
2010-08-04 10:15:17 temperature-inside 26.50 (Celsius)
2010-08-04 10:15:17 temperature-outside 22.78 (Celsius)
2010-08-04 10:15:17 wind direction 257 (Degrees)
2010-08-04 10:15:17 windspeed 1.61 (km/h)
2010-08-04 10:15:17 year rain 241 (mm/year)
Attributes:
delay 60
define <name> WEBCOUNT <ip-address> <port> <delay>
define pump WEBCOUNT 192.168.8.200 1 60define <name> WEBIO <ip-address> <port> <delay>
define pumpspeed WEBIO 192.168.8.200 1 60set <name> <value>
value is one of:
0.00 - 10.00
Examples:
set pumpspeed 6.75define <name> WEBIO_12DIGITAL <ip-address> <outputport> <delay>
define motor1 WEBIO_12DIGITAL 192.168.8.200 1 60set <name> <value>
value is one of:
on off
Examples:
set motor1 ondefine <name> WOL <MAC> <IP>
<unitcode>
define computer1 WOL 72:11:AC:4D:37:13 192.168.0.24ether-wake on FritzBoxes.set <name> <value>
value is one of:
refresh # checks whether the computer is currently running
on # sends a magic packet to the defined MAC address
Examples:
set computer1 onset computer1 refreshattr <name> shutdownCmd <string>
sh /path/to/some/shell/script.shdefine <name> WS2000 <device_to_connect>
rain: factor for calculating amount of rain in ml/countaltitude: height in meters to calculate pressure for NN (not used yet)define WS2000 WS2000 /dev/ttyS0define WS2000 WS2000 xport:10001attr WS2000 rain 366 : use factor 366 ml/count for rain sensor S2000Rget <name> list
get <name> [TH0..TH7, T0..T7, I0..I7, R0..R7, W0..W7, L0..L7, P0..P7,LAST,RAW]LAST: Last received Sensor
RAW: original Data from interface
define WS300Device WS300 <serial device>define <devname> WS300 [0-9]
define WS300Device WS300 /dev/ttyUSB1
define ash2200.1 WS300 0
define ks300 WS300 8
define ws300 WS300 9
set WS300Device <interval(min.)> <height(m)> <rainvalume(ml)>
define <name> WS3600 </path/to/fetch3600>
Date 14-Nov-2009 Time 10:50:22 Ti 22.8 Timin 20.8 Timax 27.9 TTimin 10:27 DTimin 15-10-2009 TTimax 23:31 DTimax 20-08-2009 To 14.2 Tomin -0.4 Tomax 35.6 TTomin 07:03 DTomin 15-10-2009 TTomax 16:52 DTomax 20-08-2009 DP 9.2 DPmin -2.2 DPmax 20.3 TDPmin 07:03 DDPmin 15-10-2009 TDPmax 11:58 DDPmax 20-08-2009 RHi 48 RHimin 32 RHimax 57 TRHimin 17:03 DRHimin 21-10-2009 TRHimax 22:24 DRHimax 07-10-2009 RHo 72 RHomin 27 RHomax 96 TRHomin 16:41 DRHomin 20-08-2009 TRHomax 06:28 DRHomax 02-11-2009 WS 0.0 DIRtext WSW DIR0 247.5 DIR1 247.5 DIR2 247.5 DIR3 247.5 DIR4 247.5 DIR5 247.5 WC 14.2 WCmin -0.4 WCmax 35.6 TWCmin 07:03 DWCmin 15-10-2009 TWCmax 16:52 DWCmax 20-08-2009 WSmin 0.0 WSmax 25.6 TWSmin 10:44 DWSmin 14-11-2009 TWSmax 19:08 DWSmax 24-09-2009 R1h 0.00 R1hmax 24.34 TR1hmax 22:34 DR1hmax 07-10-2009 R24h 0.00 R24hmax 55.42 TR24hmax 07:11 DR24hmax 08-10-2009 R1w 29.00 R1wmax 95.83 TR1wmax 00:00 DR1wmax 12-10-2009 R1m 117.58 R1mmax 117.58 TR1mmax 00:00 DR1mmax 01-11-2009 Rtot 3028.70 TRtot 03:29 DRtot 18-09-2005 RP 992.200 AP 995.900 RPmin 970.300 RPmax 1020.000 TRPmin 05:25 DRPmin 04-11-2009 TRPmax 09:19 DRPmax 11-09-2009 Tendency Falling Forecast CloudyThere is no expectation on the readings received from the fetch3600 binary; so, in essence, if you have a similar setup (unsupported, attached weather station and a means to get it's reading into an output similar to above's), you should be able to use WS3600.pm with a custom written script to interface FHEM with your station as well. WS3600.pm only recognizes the above readings (and translates these into, e. g.,
Temp-inside for Ti for use within FHEM), other
lines are silently dropped on the floor.model: WS3600 or WS2300 (not used for anything, yet)define my3600 W36000 /usr/local/bin/fetch360define <name> Weather <location> [<interval> [<language>]]location is the WOEID (WHERE-ON-EARTH-ID), go to
http://weather.yahoo.com to find it out for your location.interval is the time between subsequent updates
in seconds. It defaults to 3600 (1 hour).de,
en,
nl,
It determines the natural language in which the forecast information appears.
It defaults to en. If you want to set the language you also have to set the interval.
define MyWeather Weather 673513
define Forecast Weather 673513 1800
set <name> updateinterval seconds later.get <name> <reading>| city | name of town returned for location |
| code | current condition code |
| condition | current condition |
| current_date_time | last update of forecast on server |
| fc?_code | forecast condition code |
| fc?_condition | forecast condition |
| fc?_day_of_week | day of week for day +? |
| fc?_high_c | forecasted daily high in degrees centigrade |
| fc?_icon | forecast icon |
| fc?_low_c | forecasted daily low in degrees centigrade |
| humidity | current humidity in % |
| icon | relative path for current icon |
| pressure | air pressure in hPa |
| pressure_trend | air pressure trend (0= steady, 1= rising, 2= falling) |
| pressure_trend_txt | textual representation of air pressure trend |
| pressure_trend_sym | symbolic representation of air pressure trend |
| temperature | current temperature in degrees centigrade |
| temp_c | current temperature in degrees centigrade |
| temp_f | current temperature in degrees Fahrenheit |
| visibility | visibility in km |
| wind | wind speed in km/h |
| wind_chill | wind chill in degrees centigrade |
| wind_condition | wind direction and speed |
| wind_direction | direction wind comes from in degrees (0 = north wind) |
| wind_speed | same as wind |
define <name> X10 <model> <housecode>
<unitcode>
<model> is one of
lm12: lamp module, dimmablelm15: lamp module, not dimmableam12: appliance module, not dimmabletm12: tranceiver module, not dimmable. Its
unitcode is 1.<housecode> ranges from A to P.<unitcode> ranges from 1 to 16.define lamp1 X10 lm12 N 10define pump X10 am12 B 7define lamp2 X10 lm15 N 11set <name> <value> [<argument>]
value is one of:
dimdown # requires argument, see the note
dimup # requires argument, see the note
off
on
on-till # Special, see the note
on-for-timer # Special, see the note
Examples:
set lamp1 dimup 10set lamp1,lamp2 offset pump offset lamp2 on-till 19:59set lamp2 on-for-timer 00:02:30model argument in its define
statement.dimdown and dimup take a number in the
range from 0 to 22 as argument. It is assumed that argument 1 is
a 1% brightness change (microdim) and arguments 2 to 22 are
10%..100% brightness changes. The meaning of argument 0 is
unclear.dimdown and dimup codes are logged with
different meaning of the arguments depending on whether the commands
were sent from the PC or from a remote control or a wall switch.dimdown and dimup from on and off states may
have unexpected results. This seems to be a feature of the X10
devices.on-till requires an absolute time in the "at" format
(HH:MM:SS, HH:MM) or { <perl code> }, where the perl code
returns a time specification).
If the current time is greater than the specified time, then the
command is ignored, else an "on" command is generated, and for the
given "till-time" an off command is scheduleld via the at command.
on-for-timer requires a relative time in the "at" format
(HH:MM:SS, HH:MM) or { <perl code> }, where the perl code
returns a time specification).
xmllist [devspec]
fhem> xmllist
<FHZINFO>
<internal_LIST>
<internal name="global" state="internal" sets="" attrs="room configfile logfile ...">
<INT key="DEF" value="<no definition>"/>
<INT key="NR" value="0"/>
<INT key="STATE" value="internal"/>
[...]
define <name> YAMAHA_AVR <ip-address> [<zone>] [<status_interval>]
define AV_Receiver YAMAHA_AVR 192.168.0.10
define AV_Receiver YAMAHA_AVR 192.168.0.10 mainzone 60 # With custom interval of 60 seconds
define AV_Receiver YAMAHA_AVR 192.168.0.10 # If no zone is specified, the "Main Zone" will be used.
attr AV_Receiver YAMAHA_AVR room Livingroom
# Define the second zone
define AV_Receiver_Zone2 YAMAHA_AVR 192.168.0.10 zone2
attr AV_Receiver_Zone2 room Bedroom
set <name> <command> [<parameter>]
on
off
input hdmi1
input hdmi2
input hdmi3
input hdmi4
input av1
input av2
input av3
input av3
input av4
input av5
input av6
input usb
input airplay
input tuner
input v-aux
input audio
input server
scene scene1
scene scene2
scene scene3
scene scene4
volume -80..16 # (volume between -80 and +16 dB)
mute on
mute off
remoteControl up
remoteControl down
remoteControl left
remoteControl right
remoteControl enter
remoteControl return
remoteControl setup
remoteControl option
remoteControl display
# the initial definition.
define AV_receiver YAMAHA_AVR 192.168.0.3
sub startNetRadio()
{
fhem "set AV_Receiver on";
sleep 5;
fhem "set AV_Receiver input netradio";
sleep 4;
fhem "set AV_Receiver remoteControl enter";
sleep 2;
fhem "set AV_Receiver remoteControl enter";
}
{startNetRadio()}
get <name> <what>
power
input
mute
volume_leveldefine <name> ZWDongle <device>
define zwdongle_1 ZWDongle /dev/cu.PL2303-000014FA@115200define <name> ZWave <homeId> <id> [classes]
define lamp ZWave 00ce2074 9attr lamp classes SWITCH_BINARY BASIC MANUFACTURER_SPECIFIC VERSION SWITCH_ALL ASSOCIATION METER CONFIGURATION ALARMdefine <name> at <timespec> <command><timespec> format: [+][*{N}]<timedet>+ indicates that the specification is
relative(i.e. it will be added to the current time).* indicates that the command should be
executed repeatedly.{N} after the * indicates,that the command
should be repeated N-times only.
# absolute ones:
define a1 at 17:00:00 set lamp on # fhem command
define a2 at 17:00:00 { Log 1, "Teatime" } # Perl command
define a3 at 17:00:00 "/bin/echo "Teatime" > /dev/console" # shell command
define a4 at *17:00:00 set lamp on # every day
# relative ones
define a5 at +00:00:10 set lamp on # switch on in 10 seconds
define a6 at +00:00:02 set lamp on-for-timer 1 # Blink once in 2 seconds
define a7 at +*{3}00:00:02 set lamp on-for-timer 1 # Blink 3 times
# Blink 3 times if the piri sends a command
define n1 notify piri:on.* define a8 at +*{3}00:00:02 set lamp on-for-timer 1
# Switch the lamp on from sunset to 11 PM
define a9 at +*{sunset_rel()} set lamp on
define a10 at *23:00:00 set lamp off
# More elegant version, works for sunset > 23:00 too
define a11 at +*{sunset_rel()} set lamp on-till 23:00
# Only do this on weekend
define a12 at +*{sunset_rel()} { fhem("set lamp on-till 23:00") if($we) }
# Switch lamp1 and lamp2 on from 7:00 till 10 minutes after sunrise
define a13 at *07:00 set lamp1,lamp2 on-till {sunrise(+600)}
# Switch the lamp off 2 minutes after sunrise each day
define a14 at +{sunrise(+120)} set lamp on
# Switch lamp1 on at sunset, not before 18:00 and not after 21:00
define a15 at *{sunset(0,"18:00","21:00")} set lamp1 on
Notes:* is specified, then a command will be executed
only once, and then the at entry will be deleted. In
this case the command will be saved to the statefile (as it
considered volatile, i.e. entered by cronjob) and not to the
configfile (see the save command.)
define <name> autocreate
define autocreate autocreate
attr autocreate autosave
attr autocreate device_room %TYPE
attr autocreate filelog test2/log/%NAME-%Y.log
attr autocreate weblink
attr autocreate weblink_room Plots
Set
usb scan
usb create
define <name> average <regexp>
# Compute the average, minimum and maximum for the temperature events of
# the ws1 device
define avg_temp_ws1 average ws1:temperature.*
# Compute the average, minimum and maximum for each temperature event
define avg_temp_ws1 average .*:temperature.*
# Compute the average, minimum and maximum for all temperature and humidity events
# Events:
# ws1 temperature: 22.3
# ws1 humidity: 67.4
define avg_temp_ws1 average .*:(temperature|humidity).*
# Compute the same from a combined event. Note: we need two average
# definitions here, each of them defining the name with the first
# paranthesis, and the value with the second.
#
# Event: ws1 T: 52.3 H: 67.4
define avg_temp_ws1_t average ws1:(T):.([-\d\.]+).*
define avg_temp_ws1_h average ws1:.*(H):.([-\d\.]+).*
Set backupdefine <name> dewpoint dewpoint <devicename-regex> [<temp_name> <hum_name> <new_name>]
# Compute the dewpoint for the temperature/humidity
# events of the temp1 device and generate reading dewpoint.
define dew_temp1 dewpoint dewpoint temp1
define dew_temp1 dewpoint dewpoint temp1 temperature humidity dewpoint
# Compute the dewpoint for the temperature/humidity
# events of all devices offering temperature and humidity
# and generate reading dewpoint.
define dew_all dewpoint dewpoint .*
define dew_all dewpoint dewpoint .* temperature humidity dewpoint
# Compute the dewpoint for the temperature/humidity
# events of the device Aussen_1 offering temperature and humidity
# and insert is into STATE.
define dew_state dewpoint dewpoint Aussen_1 T H D
# Compute the dewpoint for the temperature/humidity
# events of all devices offering temperature and humidity
# and insert the result into the STATE.
# Example STATE: "T: 10 H: 62.5" will change to
# "T: 10 H: 62.5 D: 3.2"
define dew_state dewpoint dewpoint .* T H D
define <name> dewpoint fan <devicename-regex> <devicename-outside> <min-temp> [<diff_temp>]
# Generate event "fan: on" when dewpoint of Aussen_1 is first
# time lower than basement_tempsensor and outside temperature is >= 0
# and change it to "fan: off" is this condition changes.
# Set a switch on/off (fan_switch) depending on the state.
define dew_fan1 dewpoint fan basement_tempsensor Aussen_1 0
define dew_fan1_on notify basement_tempsensor.*fan:.*on set fan_switch on
define dew_fan1_off notify basement_tempsensor.*fan:.*off set fan_switch off
define <name> dewpoint alarm <devicename-regex> <devicename-reference> <diff-temp>
# Using a wall temperature sensor (wallsensor) and a temp/hum sensor
# (roomsensor) to alarm if the temperature of the wall is lower than
# the dewpoint of the air. In this case the water of the air will
# condense on the wall because the wall is cold.
# Set a switch on (alarm_siren) if alarm is on using notify.
define dew_alarm1 dewpoint alarm roomsensor wallsensor 0
define roomsensor_alarm_on notify roomsensor.*alarm:.*on set alarm_siren on
define roomsensor_alarm_off notify roomsensor.*alarm:.*off set alarm_siren off
# If you do not have a temperature sensor in/on the wall, you may also
# compare the rooms dewpoint to the temperature of the same or another
# inside sensor. Alarm is temperature is 5 degrees colder than the
# inside dewpointinside.
define dev_alarm2 dewpoint alarm roomsensor roomsensor 5
Set
# allow maximum time difference of 60 seconds
define dew_all dewpoint dewpoint .*
attr dew_all max_timediff 60
define <name> dummy
define myvar dummyset myvar 7set <name> <value>define <name> eventTypes <filename>
define et eventTypes log/eventTypes.txtfheminfo [send]
send transmitts the collected data
to a central server in order to support the development of FHEM. The
transmitted data is processed graphically. The results can be viewed
on http://fhem.de/stats/statistics.cgi.
Based on the IP address, the approximate location is determined with
an accuracy of about 40-80 km. The IP address is not saved.
fhem> fheminfo
Fhem info:
Release : 5.3
Branch : DEVELOPMENT
OS : linux
Arch : i686-linux-gnu-thread-multi-64int
Perl : v5.14.2
uniqueID : 87c5cca38dc75a4f388ef87bdcbfbf6f
Defined modules:
ACU : 1
CUL : 1
CUL_FHTTK : 12
CUL_HM : 66
CUL_WS : 3
FHEM2FHEM : 1
FHEMWEB : 3
FHT : 9
[...]
at : 4
autocreate : 1
dummy : 23
notify : 54
structure : 3
telnet : 2
watchdog : 9
weblink : 17
Defined models per module:
CUL : CUN
CUL_FHTTK : FHT80TF
CUL_HM : HM-CC-TC,HM-CC-VD,HM-LC-DIM1T-CV,HM-LC-DIM1T-FM,HM-LC-SW1-PL,[...]
CUL_WS : S555TH
FHT : fht80b
FS20 : fs20pira,fs20s16,fs20s4a,fs20sd,fs20st
HMS : hms100-mg,hms100-tf,hms100-wd
KS300 : ks300
OWSWITCH : DS2413
send parameter. They are set on attr global.
87c5cca38dc75a4f388ef87bdcbfbf6f which is assigned to the transmitted
data to prevent duplicate entries.
uniqueID is stored automatically in a file named FhemUtils/uniqueID
in FHEM's modules path.
update command automatically) and please restore
this file to the same path (FhemUtils in FHEM's modules path), if you plan to
reinstall your FHEM installation. This prevents duplicate entries for identical
installations on the same hardware in the statistics.
update command.
onUpdate: transfer of data on every update (recommended setting).
manually: manually transfer of data via the fheminfo send command.
never: prevents transmission of data at anytime.
define <name> holiday
get <name> <MM-DD>get <name> yesterdayget <name> todayget <name> tomorrownotice [confirm [value]|list [<keyword>]|reset [yes]|view <id> [noheader|[de|en]]]notice' a list of all messages is displayed.
Are messages available in different languages, they are ordered by language.
fhem> notice
==> Language: de
ID Published Expired Confirmed Description
advice-20130128-002 actually never not needed kurze beschreibung
update-20130128-002 31.01.2013 01.02.2013 no kurze beschreibung
==> Language: en
ID Published Expired Confirmed Description
advice-20130128-001 actually never no short description
advice-20130128-002 actually never not needed short description
update-20130128-001 actually never no short description
update-20130128-002 31.01.2013 01.02.2013 no short description
By entering 'notice list <keyword>' the output of the list contains only
available messages that starts with '<keyword>'.
fhem> notice list update
==> Language: de
ID Published Expired Confirmed Description
update-20130128-002 31.01.2013 01.02.2013 no kurze beschreibung
==> Language: en
ID Published Expired Confirmed Description
update-20130128-001 actually never no short description
update-20130128-002 31.01.2013 01.02.2013 no short description
To display a single message, enter the command 'notice view <id>' where id
is the Identifier of the message. You can use the optional parameter noheader
or the language codes de or en to display the message
without the header informations or in your prefered language if available.
fhem> notice view advice-20130128-002 de
ID : advice-20130128-002
From : M. Fischer
Date : 28.01.2013
Expire : 0
Title : kurze beschreibung
### Start of Text
test-advice
dies ist ein test
001
### End of Text
If it is necessary to confirm a message, this is be done by entering 'notice confirm <id> [value]'.
The optional argument value will also be stored with the confirmation.
fhem> notice confirm update-20130128-001 foo:bar
update-20130128-001 confirmed on 2013-01-29 20:58:57: foo:bar
Sometimes it is necessary to reset all confirmations. This is be done by entering
'notice reset'.
fhem> notice reset
This command delete all confirmations.
If you really want to do this, call 'notice reset yes'
notice [condition <id>|get <keyword> <value>|position <id>]condition supplies the determined
value(s) of the embedded test(s) as a key:value pair. If more than one pair returned, they they are seperated by |.
It is possible to define your own rules for a condition, like !empty or >>5 and so on. An example
of a condition is shown in the below example message file.
Example:
fhem> notice condition update-20130127-001
configfile:./fhem.cfg|sendStatistics:never:!empty
The argument get, followed by a keyword and a number from 0 to 8, returns a
comma seperated list of message ids.
The possible outputs are:
0 returns a list of all messages.1 returns a list of unconfirmed messages.2 returns a list of messages that are not expired.3 returns a list of messages that are not expired and unconfirmed.4 returns a list of published messages.5 returns a list of unconfirmed and published messages.6 returns a list of published messages that are not expired.7 returns a list of published, unconfirmed and not expired messages.8 returns a list of confirmed messages.
fhem> notice get all 2
advice-20130128-001,advice-20130128-002,update-20130128-001,update-20130128-002
The argument position followed by an <id> returns the view position of a message if defined.
fhem> notice position update-20130128-001
before
Example of a message file:
# FROM: M. Fischer
# DATE: 28.01.2013
# CONFIRM: 1
# PUBLISH: 31.01.2013
# EXPIRE: 01.02.2013
# KEY_1: sendStatistics
# VAL_1: AttrVal("global","sendStatistics",undef);
# CON_1: !empty
# KEY_2: configfile
# VAL_2: AttrVal("global","configfile",undef);
# POSITION: top
# TITLE_DE: kurze beschreibung
# NOTICE_DE
Hinweis:
dies ist ein test
# TITLE_EN: short description
# NOTICE_EN
Advice:
this is a test
The keywords 'FROM, DATE, CONFIRM, PUBLISH, EXPIRE, TITLE_DE, TITLE_EN, NOTICE_DE, NOTICE_EN' are fixed.
It is possible to add any key:value string to these files. Also it is possible to set only one or both keywords of
'TITLE_DE, TITLE_EN' and 'NOTICE_DE, NOTICE_EN'.
define <name> notify <pattern> <command>
<pattern>. If
<command> is enclosed in {}, then it is a perl expression, if it is
enclosed in "", then it is a shell command, else it is a "plain" fhem.pl
command (chain). See the trigger command for
testing it.
Examples:
define b3lampV1 notify btn3 set lamp $EVENTdefine b3lampV2 notify btn3 { fhem "set lamp $EVENT" }define b3lampV3 notify btn3 "/usr/local/bin/setlamp "$EVENT""define b3lampV3 notify btn3 set lamp1 $EVENT;;set lamp2 $EVENTdefine wzMessLg notify wz:measured.* "/usr/local/bin/logfht $NAME "$EVENT""define LogUndef notify global:UNDEFINED.* "send-me-mail.sh "$EVENT""<pattern> is either the name of the triggering
device, or devicename:event.<pattern> must completely (!)
match either the device name, or the compound of the device name and the
event. To identify the events use "inform" command in telnet or "Event
Monitor" in FHEMWEB.measured-temp: 21.7 (Celsius)$EVTPART0="measured-temp:", $EVTPART1="21.7",
$EVTPART2="(Celsius)". This data is available as a local
variable in perl, as environment variable for shell scripts, and will
be textually replaced for FHEM commands.myFht% will be replaced with the received
event, e.g. with on or off or
measured-temp: 21.7 (Celsius)% into double quotes, else the shell may get a syntax
error.@ will be replaced with the device
name.% and @, the parameters
%EVENT (same as %), %NAME (same
as @) and %TYPE (contains the device type,
e.g. FHT) can be used. The space separated event "parts"
are available as %EVTPART0, %EVTPART1, etc. A single %
looses its special meaning if any of these parameters appears in the
definition.fhem> define MyMacro notify MyMacro { Log 1, "Hello"}fhem> trigger MyMacrodefine <name> sequence <re1> <timeout1> <re2> [<timeout2> <re3> ...]
define lampseq sequence Btn1:on 0.5 Btn2:off 0.5 Btn1:on
define lampon notify lampseq:trigger set lamp on
define <name> structure <struct_type> <dev1> <dev2> ...
define kitchen structure room lamp1 lamp2
attr lamp1 structexclude kitchen
attr lamp1 structexclude kitchen:stateFormat
define <name> telnet <portNumber> [global]define <name> telnet <servername>:<portNumber>
<portNumber> for incoming
connections. If the second parameter global is not specified,
the server will only listen to localhost connections.
define tPort telnet 7072 globalattr tPort globalpassword mySecretattr tPort SSL
attr tPort password secret
attr tPort password {use FritzBoxUtils;;FB_checkPw("localhost","$password") }
or if you defined multiple users on the Fritzbox:
attr tPort password {use FritzBoxUtils;;FB_checkPw("localhost","$user", "$password") }
update [development|stable] [<file|package>] [force]update [development|stable] checkupdate housekeepingupdate thirdparty <url> <package> [force]update thirdparty <url> <package> checkCheck for new updates:
fhem> update check
FHEM update:
fhem> update
Force FHEM update (all files are updated!):
fhem> update force
Update a single file:
fhem> update 98_foobar.pm
Search for a filename:
fhem> update backup
'backup' not found. Did you mean:
==> 98_backup.pm
nothing to do...
Update / install a third-party package:
fhem> update thirdparty http://domain.tld/path packagename
Check a third-party package for new updates:
fhem> update thirdparty http://domain.tld/path packagename check
Attributes
define <name> watchdog <regexp1> <timespec> <regexp2> <command>
# Request data from the FHT80 _once_ if we do not receive any message for
# 15 Minutes.
define w watchdog FHT80 00:15:00 SAME set FHT80 date
# Request data from the FHT80 _each_ time we do not receive any message for
# 15 Minutes, i.e. reactivate the watchdog after it triggered. Might be
# dangerous, as it can trigger in a loop.
define w watchdog FHT80 00:15:00 SAME set FHT80 date;; trigger w .
# Shout once if the HMS100-FIT is not alive
define w watchdog HMS100-FIT 01:00:00 SAME "alarm-fit.sh"
# Send mail if the window is left open
define w watchdog contact1:open 00:15 contact1:closed "mail_me close window1"
attr w regexp1WontReactivate
Notes:define <name> weblink [link|fileplot|dbplot|image|iframe|htmlCode|cmdList]
<argument>
define homepage weblink link http://www.fhem.dedefine webcam_picture weblink image http://w.x.y.z/current.jpgdefine interactive_webcam weblink iframe http://w.x.y.z/webcam.cgidefine hr weblink htmlCode <hr>define w_Frlink weblink htmlCode { WeatherAsHtml("w_Frankfurt") }define MyPlot weblink fileplot <logdevice>:<gnuplot-file>:<logfile>define MyPlot weblink dbplot <logdevice>:<gnuplot-file>define systemCommands weblink cmdList pair:Pair:set+cul2+hmPairForSec+60 restart:Restart:shutdown+restart update:UpdateCheck:update+check
define yw weblink wl_im1 iframe http://weather.yahooapis.com/forecastrss?w=650272&u=c
attr yw weblink htmlattr width="480" height="560"
define <name> xxLG7000 <serial-device>
xxLG7000, e. g. 47LG7000 (tested)xxPG7000, e. g. 50PG7000 (same Manual as 47LG7000 ;))PS3000/6000/7000/8000 series (according to LG brochure; no liabilities assumed)PQ3000/6000 series (see PS3000)LU4000/5000 series (not LU7000; see PS3000)LH2000/3000/4000/5000 series (see PS3000)SL9500/9000/8000 series (see PS3000)define myLG7k xxLG7000 /dev/ttyUSB1set terminal size <SIZE> #FileLog 4::: plot title 'Temperature' with linesThe .gnuplot file consists of 3 parts: