From 15e6199a6c98357f7c90183039932c6b023993f1 Mon Sep 17 00:00:00 2001 From: markusbloch <> Date: Sat, 18 Jan 2014 11:17:18 +0000 Subject: [PATCH] new module 71_YAMAHA_BD.pm for controlling Yamaha Blu-Ray players over network git-svn-id: https://svn.fhem.de/fhem/trunk@4682 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 + fhem/FHEM/71_YAMAHA_BD.pm | 988 ++++++++++++++++++++++++++++++++++++++ fhem/MAINTAINER.txt | 1 + 3 files changed, 991 insertions(+) create mode 100755 fhem/FHEM/71_YAMAHA_BD.pm diff --git a/fhem/CHANGED b/fhem/CHANGED index 2d35695eb..87b73bd74 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,6 +1,8 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. - SVN + - feature: new module 71_YAMAHA_BD.pm to control Yamaha Blu-Ray + players over network. - bugfix: DbLog: fix for plotfork - bugfix: SYSMON: filesystems may be wrong on some systems - feature: new module 98_pilight.pm added (andreas-fey) diff --git a/fhem/FHEM/71_YAMAHA_BD.pm b/fhem/FHEM/71_YAMAHA_BD.pm new file mode 100755 index 000000000..02d82562d --- /dev/null +++ b/fhem/FHEM/71_YAMAHA_BD.pm @@ -0,0 +1,988 @@ +# $Id$ +############################################################################## +# +# 71_YAMAHA_BD.pm +# An FHEM Perl module for controlling Yamaha Blu-Ray players +# via network connection. As the interface is standardized +# within all Yamaha Blue-Ray players, this module should work +# with any player which has an ethernet or wlan connection. +# +# Copyright by Markus Bloch +# e-mail: Notausstieg0309@googlemail.com +# +# This file is part of fhem. +# +# Fhem is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# Fhem is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with fhem. If not, see . +# +############################################################################## + +package main; + +use strict; +use warnings; +use Time::HiRes qw(gettimeofday sleep); +use HttpUtils; + +sub YAMAHA_BD_Get($@); +sub YAMAHA_BD_Define($$); +sub YAMAHA_BD_GetStatus($;$); +sub YAMAHA_BD_ResetTimer($;$); +sub YAMAHA_BD_Undefine($$); + + + + +################################### +sub +YAMAHA_BD_Initialize($) +{ + my ($hash) = @_; + + $hash->{GetFn} = "YAMAHA_BD_Get"; + $hash->{SetFn} = "YAMAHA_BD_Set"; + $hash->{DefFn} = "YAMAHA_BD_Define"; + $hash->{UndefFn} = "YAMAHA_BD_Undefine"; + + $hash->{AttrList} = "do_not_notify:0,1 request-timeout:1,2,3,4,5 model ". + $readingFnAttributes; +} + +################################### +sub +YAMAHA_BD_GetStatus($;$) +{ + my ($hash, $local) = @_; + my $name = $hash->{NAME}; + my $power; + + $local = 0 unless(defined($local)); + + return "" if(!defined($hash->{helper}{ADDRESS}) or !defined($hash->{helper}{ON_INTERVAL}) or !defined($hash->{helper}{OFF_INTERVAL})); + + my $device = $hash->{helper}{ADDRESS}; + + # get the model informations and available zones if no informations are available + if(defined($hash->{MODEL}) or not defined($hash->{FIRMWARE})) + { + YAMAHA_BD_getModel($hash); + } + + Log3 $name, 4, "YAMAHA_BD: Requesting system status"; + my $return = YAMAHA_BD_SendCommand($hash, "GetParam"); + + + + + + if(not defined($return) or $return eq "") + { + readingsSingleUpdate($hash, "state", "absent", 1); + YAMAHA_BD_ResetTimer($hash) unless($local == 1); + return; + } + + readingsBeginUpdate($hash); + if($return =~ /(.+?)<\/Error_Info>/) + { + readingsBulkUpdate($hash, "error", lc($1)); + + } + + Log3 $name, 4, "YAMAHA_BD: Requesting power state"; + $return = YAMAHA_BD_SendCommand($hash, "GetParam"); + + if($return =~ /(.+?)<\/Power>/) + { + $power = $1; + + if($power eq "Standby" or $power eq "Network Standby") + { + $power = "off"; + } + readingsBulkUpdate($hash, "power", lc($power)); + readingsBulkUpdate($hash, "state", lc($power)); + } + + + Log3 $name, 4, "YAMAHA_BD: Requesting playing info"; + $return = YAMAHA_BD_SendCommand($hash, "GetParam"); + + if(defined($return)) + { + if($return =~ /(.+?)<\/Status>/) + { + readingsBulkUpdate($hash, "playStatus", lc($1)); + } + + if($return =~ /(.+?)<\/Chapter>/) + { + readingsBulkUpdate($hash, "currentChapter", lc($1)); + } + + if($return =~ /(.+?)<\/File_Name>/) + { + readingsBulkUpdate($hash, "currentMedia", $1); + } + + if($return =~ /(.+?)<\/Disc_Type>/) + { + readingsBulkUpdate($hash, "discType", $1); + } + + if($return =~ /(.+?)<\/Status><\/Input_Info/) + { + readingsBulkUpdate($hash, "input", $1); + } + elsif($return =~ /(.+?)<\/Input_Info/) + { + readingsBulkUpdate($hash, "input", $1); + } + + if($return =~ /(.+?)<\/Tray>/) + { + readingsBulkUpdate($hash, "trayStatus", lc($1)); + } + + if($return =~ /(.+?)<\/Current_PlayTime>/) + { + readingsBulkUpdate($hash, "playTimeCurrent", YAMAHA_BD_formatTimestamp($1)); + } + + if($return =~ /(.+?)<\/Total_Time>/) + { + readingsBulkUpdate($hash, "playTimeTotal", YAMAHA_BD_formatTimestamp($1)); + } + + } + else + { + + Log3 $name, 3, "YAMAHA_BD: Received no response for playing info request"; + } + + + readingsEndUpdate($hash, 1); + + YAMAHA_BD_ResetTimer($hash) unless($local == 1); + + Log3 $name, 4, "YAMAHA_BD $name: ".$hash->{STATE}; + + return $hash->{STATE}; +} + +################################### +sub +YAMAHA_BD_Get($@) +{ + my ($hash, @a) = @_; + my $what; + my $return; + + return "argument is missing" if(int(@a) != 2); + + $what = $a[1]; + + if(exists($hash->{READINGS}{$what})) + { + YAMAHA_BD_GetStatus($hash, 1); + + if(defined($hash->{READINGS}{$what})) + { + return $hash->{READINGS}{$what}{VAL}; + } + else + { + return "no such reading: $what"; + } + } + else + { + $return = "unknown argument $what, choose one of"; + + foreach my $reading (keys %{$hash->{READINGS}}) + { + $return .= " $reading:noArg"; + } + + return $return; + } +} + + +################################### +sub +YAMAHA_BD_Set($@) +{ + my ($hash, @a) = @_; + my $name = $hash->{NAME}; + my $address = $hash->{helper}{ADDRESS}; + my $result = ""; + + + + return "No Argument given" if(!defined($a[1])); + + my $what = $a[1]; + my $usage = "Unknown argument $what, choose one of on:noArg off:noArg statusRequest:noArg tray:open,close remoteControl:up,down,left,right,return,enter,OSDonScreen,OSDstatus,topMenu,popupMenu,red,green,blue,yellow,0,1,2,3,4,5,6,7,8,9,setup,home,clear fast:forward,reverse slow:forward,reverse skip:forward,reverse play:noArg pause:noArg stop:noArg"; + + # Depending on the status response, use the short or long Volume command + + if($what eq "on") + { + + $result = YAMAHA_BD_SendCommand($hash, "On"); + + if(defined($result) and $result =~ /RC="0"/ and $result =~ /<\/Power>/) + { + # As the player startup takes about 5 seconds, the status will be already set, if the return code of the command is 0. + readingsBeginUpdate($hash); + readingsBulkUpdate($hash, "power", "on"); + readingsBulkUpdate($hash, "state","on"); + readingsEndUpdate($hash, 1); + return undef; + } + else + { + return "Could not set power to on"; + } + + } + elsif($what eq "off") + { + $result = YAMAHA_BD_SendCommand($hash, "Network Standby"); + + if(not defined($result) or not $result =~ /RC="0"/) + { + # if the returncode isn't 0, than the command was not successful + return "Could not set power to off"; + } + + } + elsif($what eq "remoteControl") + { + if($a[2] eq "up") + { + YAMAHA_BD_SendCommand($hash, "Up"); + } + elsif($a[2] eq "down") + { + YAMAHA_BD_SendCommand($hash, "Down"); + } + elsif($a[2] eq "left") + { + YAMAHA_BD_SendCommand($hash, "Left"); + } + elsif($a[2] eq "right") + { + YAMAHA_BD_SendCommand($hash, "Right"); + } + elsif($a[2] eq "enter") + { + YAMAHA_BD_SendCommand($hash, "Enter"); + } + elsif($a[2] eq "return") + { + YAMAHA_BD_SendCommand($hash, "Return"); + } + elsif($a[2] eq "OSDonScreen") + { + YAMAHA_BD_SendCommand($hash,"OnScreen"); + } + elsif($a[2] eq "OSDstatus") + { + YAMAHA_BD_SendCommand($hash,"Status"); + } + elsif($a[2] eq "topMenu") + { + YAMAHA_BD_SendCommand($hash,"TOP MENU"); + } + elsif($a[2] eq "popupMenu") + { + YAMAHA_BD_SendCommand($hash,"POPUP MENU"); + } + elsif($a[2] eq "red") + { + YAMAHA_BD_SendCommand($hash,"RED"); + } + elsif($a[2] eq "green") + { + YAMAHA_BD_SendCommand($hash,"GREEN"); + } + elsif($a[2] eq "blue") + { + YAMAHA_BD_SendCommand($hash,"BLUE"); + } + elsif($a[2] eq "yellow") + { + YAMAHA_BD_SendCommand($hash,"YELLOW"); + } + elsif($a[2] eq "0") + { + YAMAHA_BD_SendCommand($hash,"0"); + } + elsif($a[2] eq "1") + { + YAMAHA_BD_SendCommand($hash,"1"); + } + elsif($a[2] eq "2") + { + YAMAHA_BD_SendCommand($hash,"2"); + } + elsif($a[2] eq "3") + { + YAMAHA_BD_SendCommand($hash,"3"); + } + elsif($a[2] eq "4") + { + YAMAHA_BD_SendCommand($hash,"4"); + } + elsif($a[2] eq "5") + { + YAMAHA_BD_SendCommand($hash,"5"); + } + elsif($a[2] eq "6") + { + YAMAHA_BD_SendCommand($hash,"6"); + } + elsif($a[2] eq "7") + { + YAMAHA_BD_SendCommand($hash,"7"); + } + elsif($a[2] eq "8") + { + YAMAHA_BD_SendCommand($hash,"8"); + } + elsif($a[2] eq "9") + { + YAMAHA_BD_SendCommand($hash,"9"); + } + elsif($a[2] eq "setup") + { + YAMAHA_BD_SendCommand($hash,"SETUP"); + } + elsif($a[2] eq "home") + { + YAMAHA_BD_SendCommand($hash,"HOME"); + } + elsif($a[2] eq "clear") + { + YAMAHA_BD_SendCommand($hash,"CLEAR"); + } + elsif($a[2] eq "subtitle") + { + YAMAHA_BD_SendCommand($hash,"SUBTITLE"); + } + elsif($a[2] eq "angle") + { + YAMAHA_BD_SendCommand($hash,"ANGLE"); + } + elsif($a[2] eq "pictureInPicture") + { + YAMAHA_BD_SendCommand($hash,"PinP"); + } + elsif($a[2] eq "secondVideo") + { + YAMAHA_BD_SendCommand($hash,"2nd Video"); + } + elsif($a[2] eq "secondAudio") + { + YAMAHA_BD_SendCommand($hash,"2nd Audio"); + } + else + { + return $usage; + } + } + elsif($what eq "tray") + { + if($a[2] eq "open") + { + YAMAHA_BD_SendCommand($hash, "Open"); + } + elsif($a[2] eq "close") + { + YAMAHA_BD_SendCommand($hash, "Close"); + } + } + elsif($what eq "skip") + { + if($a[2] eq "forward") + { + YAMAHA_BD_SendCommand($hash, "Fwd"); + } + elsif($a[2] eq "reverse") + { + YAMAHA_BD_SendCommand($hash, "Rev"); + } + } + elsif($what eq "fast") + { + if($a[2] eq "forward") + { + YAMAHA_BD_SendCommand($hash, "Fwd"); + } + elsif($a[2] eq "reverse") + { + YAMAHA_BD_SendCommand($hash, "Rev"); + } + } + elsif($what eq "slow") + { + if($a[2] eq "forward") + { + YAMAHA_BD_SendCommand($hash, "Fwd"); + } + elsif($a[2] eq "reverse") + { + YAMAHA_BD_SendCommand($hash, "Rev"); + } + } + elsif($what eq "play") + { + YAMAHA_BD_SendCommand($hash, "Play"); + } + elsif($what eq "pause") + { + YAMAHA_BD_SendCommand($hash, "Pause"); + } + elsif($what eq "stop") + { + YAMAHA_BD_SendCommand($hash, "Stop"); + } + elsif($what eq "statusRequest") + { + # Will be executed anyway on the end of the function + } + else + { + return $usage; + } + + + # Call the GetStatus() Function to retrieve the new values after setting something (with local flag, so the internal timer is not getting interupted) + YAMAHA_BD_GetStatus($hash, 1); + + return undef; + +} + + +############################# +sub +YAMAHA_BD_Define($$) +{ + my ($hash, $def) = @_; + my @a = split("[ \t][ \t]*", $def); + my $name = $hash->{NAME}; + + if(! @a >= 3) + { + my $msg = "wrong syntax: define YAMAHA_BD [] []"; + Log 2, $msg; + return $msg; + } + + my $address = $a[2]; + + $hash->{helper}{ADDRESS} = $address; + + # if an update interval was given which is greater than zero, use it. + if(defined($a[3]) and $a[3] > 0) + { + $hash->{helper}{OFF_INTERVAL}=$a[3]; + } + else + { + $hash->{helper}{OFF_INTERVAL}=30; + } + + # if a second update interval is given, use this as ON_INTERVAL, otherwise use OFF_INTERVAL instead. + if(defined($a[4]) and $a[4] > 0) + { + $hash->{helper}{ON_INTERVAL}=$a[4]; + } + else + { + $hash->{helper}{ON_INTERVAL}=$hash->{helper}{OFF_INTERVAL}; + } + + unless(exists($hash->{helper}{AVAILABLE}) and ($hash->{helper}{AVAILABLE} == 0)) + { + $hash->{helper}{AVAILABLE} = 1; + readingsSingleUpdate($hash, "presence", "present", 1); + } + + # start the status update timer + YAMAHA_BD_ResetTimer($hash, 2); + + return undef; +} + +############################################################################################################# +# +# Begin of helper functions +# +############################################################################################################ + + + +############################# +sub +YAMAHA_BD_SendCommand($$;$) +{ + my ($hash, $command, $loglevel) = @_; + my $name = $hash->{NAME}; + my $address = $hash->{helper}{ADDRESS}; + my $response; + + Log3 $name, 5, "YAMAHA_BD: execute on $name: $command"; + + # In case any URL changes must be made, this part is separated in this function". + + $response = GetFileFromURL("http://".$address.":50100/YamahaRemoteControl/ctrl", AttrVal($name, "request-timeout", 4) , "".$command, 1, ($hash->{helper}{AVAILABLE} ? undef : 5)); + + Log3 $name, 5, "YAMAHA_BD: got response for $name: $response" if(defined($response)); + + unless(defined($response)) + { + + if((not exists($hash->{helper}{AVAILABLE})) or (exists($hash->{helper}{AVAILABLE}) and $hash->{helper}{AVAILABLE} eq 1)) + { + Log3 $name, 3, "YAMAHA_BD: could not execute command on device $name. Please turn on your device in case of deactivated network standby or check for correct hostaddress."; + readingsSingleUpdate($hash, "presence", "absent", 1); + } + } + else + { + if (defined($hash->{helper}{AVAILABLE}) and $hash->{helper}{AVAILABLE} eq 0) + { + Log3 $name, 3, "YAMAHA_BD: device $name reappeared"; + readingsSingleUpdate($hash, "presence", "present", 1); + } + } + + $hash->{helper}{AVAILABLE} = (defined($response) ? 1 : 0); + + return $response; + +} + + +############################# +# resets the StatusUpdate Timer according to the device state and respective interval +sub +YAMAHA_BD_ResetTimer($;$) +{ + my ($hash, $interval) = @_; + + RemoveInternalTimer($hash); + + if(defined($interval)) + { + InternalTimer(gettimeofday()+$interval, "YAMAHA_BD_GetStatus", $hash, 0); + } + elsif($hash->{READINGS}{presence}{VAL} eq "present" and $hash->{READINGS}{power}{VAL} eq "on") + { + InternalTimer(gettimeofday()+$hash->{helper}{ON_INTERVAL}, "YAMAHA_BD_GetStatus", $hash, 0); + } + else + { + InternalTimer(gettimeofday()+$hash->{helper}{OFF_INTERVAL}, "YAMAHA_BD_GetStatus", $hash, 0); + } + +} + + +############################# +sub +YAMAHA_BD_Undefine($$) +{ + my($hash, $name) = @_; + + # Stop the internal GetStatus-Loop and exit + RemoveInternalTimer($hash); + return undef; +} + + +############################# +# queries the player model, system-id, version +sub YAMAHA_BD_getModel($) +{ + my ($hash) = @_; + my $name = $hash->{NAME}; + my $address = $hash->{helper}{ADDRESS}; + my $response; + my $desc_url; + + $response = YAMAHA_BD_SendCommand($hash, "GetParam"); + + Log3 $name, 3, "YAMAHA_BD: could not get system configuration from device $name. Please turn on the device or check for correct hostaddress!" if (not defined($response) and defined($hash->{helper}{AVAILABLE}) and $hash->{helper}{AVAILABLE} eq 1); + + if(defined($response) and $response =~ /(.+?)<\/Model_Name>.*(.+?)<\/System_ID>.*(.+?)<\/Version>/) + { + $hash->{MODEL} = $1; + $hash->{SYSTEM_ID} = $2; + $hash->{FIRMWARE} = $3; + } + else + { + return undef; + } + + + $hash->{MODEL} =~ s/\s*YAMAHA\s*//g; + + $attr{$name}{"model"} = $hash->{MODEL}; + + +} + +############################# +# formats a 3 byte Hex Value into human readable time duration +sub YAMAHA_BD_formatTimestamp($) +{ + my ($hex) = @_; + + my ($hour) = sprintf("%02d", unpack("s", pack "s", hex(substr($hex, 0, 2)))); + my ($min) = sprintf("%02d", unpack("s", pack "s", hex(substr($hex, 2, 2)))); + my ($sec) = sprintf("%02d", unpack("s", pack "s", hex(substr($hex, 4, 2)))); + + return "$hour:$min:$sec"; + + +} + +1; + + +=pod +=begin html + + +

