Mit 2-fach Taster Relays Schalten

Begonnen von willhelm, 06 Mai 2014, 16:38:04

Vorheriges Thema - Nächstes Thema

willhelm

Hallo ich habe einen 2-fach taster von Enocean im einsatz. Nuun möchte ich damit ein Velleman VM 8090 (8 Relays die via USB verbunden sind) Schalten (also nur 1 Relais ein und aus).

die kommunikation zwischen raspberry und relais funktioniert aber ich habe keine ahnung wie ich es durch die fhem software programmieren kann dass es schaltret
im cmd soll folgender befehl auf knopfdruck ausgelöst werden.

os.system("cat relay1off.txt >>/dev/ttyACM0


kann mir jemand sagen wie ich das machen muss?

vilelen dank
grüsse willhelm

rudolfkoenig

Ein notify aufsetzen (Siehe Event-Monitor + notify), und als Befehl "cat relay1off.txt >>/dev/ttyACM0" ausfuehren. Letzteres ist hier beschrieben

willhelm

Hallo Leider habe ich keine ahnung von perl und von fhem erst recht nicht ich möchte einfach mit dem EnOcean schalter ein kommando im terminal ausführen.

die konfiguration die ich zusammen kopiert habe sieht folgender massen aus

attr global autoload_undefined_devices 1
attr global logfile ./log/fhem-%Y-%m.log
attr global modpath .
attr global motd SecurityCheck:\\
\\
WEB,WEBphone,WEBtablet has no basicAuth attribute.\\
telnetPort has no password/globalpassword attribute.\\
\\
Restart fhem for a new check if the problem is fixed,\\
or set the global attribute motd to none to supress this message.\\

attr global statefile ./log/fhem.save
attr global updateInBackground 1
attr global userattr devStateIcon devStateStyle icon sortby webCmd
attr global verbose
attr global verpose  devstatioIcon dev SteateStyle icon sortby webCmd
attr global statefile ./log/fehm.save

define telnetPort telnet 7072 global

define WEB FHEMWEB 8083 global

define WEBphone FHEMWEB 8084 global
attr WEBphone stylesheetPrefix smallscreen

define WEBtablet FHEMWEB 8085 global
attr WEBtablet stylesheetPrefix touchpad

# Fake FileLog entry, to access the fhem log from FHEMWEB
define Logfile FileLog ./log/fhem-%Y-%m.log fakelog

define autocreate autocreate
attr autocreate filelog ./log/%NAME-%Y.log

define eventTypes eventTypes ./log/eventTypes.txt

# Disable this to avoid looking for new USB devices on startup
define initialUsbCheck notify global:INITIALIZED usb create

#---------------------------------
# Eltako FSR61   
#---------------------------------
define actuator1 EnOcean 0187970B
attr actuator1 group 0 Living Room
attr actuator1 manufID 00D
attr actuator1 model FSR61
attr actuator1 room EnOcean
attr actuator1 subDef FF9AAE81
attr actuator1 subType switch
define TCM310_0 TCM 310 /dev/ttyAMA0@57600
define EnO_switch_FEFEBD73 EnOcean FEFEBD73
attr EnO_switch_FEFEBD73 room EnOcean
attr EnO_switch_FEFEBD73 subType switch
define FileLog_EnO_switch_FEFEBD73 FileLog ./log/EnO_switch_FEFEBD73-%Y.log EnO_switch_FEFEBD73
attr FileLog_EnO_switch_FEFEBD73 logtype text
attr FileLog_EnO_switch_FEFEBD73 room EnOcean

#---------------------------------
# Eltako FT55
# Has an EnOcean PTM215 Module built in. This module supports 4 switches A0/AI, B0/BI.
# Only one pair is mechanically activated.
#---------------------------------
define switch1 EnOcean FEFF2D58
attr switch1 group 0 Living Room
attr switch1 model FT55
attr switch1 room Living Room
attr switch1 subType switch
define EnO_contact_018161E4 EnOcean 018161E4
attr EnO_contact_018161E4 c
attr EnO_contact_018161E4 subType contact
define FileLog_EnO_contact_018161E4 FileLog ./log/EnO_contact_018161E4-%Y.log EnO_contact_018161E4
attr FileLog_EnO_contact_018161E4 logtype text
attr FileLog_EnO_contact_018161E4 room EnOcean

define nswitch1B0 notify switch1:B0 { \
    if    (ReadingsVal("actuator1","channelB","") eq "BI") {fhem "set actuator1 B0"}   \
    elsif (ReadingsVal("actuator1","channelB","") eq "B0") {fhem "set actuator1 BI"} ;;\
}

define nswitch1BI notify switch1:BI set s1 toggle

define b3lampV1 notify btn3 set lamp $EVENT
define 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 $EVENT
define wzMessLg notify wz:measured.* "/usr/local/bin/logfht $NAME "$EVENT""
define LogUndef notify global:UNDEFINED.* "send-me-mail.sh "$EVE0NT""

"fhem.pl 7072 "cat relay1on.txt >>/dev/ttyACM0""

set lamp1 on
set lamp1,lamp2,lamp3 on
set lamp.* on
set room=kitchen off
set room=kitchen:FILTER=STATE=on off
set room=kitchen:FILTER=STATE!=off off
list disabled=
list TYPE=FS20 STATE¨




kann mir jemand sagen ob und was ich da noch verändern muss damit es funktionieren kann?