OK, dann zeige ich euch hier mal die Scripte.
Objektbaum
MD Function:
<?
// SchaltFunktionen
//Medion Ein-/Ausschalten
function setPower($IP, $PIN, $SID, $value)
{
$url = "http://$IP/fsapi/SET/netRemote.sys.Power?pin=$PIN&sid=$SID&value=$value";
$result = Sys_GetURLContent($url);
}
//Medion Lautstärke ändern
function setVolume($IP, $PIN, $SID, $value)
{
$url = "http://$IP/fsapi/SET/netRemote.sys.audio.volume?pin=$PIN&sid=$SID&value=$value";
$result = Sys_GetURLContent($url);
}
//Medion Mute
function setMute($IP, $PIN, $SID, $value)
{
$url = "http://$IP/fsapi/SET/netRemote.sys.audio.mute?pin=$PIN&sid=$SID&value=$value";
$result = Sys_GetURLContent($url);
}
//Medion presets ändern
function setPreControl($IP, $PIN, $SID, $value)
{
switch ($value) {
case 0:
$url1 = "http://$IP/fsapi/SET/netRemote.play.shuffle?pin=$PIN&sid=$SID&value=0";
$url2 = "http://$IP/fsapi/SET/netRemote.play.repeat?pin=$PIN&sid=$SID&value=0";
break;
case 1:
$url1 = "http://$IP/fsapi/SET/netRemote.play.shuffle?pin=$PIN&sid=$SID&value=0";
$url2 = "http://$IP/fsapi/SET/netRemote.play.repeat?pin=$PIN&sid=$SID&value=1";
break;
case 2:
$url1 = "http://$IP/fsapi/SET/netRemote.play.shuffle?pin=$PIN&sid=$SID&value=1";
$url2 = "http://$IP/fsapi/SET/netRemote.play.repeat?pin=$PIN&sid=$SID&value=0";
break;
}
$result1 = Sys_GetURLContent($url1);
$result2 = Sys_GetURLContent($url2);
}
//Medion source ändern
function setSource($IP, $PIN, $SID, $value)
{
$url = "http://$IP/fsapi/SET/netRemote.sys.mode?pin=$PIN&sid=$SID&value=$value";
$result = Sys_GetURLContent($url);
}
//Medion Control (0=Stop, 1=Play, 2=Paue, 3=Next, 4=Privious)
function setControl($IP, $PIN, $SID, $value)
{
$url = "http://$IP/fsapi/SET/netRemote.play.control?pin=$PIN&sid=$SID&value=$value";
$result = Sys_GetURLContent($url);
}
//Informationen und Statusabfragen
//Medion Power Status
function getPower($IP, $PIN, $SID)
{
$url = "http://$IP/fsapi/GET/netRemote.sys.Power?pin=$PIN&sid=$SID";
$result = Sys_GetURLContent($url);
return $result;
}
//Medion Lautstärke Status
function getVolume($IP, $PIN, $SID)
{
$url = "http://$IP/fsapi/GET/netRemote.sys.audio.volume?pin=$PIN&sid=$SID";
$result = Sys_GetURLContent($url);
}
//Medion Mute Status
function getMute($IP, $PIN, $SID)
{
$url = "http://$IP/fsapi/GET/netRemote.sys.audio.mute?pin=$PIN&sid=$SID";
$result = Sys_GetURLContent($url);
}
//Medion Titel Status
function getTitel($IP, $PIN, $SID)
{
$url = "http://$IP/fsapi/GET/netRemote.play.info.name?pin=$PIN&sid=$SID";
$result = Sys_GetURLContent($url);
$result = substr($result, 56, -37);
return $result;
}
//Medion Album Status
function getAlbum($IP, $PIN, $SID)
{
$url = "http://$IP/fsapi/GET/netRemote.play.info.album?pin=$PIN&sid=$SID";
$result = Sys_GetURLContent($url);
$result = substr($result, 56, -37);
return $result;
}
//Medion Artist Status
function getArtist($IP, $PIN, $SID)
{
$url = "http://$IP/fsapi/GET/netRemote.play.info.artist?pin=$PIN&sid=$SID";
$result = Sys_GetURLContent($url);
$result = substr($result, 56, -37);
return $result;
}
//Medion Titellänge [ms]
function getDuration($IP, $PIN, $SID)
{
$url = "http://$IP/fsapi/GET/netRemote.play.info.duration?pin=$PIN&sid=$SID";
$result = Sys_GetURLContent($url);
}
//Medion aktuelle playtime [ms]
function getPosition($IP, $PIN, $SID)
{
$url = "http://$IP/fsapi/GET/netRemote.play.position?pin=$PIN&sid=$SID";
$result = Sys_GetURLContent($url);
}
?>
MD_command
<?
include ('MD_functions.ips.php');
$IP = GetValue(@IPS_GetVariableIDByName("strIP", $IPS_SELF)); // IP vom Medion Gerät
$PIN = GetValue(@IPS_GetVariableIDByName("strPIN", $IPS_SELF)); // PIN vom Medion Gerät
$SID = GetValue(@IPS_GetVariableIDByName("strSID", $IPS_SELF)); // SID vom Medion Gerät
$AlbumID = @IPS_GetVariableIDByName("strAlbum", $IPS_SELF); // Aktuelles Album
$TitelID = @IPS_GetVariableIDByName("strTitel", $IPS_SELF); // Aktueller Titel
$ArtistID = @IPS_GetVariableIDByName("strArtist", $IPS_SELF); // Aktueller Künstler
$DurationID = @IPS_GetVariableIDByName("iDuration", $IPS_SELF); // Aktueller Künstler
$PositionID = @IPS_GetVariableIDByName("iPosition", $IPS_SELF); // Aktueller Künstler
$PowerEventID = @IPS_GetVariableIDByName("bPower",$IPS_SELF);
$PreControlEventID = @IPS_GetVariableIDByName("iPreControl",$IPS_SELF);
$SourceEventID = @IPS_GetVariableIDByName("iSource",$IPS_SELF);
$VolumeEventID = @IPS_GetVariableIDByName("iVolume",$IPS_SELF);
$MuteEventID = @IPS_GetVariableIDByName("bMute",$IPS_SELF);
$ControlEventID = @IPS_GetVariableIDByName("iControl",$IPS_SELF);
// Medion Ein-/Ausschalten (1=EIN, 0=AUS)
if ($_IPS['VARIABLE'] == $PowerEventID)
{
setPower($IP, $PIN, $SID, $_IPS['VALUE']);
}
// Medion PreControl anpassen (0=Normal, 1=Repeat all, 2=Shuffle)
if ($_IPS['VARIABLE'] == $PreControlEventID)
{
setPreControl($IP, $PIN, $SID, $_IPS['VALUE']);
}
// Medion Quelle auswählen (0=Internetradio, 1=Musikplayer, 2=DAB, 3=FM-Radio, 4=AUX)
if ($_IPS['VARIABLE'] == $SourceEventID)
{
setSource($IP, $PIN, $SID, $_IPS['VALUE']);
}
// Medion Lautstärke ändern (0 - 20)
if ($_IPS['VARIABLE'] == $VolumeEventID)
{
setVolume($IP, $PIN, $SID, $_IPS['VALUE']);
}
// Medion Mute (1=Mute, 0=unmute)
if ($_IPS['VARIABLE'] == $MuteEventID)
{
setMute($IP, $PIN, $SID, $_IPS['VALUE']);
}
// Medion Control (0=Stop, 1=Play, 2=Paue, 3=Next, 4=Previous)
if ($_IPS['VARIABLE'] == $ControlEventID)
{
setControl($IP, $PIN, $SID, $_IPS['VALUE']);
}
// Informationenund Status Abfragen
// Titelinformationen
if ($_IPS['VARIABLE'] == $ControlEventID)
{
$value = getAlbum($IP, $PIN, $SID);
setvalue($AlbumID, $value);
$value = getTitel($IP, $PIN, $SID);
setvalue($TitelID, $value);
$value = getArtist($IP, $PIN, $SID);
setvalue($ArtistID, $value);
}
?>
Soweit ich das getestet habe funktioniert auch alles