YAMAHA_BD

+
    + + + Define +
      + + define <name> YAMAHA_BD <ip-address> [<status_interval>] +

      + define <name> YAMAHA_BD <ip-address> [<off_status_interval>] [<on_status_interval>] +
      +

      + + This module controls Blu-Ray players from Yamaha via network connection. You are able + to switch your player on and off, query it's power state, + control the playback, open and close the tray and send all remote control commands.

      + Defining a YAMAHA_BD device will schedule an internal task (interval can be set + with optional parameter <status_interval> in seconds, if not set, the value is 30 + seconds), which periodically reads the status of the player (power state, current disc, tray status,...) + and triggers notify/filelog commands. +

      + Different status update intervals depending on the power state can be given also. + If two intervals are given to the define statement, the first interval statement represents the status update + interval in seconds in case the device is off, absent or any other non-normal state. The second + interval statement is used when the device is on. + + Example:

      +
        + define BD_Player YAMAHA_BD 192.168.0.10 +

        + # With custom status interval of 60 seconds
        + define BD_Player YAMAHA_BD 192.168.0.10 60 +

        + # With custom "off"-interval of 60 seconds and "on"-interval of 10 seconds
        + define BD_Player YAMAHA_BD 192.168.0.10 60 10 +
      + +
    +

    + + Set +
      + set <name> <command> [<parameter>] +

      + Currently, the following commands are defined. +

      +
        +
      • on   -   powers on the device
      • +
      • off   -   shuts down the device
      • +
      • tray open,close   -   open or close the disc tray
      • +
      • statusRequest   -   requests the current status of the device
      • +
      • remoteControl up,down,...   -   sends remote control commands as listed in the following chapter
      • +

      +Playback control commands +
        +
      • play   -   start playing the current media
      • +
      • pause   -   pause the current media playback
      • +
      • stop   -   stop the current media playback
      • +
      • skip forward,reverse   -   skip the current track or chapter
      • +
      • fast forward,reverse   -   fast forward or reverse playback
      • +
      • slow forward,reverse   -   slow forward or reverse playback
      • + + +
      +


    +Remote control

    +
      + The following commands are available:

      + + Number Buttons (0-9):

      +
        + remoteControl 0
        + remoteControl 1
        + remoteControl 2
        + ...
        + remoteControl 9
        +


      + + Cursor Selection:

      +
        + remoteControl up
        + remoteControl down
        + remoteControl left
        + remoteControl right
        + remoteControl enter
        + remoteControl return
        +


      + + Menu Selection:

      +
        + remoteControl OSDonScreen
        + remoteControl OSDstatus
        + remoteControl popupMenu
        + remoteControl topMenu
        + remoteControl setup
        + remoteControl home
        + remoteControl clear
        +


      + + Color Buttons:

      +
        + remoteControl red
        + remoteControl green
        + remoteControl yellow
        + remoteControl blue
        +


      + + The button names are the same as on your remote control.

      + +
    + + + Get +
      + get <name> <reading> +

      + Currently, the get command only returns the reading values. For a specific list of possible values, see section "Generated Readings/Events". +

      +
    + + Attributes + + Generated Readings/Events:
    +
      +
    • input - The current playback source (can be "DISC", "USB" or "Network")
    • +
    • discType - The current type of disc, which is inserted (e.g. "No Disc", "CD", "DVD", "BD",...)
    • +
    • error - indicates an hardware error of the player (can be "none", "fan error" or "usb overcurrent")
    • +
    • power - Reports the power status of the player or zone (can be "on" or "off")
    • +
    • presence - Reports the presence status of the player or zone (can be "absent" or "present"). In case of an absent device, it cannot be controlled via FHEM anymore.
    • +
    • trayStatus - The disc tray status (can be "open" or "close")
    • +
    • state - Reports the current power state and an absence of the device (can be "on", "off" or "absent")
    • +

      Input dependent Readings/Events:
      +
    • currentChapter - Number of the current DVD/BD Chapter (only at DVD/BD's)
    • +
    • currentMedia - Name of the current file (only at USB)
    • +
    • playTimeCurrent - current timecode of played media
    • +
    • playTimeTotal - the total time of the current movie (only at DVD/BD's)
    • +
    • playStatus - indicates if the player plays media or not (can be "play", "pause", "stop", "fast fwd", "fast rev", "slow fwd", "slow rev")
    • +
    +
    + Implementator's note
    +
      +
    • Some older models (e.g. BD-S671) cannot be controlled over networked by delivery. A firmware update is neccessary to control theese models via FHEM
    • +
    • The module is only usable if you activate "Network Control" on your player. Otherwise it is not possible to communicate with the player.
    • +
    +
    +
+ + +=end html +=begin html_DE + + +

YAMAHA_BD

+
    + + + Definition +
      + define <name> YAMAHA_BD <IP-Addresse> [<Status_Interval>] +

      + define <name> YAMAHA_BD <IP-Addresse> [<Off_Interval>] [<On_Interval>] +
      +

      + + Dieses Modul steuert Blu-Ray Player des Herstellers Yamaha über die Netzwerkschnittstelle. + Es bietet die Möglichkeit den Player an-/auszuschalten, die Schublade zu öffnen und schließen, + die Wiedergabe beeinflussen, sämtliche Fernbedieungs-Befehle zu senden, sowie den aktuellen Status abzufragen. +

      + Bei der Definition eines YAMAHA_BD-Moduls wird eine interne Routine in Gang gesetzt, welche regelmäßig + (einstellbar durch den optionalen Parameter <Status_Interval>; falls nicht gesetzt ist der Standardwert 30 Sekunden) + den Status des Players abfragt und entsprechende Notify-/FileLog-Definitionen triggert. +

      + Sofern 2 Interval-Argumente übergeben werden, wird der erste Parameter <Off_Interval> genutzt + sofern der Player ausgeschaltet oder nicht erreichbar ist. Der zweiter Parameter <On_Interval> + wird verwendet, sofern der Player eingeschaltet ist. +

      + Beispiel:

      +
        + define BD_Player YAMAHA_BD 192.168.0.10 +

        + # Mit modifiziertem Status Interval (60 Sekunden)
        + define BD_Player YAMAHA_BD 192.168.0.10 60 +

        + # Mit gesetztem "Off"-Interval (60 Sekunden) und "On"-Interval (10 Sekunden)
        + define BD_Player YAMAHA_BD 192.168.0.10 60 10 +


      +
    + + + Set-Kommandos +
      + set <Name> <Kommando> [<Parameter>] +

      + Aktuell werden folgende Kommandos unterstützt. +

      +
        +
      • on   -   schaltet den Player ein
      • +
      • off   -   schaltet den Player aus
      • +
      • tray open,close   -   öffnet oder schließt die Schublade
      • +
      • statusRequest   -   fragt den aktuellen Status ab
      • +
      • remoteControl up,down,...   -   sendet Fernbedienungsbefehle wie im folgenden Kapitel beschrieben.
      • +

      +Wiedergabespezifische Kommandos +
        +
      • play   -   startet die Wiedergabe des aktuellen Mediums
      • +
      • pause   -   pausiert die Wiedergabe
      • +
      • stop   -   stoppt die Wiedergabe
      • +
      • skip forward,reverse   -   überspringt das aktuelle Kapitel oder den aktuellen Titel
      • +
      • fast forward,reverse   -   schneller Vor- oder Rücklauf
      • +
      • slow forward,reverse   -   langsamer Vor- oder Rücklauf
      • + + +
      +

      +
    +Fernbedienung

    +
      + Es stehen folgende Befehle zur Verfügung:

      + + Zahlen Tasten (0-9):

      +
        + remoteControl 0
        + remoteControl 1
        + remoteControl 2
        + ...
        + remoteControl 9
        +


      + + Cursor Steuerung:

      +
        + remoteControl up
        + remoteControl down
        + remoteControl left
        + remoteControl right
        + remoteControl enter
        + remoteControl return
        +


      + + Menü Auswahl:

      +
        + remoteControl OSDonScreen
        + remoteControl OSDstatus
        + remoteControl popupMenu
        + remoteControl topMenu
        + remoteControl setup
        + remoteControl home
        + remoteControl clear
        +


      + + Farbtasten:

      +
        + remoteControl red
        + remoteControl green
        + remoteControl yellow
        + remoteControl blue
        +


      + Die Befehlsnamen entsprechen den Tasten auf der Fernbedienung.

      +
    + + + Get-Kommandos +
      + get <Name> <Readingname> +

      + Aktuell stehen via GET lediglich die Werte der Readings zur Verfügung. Eine genaue Auflistung aller möglichen Readings folgen unter "Generierte Readings/Events". +
    +

    + + Attribute + + Generierte Readings/Events:
    +
      +
    • input - Die aktuelle Wiedergabequelle ("DISC", "USB" oder "Network")
    • +
    • discType - Die Art der eingelegten Disc (z.B "No Disc" => keine Disc eingelegt, "CD", "DVD", "BD",...)
    • +
    • error - zeigt an, ob ein interner Fehler im Player vorliegt ("none" => kein Fehler, "fan error" => Lüfterdefekt, "usb overcurrent" => USB Spannungsschutz)
    • +
    • power - Der aktuelle Betriebsstatus ("on" => an, "off" => aus)
    • +
    • presence - Die aktuelle Empfangsbereitschaft ("present" => empfangsbereit, "absent" => nicht empfangsbereit, z.B. Stromausfall)
    • +
    • trayStatus - Der Status der Schublade("open" => geöffnet, "close" => geschlossen)
    • +
    • state - Der aktuelle Schaltzustand (power-Reading) oder die Abwesenheit des Gerätes (mögliche Werte: "on", "off" oder "absent")
    • +

      Quellenabhängige Readings/Events:
      +
    • currentChapter - Das aktuelle Kapitel eines DVD- oder Blu-Ray-Films
    • +
    • currentMedia - Der Name der aktuell wiedergebenden Datei (Nur bei der Wiedergabe über USB)
    • +
    • playTimeCurrent - Der aktuelle Timecode an dem sich die Wiedergabe momentan befindet.
    • +
    • playTimeTotal - Die komplette Spieldauer des aktuellen Films (Nur bei der Wiedergabe von DVD/BD's)
    • +
    • playStatus - Wiedergabestatus des aktuellen Mediums
    • +
    +
    + Hinweise des Autors +
      +
    • Einige ältere Player-Modelle (z.B. BD-S671) können im Auslieferungszustand nicht via Netzwerk gesteuert werden. Um eine Steuerung via FHEM zu ermöglichen ist ein Firmware-Update notwending!
    • +
    • Dieses Modul ist nur nutzbar, wenn die Option "Netzwerksteuerung" am Player aktiviert ist. Ansonsten ist die Steuerung nicht möglich.
    • +
    +
    +
+=end html_DE + +=cut + diff --git a/fhem/MAINTAINER.txt b/fhem/MAINTAINER.txt index 6eb635cfb..b61f389e1 100644 --- a/fhem/MAINTAINER.txt +++ b/fhem/MAINTAINER.txt @@ -143,6 +143,7 @@ FHEM/70_XBMC.pm dbokermann http://forum.fhem.de Multimedi FHEM/70_Pushover.pm Johannes_B http://forum.fhem.de Unterstützende Dienste FHEM/71_LISTENLIVE.pm betateilchen http://forum.fhem.de Multimedia FHEM/71_YAMAHA_AVR.pm markusbloch http://forum.fhem.de Multimedia +FHEM/71_YAMAHA_BD.pm markusbloch http://forum.fhem.de Multimedia FHEM/72_FB_CALLMONITOR.pm markusbloch http://forum.fhem.de Unterstuetzende Dienste FHEM/73_PRESENCE.pm markusbloch http://forum.fhem.de Unterstuetzende Dienste FHEM/75_MSG.pm ruebedo http://forum.fhem.de Automatisierung