update on statuscheck and sending Commands to the Visonic powerlink2
If you run this check:
http://x.x.x.200/web/ajax/alarm.chkstatus.ajax.phpIt will return a full XML with complete status and settings.
If you have a large Visonics setting with lots of sensors the XML can be extensive and most of the time the XML is the same as the previous.
Thats why there is a index tag in the XML where you can check on. In the below XML the <INDEX> = 84
- Code: Select all
<?xml version="1.0" standalone="yes"?>
<reply>
<index>84</index>
<cameras>
<name>CAMERAS</name>
<picture_name>cam</picture_name>
<picture_path>/tmp/cams/</picture_path>
</cameras>
<configuration>
<sensors>
<name>Sensor</name>
<index>1</index>
<type>Delay 1</type>
<location>Front Door</location>
</sensors>
<sensors>
<name>Sensor</name>
<index>2</index>
<type>Perimeter-Follow</type>
<location>Hall</location>
</sensors>
<system>
<name>Control Panel</name>
<disarm/>
<status>Ready</status>
<arm>0</arm>
<latchkey_enable>Latchkey Enable</latchkey_enable>
<ip_mode>dynamic</ip_mode>
<ip>10.0.0.200</ip>
<subnet>255.255.255.0</subnet>
<gateway>10.0.0.2</gateway>
<dns1>192.168.0.1</dns1>
</system>
</configuration>
<alerts>
</alerts>
<alarms>
</alarms>
<qvFullPath>/cams/sess_02e5d32285d5dea65a1960d18c82fd49/cam</qvFullPath><detectors>
<detector>
<zone>1</zone>
<loc>Front Door</loc>
<type>Delay 1</type>
<status></status>
<isalarm>no</isalarm>
</detector>
<detector>
<zone>2</zone>
<loc>Hall</loc>
<type>Perimeter-Follow</type>
<status></status>
<isalarm>no</isalarm>
</detector>
</detectors>
</reply>
All you need to do is sent the latest INDEX number with your request and you receive this when there are no changes
- Code: Select all
http://x.x.x.200/web/ajax/alarm.chkstatus.ajax.php?curindex=84
Answer:<?xml version="1.0" standalone="yes"?><reply><customStatus>
[NOCNG]</customStatus></reply>
If there are changes you only recieve the Arms Status and the sensors settings, so not the complete XML. You only receive the complete XML if you dont use the curindex=xx option
Sample code for the request:- Code: Select all
objXML.Open "POST", "http://x.x.x..200/web/ajax/alarm.chkstatus.ajax.php", True
objXML.setRequestHeader "cache -Control", "no -cache"
objXML.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
sdataTosend = "curindex=84"
objXML.send sdataTosend
And with this command you can easily Arm, Armhome and Disarm the visonic panel
- Code: Select all
*Login
sdataTosend = "user=admin&pass=admin"
objXML.Open "POST", "http://x.x.x.200/web/ajax/login.login.ajax.php", True
*Send Commands
objXML.Open "POST", "http://x.x.x.200/web/ajax/security.main.status.ajax.php", True
objXML.setRequestHeader "cache -Control", "no -cache"
objXML.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
sdataTosend = "set=Disarm" (options here are :Disarm, ArmHome, ArmAway)
objXML.send sdataTosend
For Homeseer users, this can be done easy with a script!
See also
http://www.bwired.nl/weblog.asp?id=418See Roberts vlog for the Mobile Javascript variant
blog.hekkers.net/2011/03/04/more-powerl ... nk2-stuff/