Sorry
$url = "http://10.0.0.23/gwr/gop.php?cmd=gwrbatch&data=<gwrcmds><gwrcmd><gcmd>RoomGetCarousel</gcmd><gdata><gip><version>1</version><token>1234567890</token><fields>name,control,power,product,class,realtype,status</fields></gip></gdata></gwrcmd></gwrcmds>";
$onled = '<img src="images\bulb-icon-on.png" />';
$offled = '<img src="images\bulb-icon-off.png" />';
$xmlstring = file_get_contents($url, false, $context);
$devices = array();
$xml = simplexml_load_string($xmlstring);
foreach($xml->gwrcmd->{'gdata'}->{'gip'}->{'room'}->{'device'} as $item){
$device = array();
foreach($item as $key => $value){
$device[(string)$key] = (string)$value;
}
$devices[] = $device;
}
echo '<pre>'; print_r($devices); echo '</pre>';
echo "<br/><br/><hr/><br/>";
foreach ($devices as $info => $status) {
foreach ($status as $statusnow){
echo $statusnow.'<br />';
}
}
Here is also the XML from the url
<gwrcmds>
<gwrcmd>
<gcmd>RoomGetCarousel</gcmd>
<gdata>
<gip>
<version>1</version>
<rc>200</rc>
<room>
<rid>1</rid>
<name>Master Bedroom</name>
<desc />
<known>1</known>
<type>0</type>
<color>00bd1f</color>
<colorid>1</colorid>
<img>img/room/green.png</img>
<power>0</power>
<poweravg>0</poweravg>
<energy>0</energy>
<device>
<did>216616014153767704</did>
<known>1</known>
<lock>0</lock>
<state>1</state>
<level>100</level>
<node>30</node>
<port>0</port>
<nodetype>16386</nodetype>
<name>Beth's</name>
<desc>LED</desc>
<colorid>1</colorid>
<type>multilevel</type>
<rangemin>0</rangemin>
<rangemax>99</rangemax>
<power>0.011</power>
<poweravg>0</poweravg>
<energy>0</energy>
<score>0</score>
<productid>1</productid>
<prodbrand>TCP</prodbrand>
<prodmodel>LED A19 11W</prodmodel>
<prodtype>LED</prodtype>
<prodtypeid>78</prodtypeid>
<classid>2</classid>
<class />
<subclassid>1</subclassid>
<subclass />
<other>
<rcgroup />
<manufacturer>TCP</manufacturer>
<capability>productinfo,identify,meter_power,switch_binary,switch_multilevel</capability>
<bulbpower>11</bulbpower>
</other>
</device>
<device>
<did>216616014154116936</did>
<known>1</known>
<lock>0</lock>
<state>0</state>
<level>100</level>
<node>30</node>
<port>0</port>
<nodetype>16386</nodetype>
<name>Clint</name>
<desc>LED</desc>
<colorid>1</colorid>
<type>multilevel</type>
<rangemin>0</rangemin>
<rangemax>99</rangemax>
<power>0</power>
<poweravg>0</poweravg>
<energy>0</energy>
<score>0</score>
<productid>1</productid>
<prodbrand>TCP</prodbrand>
<prodmodel>LED A19 11W</prodmodel>
<prodtype>LED</prodtype>
<prodtypeid>78</prodtypeid>
<classid>2</classid>
<class />
<subclassid>1</subclassid>
<subclass />
<other>
<rcgroup />
<manufacturer>TCP</manufacturer>
<capability>productinfo,identify,meter_power,switch_binary,switch_multilevel</capability>
<bulbpower>11</bulbpower>
</other>
</device>
</room>
</gip>
</gdata>
</gwrcmd>
</gwrcmds>