mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-21 01:46:08 +00:00
adding remoteControl commands + documentation, fixing not working input selection
git-svn-id: https://svn.fhem.de/fhem/trunk@2520 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c037171b4a
commit
7bfaa0bdeb
@ -205,7 +205,7 @@ YAMAHA_AVR_Set($@)
|
|||||||
return "No Argument given" if(!defined($a[1]));
|
return "No Argument given" if(!defined($a[1]));
|
||||||
|
|
||||||
my $what = $a[1];
|
my $what = $a[1];
|
||||||
my $usage = "Unknown argument $what, choose one of on off volume:slider,-80,1,16 input:".$inputs_comma." mute:on,off statusRequest";
|
my $usage = "Unknown argument $what, choose one of on off volume:slider,-80,1,16 input:".$inputs_comma." mute:on,off remoteControl:setup,up,down,left,right,return,option,display,enter statusRequest";
|
||||||
|
|
||||||
readingsBeginUpdate($hash);
|
readingsBeginUpdate($hash);
|
||||||
|
|
||||||
@ -251,7 +251,7 @@ YAMAHA_AVR_Set($@)
|
|||||||
$command = YAMAHA_AVR_getCommandParam($hash, $a[2]);
|
$command = YAMAHA_AVR_getCommandParam($hash, $a[2]);
|
||||||
if(defined($command) and length($command) > 0)
|
if(defined($command) and length($command) > 0)
|
||||||
{
|
{
|
||||||
$result = YAMAHA_AVR_SendCommand($hash, $address,"<YAMAHA_AV cmd=\"PUT\"><$zone><Input><Input_Sel>".$command."</Input_Sel></Input></$zone></YAMAHA_AV>");
|
$result = YAMAHA_AVR_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><$zone><Input><Input_Sel>".$command."</Input_Sel></Input></$zone></YAMAHA_AV>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -371,6 +371,49 @@ YAMAHA_AVR_Set($@)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
elsif($what eq "remoteControl")
|
||||||
|
{
|
||||||
|
if($a[2] eq "up")
|
||||||
|
{
|
||||||
|
YAMAHA_AVR_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><$zone><List_Control><Cursor>Up</Cursor></List_Control></$zone></YAMAHA_AV>");
|
||||||
|
}
|
||||||
|
elsif($a[2] eq "down")
|
||||||
|
{
|
||||||
|
YAMAHA_AVR_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><$zone><List_Control><Cursor>Down</Cursor></List_Control></$zone></YAMAHA_AV>");
|
||||||
|
}
|
||||||
|
elsif($a[2] eq "left")
|
||||||
|
{
|
||||||
|
YAMAHA_AVR_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><$zone><List_Control><Cursor>Left</Cursor></List_Control></$zone></YAMAHA_AV>");
|
||||||
|
}
|
||||||
|
elsif($a[2] eq "right")
|
||||||
|
{
|
||||||
|
YAMAHA_AVR_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><$zone><List_Control><Cursor>Right</Cursor></List_Control></$zone></YAMAHA_AV>");
|
||||||
|
}
|
||||||
|
elsif($a[2] eq "display")
|
||||||
|
{
|
||||||
|
YAMAHA_AVR_SendCommand($hash,"<YAMAHA_AV cmd=\"PUT\"><$zone><List_Control><Menu_Control>Display</Menu_Control></List_Control></$zone></YAMAHA_AV>");
|
||||||
|
}
|
||||||
|
elsif($a[2] eq "return")
|
||||||
|
{
|
||||||
|
YAMAHA_AVR_SendCommand($hash,"<YAMAHA_AV cmd=\"PUT\"><$zone><List_Control><Cursor>Return</Cursor></List_Control></$zone></YAMAHA_AV>");
|
||||||
|
}
|
||||||
|
elsif($a[2] eq "enter")
|
||||||
|
{
|
||||||
|
YAMAHA_AVR_SendCommand($hash,"<YAMAHA_AV cmd=\"PUT\"><$zone><List_Control><Cursor>Sel</Cursor></List_Control></$zone></YAMAHA_AV>");
|
||||||
|
}
|
||||||
|
elsif($a[2] eq "setup")
|
||||||
|
{
|
||||||
|
YAMAHA_AVR_SendCommand($hash,"<YAMAHA_AV cmd=\"PUT\"><$zone><List_Control><Menu_Control>On Screen</Menu_Control></List_Control></$zone></YAMAHA_AV");
|
||||||
|
}
|
||||||
|
elsif($a[2] eq "option")
|
||||||
|
{
|
||||||
|
YAMAHA_AVR_SendCommand($hash,"<YAMAHA_AV cmd=\"PUT\"><$zone><List_Control><Menu_Control>Option</Menu_Control></List_Control></$zone></YAMAHA_AV>");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return $usage;
|
||||||
|
}
|
||||||
|
}
|
||||||
elsif($what eq "statusRequest")
|
elsif($what eq "statusRequest")
|
||||||
{
|
{
|
||||||
# Will be executed on the end of this function anyway, so no need to call it specificly
|
# Will be executed on the end of this function anyway, so no need to call it specificly
|
||||||
@ -794,6 +837,59 @@ input server
|
|||||||
volume -80..16 (volume between -80 and +16 dB)
|
volume -80..16 (volume between -80 and +16 dB)
|
||||||
mute on
|
mute on
|
||||||
mute off</pre>
|
mute off</pre>
|
||||||
|
</ul>
|
||||||
|
<u>Remote control (not in all zones available, depending on your model)</u><br><br>
|
||||||
|
<ul>
|
||||||
|
In many receiver models, inputs exist, which can't be used just by selecting them. These inputs needs
|
||||||
|
a manual interaction with the remote control to activate the playback (e.g. Internet Radio, Network Streaming).<br><br>
|
||||||
|
For this application the following commands are available:<br><br>
|
||||||
|
|
||||||
|
<u>Cursor Selection:</u>
|
||||||
|
<pre>
|
||||||
|
remoteControl up
|
||||||
|
remoteControl down
|
||||||
|
remoteControl left
|
||||||
|
remoteControl right
|
||||||
|
remoteControl enter
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<u>Menu Selection:</u>
|
||||||
|
<pre>
|
||||||
|
remoteControl setup
|
||||||
|
remoteControl return
|
||||||
|
remoteControl option
|
||||||
|
remoteControl display
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
The button names are the same as on your remote control.<br><br>
|
||||||
|
|
||||||
|
A typical example is the automatical turn on and play an internet radio broadcast:
|
||||||
|
<pre>
|
||||||
|
# the initial definition.
|
||||||
|
define AV_receiver YAMAHA_AVR 192.168.0.3
|
||||||
|
</pre>
|
||||||
|
And in your 99_MyUtils.pm the following function:
|
||||||
|
<pre>
|
||||||
|
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";
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
The remote control commands must be separated with a sleep, because the receiver is loading meanwhile and don't accept commands.<br><br>
|
||||||
|
|
||||||
|
Now you can use this function by typing the following line in your FHEM command line or in your notify-definitions:
|
||||||
|
<pre>
|
||||||
|
{startNetRadio()}
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<a name="YAMAHA_AVRget"></a>
|
<a name="YAMAHA_AVRget"></a>
|
||||||
@ -813,7 +909,7 @@ volume_level</pre>
|
|||||||
|
|
||||||
<li><a href="#loglevel">loglevel</a></li>
|
<li><a href="#loglevel">loglevel</a></li>
|
||||||
<li><a href="#do_not_notify">do_not_notify</a></li>
|
<li><a href="#do_not_notify">do_not_notify</a></li>
|
||||||
<li><a href="#readingFnAttributes">readingFnAttributes</a></li>
|
<li><a href="#readingFnAttributes">readingFnAttributes</a></li><br>
|
||||||
<li><a name="volume-smooth-change">volume-smooth-change</a></li>
|
<li><a name="volume-smooth-change">volume-smooth-change</a></li>
|
||||||
Optional attribute to activate a smooth volume change.
|
Optional attribute to activate a smooth volume change.
|
||||||
<br><br>
|
<br><br>
|
||||||
@ -927,6 +1023,57 @@ input server
|
|||||||
volume -80..16 (Lautstärke zwischen -80 und +16 dB)
|
volume -80..16 (Lautstärke zwischen -80 und +16 dB)
|
||||||
mute on
|
mute on
|
||||||
mute off</pre>
|
mute off</pre>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
<u>Fernbedienung (je nach Modell nicht in allen Zonen verfügbar)</u><br><br>
|
||||||
|
<ul>
|
||||||
|
In vielen Receiver-Modellen existieren Eingänge, welche nach der Auswahl keinen Sound ausgeben. Diese Eingänge
|
||||||
|
bedürfen manueller Interaktion mit der Fernbedienung um die Wiedergabe zu starten (z.B. Internet Radio, Netzwerk Streaming, usw.).<br><br>
|
||||||
|
Für diesen Fall gibt es folgende Befehle:<br><br>
|
||||||
|
|
||||||
|
<u>Cursor Steuerung:</u>
|
||||||
|
<pre>
|
||||||
|
remoteControl up
|
||||||
|
remoteControl down
|
||||||
|
remoteControl left
|
||||||
|
remoteControl right
|
||||||
|
remoteControl enter
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<u>Menü Auswahl:</u>
|
||||||
|
<pre>
|
||||||
|
remoteControl setup
|
||||||
|
remoteControl return
|
||||||
|
remoteControl option
|
||||||
|
remoteControl display
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
Die Befehlsnamen entsprechen den Tasten auf der Fernbedienung.<br><br>
|
||||||
|
|
||||||
|
Ein typisches Beispiel ist das automatische Einschalten und Abspielen eines Internet Radio Sender:
|
||||||
|
<pre>
|
||||||
|
# Die Gerätedefinition
|
||||||
|
define AV_receiver YAMAHA_AVR 192.168.0.3
|
||||||
|
</pre>
|
||||||
|
Und in der 99_MyUtils.pm die folgende Funktion:
|
||||||
|
<pre>
|
||||||
|
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";
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
Die Kommandos der Fernbedienung müssen mit einem sleep pausiert werden, da der Receiver in der Zwischenzeit arbeitet und keine Befehle annimmt..<br><br>
|
||||||
|
|
||||||
|
Nun kann man diese Funktion in der FHEM Kommandozeile oder in notify-Definitionen wie folgt verwenden.:
|
||||||
|
<pre>
|
||||||
|
{startNetRadio()}
|
||||||
|
</pre>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<a name="YAMAHA_AVRget"></a>
|
<a name="YAMAHA_AVRget"></a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user