Hi guys, if this will be useful to anyone, I got this working using PHP and cURL.
I am very happy now

Here is an example code for anyone interested:
Code: Select all
$username = 'xxx';
$password = 'xxx';
$url = 'http://find.z-wave.me/zboxweb';
$cookie="cookie.txt"; //Make sure you create this file and set the write permissions so it can be written/read Also I assume that you create it in the same dir, where is the PHP file.
$url1 = "http://find.z-wave.me/ZWaveAPI/Run/devices[3].instances[0].SensorMultilevel.data"; //just example for better vision
//login form action url
$postinfo = "act=login&login=$username&pass=$password";
$cookie_file_path = "cookie.txt";
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_NOBODY, false);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
//set the cookie the site has for certain features, this is optional
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
curl_setopt($ch, CURLOPT_USERAGENT,
"Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, $_SERVER['REQUEST_URI']);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postinfo);
$result = curl_exec($ch);
//var_dump($result);
//page with the content I want to grab
curl_setopt($ch, CURLOPT_URL, $url1);
//do stuff with the info with DomDocument() etc
$html = curl_exec($ch);
var_dump($html);
curl_close($ch);
Works like a charm and with this you can make all the requests using Z-way API, and through the z-wave.me services.
Pretty cool!
