ITach: Unterschied zwischen den Versionen

Aus FHEMWiki
(Die Seite wurde neu angelegt: „== iTach == BenWend hat [http://forum.fhem.de/index.php?t=msg&goto=82502&rid=1421&srch=itach#msg_82502 im Forum] den Code gepostet, wie man iTach Devices steue…“)
 
K (Kleinere Korrekturen)
Zeile 1: Zeile 1:
== iTach ==
iTach sind LAN / IR Gateways, mit denen über das Netzwerk Infrarotbefehle geschickt werden können.
 
BenWend hat [http://forum.fhem.de/index.php?t=msg&goto=82502&rid=1421&srch=itach#msg_82502 im Forum] den Code gepostet, wie man iTach Devices steuern kann.
BenWend hat [http://forum.fhem.de/index.php?t=msg&goto=82502&rid=1421&srch=itach#msg_82502 im Forum] den Code gepostet, wie man iTach Devices steuern kann.


iTach sind LAN / IR Gateways, man kann also über das Netzwerk Infrarotbefehle schicken.


== Der Code ==


== Der Code ==
=== itach.pl ===
Die Datei itach.pl muss an der Stelle im Filesystem abgelegt werden, die später in Definitionen in der Konfigurationsdatei referiert wird (im diesem Beispiel also <code>/opt/fhem/FHEM/</code>).


'''itach.pl'''
  <nowiki>
  <nowiki>
use IO::Socket::INET;
use IO::Socket::INET;
Zeile 26: Zeile 27:
</nowiki>
</nowiki>


'''fhem.cfg'''
=== fhem.cfg ===
Die in der Konfiguration (fhem.cfg oder eine andere, mit include eingebundene Datei) erforderlichen Definitionen:
 
  <nowiki>
  <nowiki>
#---- itach ATV Schlafzimmer
#---- itach ATV Schlafzimmer
Zeile 48: Zeile 51:
define ATVSZ_select notify ATVSZ:select.* {system("perl /opt/fhem/FHEM/itach.pl sendir,1:2,1,39000,1,1,348,172,21,22,21,63,21,63,21,63,21,22,21,63,21,63,21,63,21,63,21,63,21,63,21,22,21,22,21,22,21,22,21,63,21,63,21,22,21,63,21,63,21,63,21,22,21,63,21,22,21,22,21,63,21,22,21,63,21,22,21,63,21,22,21,63,21,1391,348,172,21,22,21,63,21,63,21,63,21,22,21,63,21,63,21,63,21,63,21,63,21,63,21,22,21,22,21,22,21,22,21,63,21,22,21,22,21,63,21,22,21,22,21,22,21,22,21,22,21,22,21,63,21,22,21,63,21,22,21,63,21,22,21,63,21,780");;}
define ATVSZ_select notify ATVSZ:select.* {system("perl /opt/fhem/FHEM/itach.pl sendir,1:2,1,39000,1,1,348,172,21,22,21,63,21,63,21,63,21,22,21,63,21,63,21,63,21,63,21,63,21,63,21,22,21,22,21,22,21,22,21,63,21,63,21,22,21,63,21,63,21,63,21,22,21,63,21,22,21,22,21,63,21,22,21,63,21,22,21,63,21,22,21,63,21,1391,348,172,21,22,21,63,21,63,21,63,21,22,21,63,21,63,21,63,21,63,21,63,21,63,21,22,21,22,21,22,21,22,21,63,21,22,21,22,21,63,21,22,21,22,21,22,21,22,21,22,21,22,21,63,21,22,21,63,21,22,21,63,21,22,21,63,21,780");;}
</nowiki>
</nowiki>


== Links ==
== Links ==
[http://forum.fhem.de/index.php?t=msg&goto=82502&rid=1421&srch=itach#msg_82502 BenWends Code für die Steuerung]
* BenWends [http://forum.fhem.de/index.php?t=msg&goto=82502&rid=1421&srch=itach#msg_82502 Forenbeitrag] mit dem Code für die Steuerung
 
* [http://www.globalcache.com/products/itach/ Webseiten des Herstellers] der iTach Produkte
[http://www.globalcache.com/products/itach/ Hersteller]


[[Kategorie:Socks]]
[[Kategorie:Socks]]
[[Kategorie:Unterhaltungselektronik]]
[[Kategorie:Unterhaltungselektronik]]

Version vom 2. August 2013, 07:58 Uhr

iTach sind LAN / IR Gateways, mit denen über das Netzwerk Infrarotbefehle geschickt werden können.

BenWend hat im Forum den Code gepostet, wie man iTach Devices steuern kann.


Der Code

itach.pl

Die Datei itach.pl muss an der Stelle im Filesystem abgelegt werden, die später in Definitionen in der Konfigurationsdatei referiert wird (im diesem Beispiel also /opt/fhem/FHEM/).

use IO::Socket::INET;

my ($socket,$client_socket);
$socket = new IO::Socket::INET (
    PeerHost => '192.168.178.51',
    PeerPort => '4998',
    Proto => 'tcp',
) or die "ERROR in Socket Creation : $!\n";

# send itach command
$data = $ARGV[0]."\r\n";
$socket->send($data);
sleep (1);

$socket->close();

fhem.cfg

Die in der Konfiguration (fhem.cfg oder eine andere, mit include eingebundene Datei) erforderlichen Definitionen:

#---- itach ATV Schlafzimmer
define ATVSZ dummy
attr ATVSZ room itach
attr ATVSZ setList up down left right play menu select
attr ATVSZ webCmd up:down:left:right:play:menu:select

define ATVSZ_up notify ATVSZ:up.* {system("perl /opt/fhem/FHEM/itach.pl sendir,1:2,1,38000,1,1,348,171,21,22,21,64,21,64,21,64,21,22,21,64,21,64,21,64,21,64,21,64,21,64,21,22,21,22,21,22,21,22,21,64,21,64,21,64,21,22,21,64,21,22,21,22,21,22,21,22,21,22,21,64,21,22,21,64,21,22,21,64,21,22,21,64,21,1467,347,86,21,760");;}

define ATVSZ_down notify ATVSZ:down.* {system("perl /opt/fhem/FHEM/itach.pl sendir,1:2,1,39000,1,1,348,172,21,22,21,63,21,63,21,63,21,22,21,63,21,63,21,63,21,63,21,63,21,63,21,22,21,22,21,22,21,22,21,63,21,63,21,22,21,63,21,63,21,22,21,22,21,22,21,22,21,22,21,63,21,22,21,63,21,22,21,63,21,22,21,63,21,1472,347,86,21,780");;}

define ATVSZ_left notify ATVSZ:left.* {system("perl /opt/fhem/FHEM/itach.pl sendir,1:2,1,39000,1,1,341,173,21,22,21,65,21,65,21,65,21,22,21,65,21,65,21,65,21,65,21,65,21,65,21,22,21,22,21,22,21,22,21,65,21,22,21,22,21,22,21,65,21,22,21,22,21,22,21,22,21,22,21,65,21,22,21,65,21,22,21,65,21,22,21,65,21,1562,347,86,21,780");;}

define ATVSZ_right notify ATVSZ:right.* {system("perl /opt/fhem/FHEM/itach.pl sendir,1:2,1,39000,1,1,348,172,21,22,21,63,21,63,21,63,21,22,21,63,21,63,21,63,21,63,21,63,21,63,21,22,21,22,21,22,21,22,21,63,21,63,21,63,21,63,21,22,21,22,21,22,21,22,21,22,21,22,21,63,21,22,21,63,21,22,21,63,21,22,21,63,21,1472,347,87,21,780");;}

define ATVSZ_play notify ATVSZ:play.* {system("perl /opt/fhem/FHEM/itach.pl sendir,1:2,1,38000,1,1,348,171,21,22,21,64,21,64,21,64,21,22,21,64,21,64,21,64,21,64,21,64,21,64,21,22,21,22,21,22,21,22,21,64,21,22,21,64,21,64,21,64,21,64,21,22,21,64,21,22,21,22,21,64,21,22,21,64,21,22,21,64,21,22,21,64,21,760");;}

define ATVSZ_menu notify ATVSZ:menu.* {system("perl /opt/fhem/FHEM/itach.pl sendir,1:2,1,39000,1,1,348,172,21,22,21,63,21,63,21,63,21,22,21,63,21,63,21,63,21,63,21,63,21,63,21,22,21,22,21,22,21,22,21,63,21,22,21,63,21,22,21,22,21,22,21,22,21,22,21,22,21,22,21,63,21,22,21,63,21,22,21,63,21,22,21,63,21,1559,347,86,21,780");;}

define ATVSZ_select notify ATVSZ:select.* {system("perl /opt/fhem/FHEM/itach.pl sendir,1:2,1,39000,1,1,348,172,21,22,21,63,21,63,21,63,21,22,21,63,21,63,21,63,21,63,21,63,21,63,21,22,21,22,21,22,21,22,21,63,21,63,21,22,21,63,21,63,21,63,21,22,21,63,21,22,21,22,21,63,21,22,21,63,21,22,21,63,21,22,21,63,21,1391,348,172,21,22,21,63,21,63,21,63,21,22,21,63,21,63,21,63,21,63,21,63,21,63,21,22,21,22,21,22,21,22,21,63,21,22,21,22,21,63,21,22,21,22,21,22,21,22,21,22,21,22,21,63,21,22,21,63,21,22,21,63,21,22,21,63,21,780");;}

Links