Originally posted by bandook
View Post

if response.read() == 'True':
response = urllib2.urlopen(getstatus) if response.read() == 'True': urllib2.urlopen(turnoffdevice) else: urllib2.urlopen(turnondevice)
$url = 'http://192.168.0.99:81/HomeSeer_REST_API.aspx?function=getdeviceinfo¶m1=Homeseer Systeem Receiver1';
$xml = simplexml_load_file($url);
echo $xml->deviceInfo[0]['name'];
SimpleXMLElement Object ( [device] => SimpleXMLElement Object ( [@attributes] => Array ( [name] => Receiver1 [id] => 7874 [type] => Receiver [value] => 3 [address] => X_REC[1]Q [code] => [canDim] => False [lastChange] => 30-11-2013 22:31:43 [firstLocation] => Homeseer [secondLocation] => Systeem ) ) )
<deviceInfo> <device name="Receiver1" id="7874" type="Receiver" value="3" address="X_REC[1]Q" co-de="" canDim="False" lastChange="30-11-2013 22:31:43" firstLocation="Homeseer" secondLocation="Systeem" /> </deviceInfo>
$xml = simplexml_load_file($url);
echo $xml->device[0][name];
Comment