Same thing with a Denon, especially now that I also cut his power.
But solved it:
Code: Select all
function denon(){
if($this->a=="On"){
if($this->s['denonpower']=='Off') {$this->sw($this->i['denonpower'],'On','denonpower');sleep(8);}
for($x=0;$x<=10;$x++){
sleep(1);
$denon=json_decode(json_encode(simplexml_load_string(file_get_contents($this->denon.'/goform/formMainZone_MainZoneXml.xml?_='.time(),false, $this->ctx))), TRUE);
if($denon['ZonePower']['value']!='ON') {
file_get_contents($this->denon.'/MainZone/index.put.asp?cmd0=PutZone_OnOff%2FON&cmd1=aspMainZone_WebUpdateStatus%2F',false,$this->ctx);
sleep(1);
file_get_contents($this->denon.'/MainZone/index.put.asp?cmd0=PutZone_OnOff%2FON&cmd1=aspMainZone_WebUpdateStatus%2F&ZoneName=ZONE2',false,$this->ctx);
sleep(1);
file_get_contents($this->denon.'/MainZone/index.put.asp?cmd0=PutZone_InputFunction/TUNER',false,$this->ctx);
} else break;
}
}else{
file_get_contents($this->denon.'/MainZone/index.put.asp?cmd0=PutZone_OnOff%2FOFF&cmd1=aspMainZone_WebUpdateStatus%2F&ZoneName=ZONE2',false,$this->ctx);
sleep(1);
file_get_contents($this->denon.'/MainZone/index.put.asp?cmd0=PutZone_OnOff%2FOFF&cmd1=aspMainZone_WebUpdateStatus%2F',false,$this->ctx);
sleep(5);
$this->sw($this->i['denonpower'],'Off','denonpower');
}
}
So if I want to switch the Denon on, it first checks if the powerswitch is on, if not switch it on and wait 8 seconds.
Then try in a loop to get the current status, as soon as it responds break the loop.
Then continue and power up zone1, power up zone2 and select tuner as input.
I also have other devices that select other inputs or first ask the current volume to add or deduct 3 steps to it.