Getdata from web-interface login? (POST authorisation)

Hello Guys…
I have a Danfoss Solar Inverter with integrated Web-interface, to see production performance… It can also be read out from RS485.
Is it possible to read out the data from the web-interface when it requires a log-in? The url for log-in is:

but when i login i get redirected to this:

where the sid changes from each login… Is there any way to deal with this?

Maybe this will help: Examples of http binding using session ID:

Indeed, my HVAC webserver does the same, you authenticate and afterwards it uses the session iD.

This is where I ended up in my rules and it works like a charm.

You would need to tweak it a bit for your purpose but the principle of capturing the session ID and using it to build your URL’s works.

rule "temperatuur"

	Time cron "0 0/5 * * * ?"
	var String jsonauth= sendHttpGetRequest("http://x.x.x.x/api/auth/login.json?user=USER&pwd=PASSWORD")
	var String sessionid = transform("JSONPATH","$.SessionId", jsonauth)
	postUpdate("Session", sessionid)
	var String jsonLiving = sendHttpGetRequest("" + sessionid + "&Id=1154")
	var String strtempLiving = transform("JSONPATH","$.Data.Value", jsonLiving)
	var String tempLiving = transform("REGEX", "\s*(.*)", strtempLiving)
	postUpdate("TempLivingCurrent", tempLiving)	


Looks awesome, exactly what I need…
is it only the http binding that’s needed for this?

Not even, the code above is not relying on http binding, this is standard openhab functionality (at least in 2.0 which is what I’m using, assume it would be the same for the 1.8)

Trying to check what type of auth the web-interfaces uses… seems like it’s POST authorisation…
Just wondering how the format should be for the login URL - since it doesn’t work like @rswennen does it… I try test it in the Chrome browser with the actual url - shouldn’t that work?

The log in screen source code:

<body >
<script type="text/javascript">  
     if(top.window.location.href.indexOf("login_page") == -1)

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
	<link rel="stylesheet" href="/login.css" type="text/css">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<script type="text/javascript" src="/footer.js"></script>
	<script language=javascript type="text/javascript">
	if (parent.frames.length) 
	  top.location.href= document.location;	
	// -->
		<title>Login :: 30</title>

<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
        <td width="100%" height="100%" valign="middle" align="center">

<table border="0" cellpadding="0" cellspacing="0" width="1000">
		<td height="138" id="headerLogin"> 
			<div class="plantName">30</div>
		<td id="loginForm" align="right" valign="middle">
			<form action="/cgi-bin/handle_login.tcl" name="loginform" method="POST">
			<table width="700" border="0" cellpadding="0" cellspacing="0">
					<td colspan="2" align="right"  width="100%"><div class="heading">Welcome to 
					TLX Pro+</div></td>
  					<td align="right" width="100%"><label for="user">User:</label>&nbsp;</td>
			        	<td align="right" width="1"><input type="text" id="user" name="user" size="40" maxlength="24"></td>
					<td height="26" colspan="2"  width="100%">&nbsp;</td>
		  			<td align="right" width="100%"><label for="pw">Password:</label>&nbsp;</td>
			        	<td align="right" width="1"><input type="password" id="pw" name="pw" size="40" maxlength="24"></td>
					<td height="26" colspan="2" align="right"  width="100%">&nbsp;
  					<td colspan="2" align="right"  width="100%"><input type="submit" class="button" style="text-align: center;" name="submit" id="login" value="Login"></td>
					<td align="right" valign="bottom" colspan="2" class="disclaimer"><br><br><br>All shown values are based upon actual inverter data and are not legally binding.</td>
            <input type="hidden" name="sid" value="">
		<td height="46" id="loginFooter" valign="middle">
			<table id="footer" width="100%">
				<td class="vasak" width="720">
						<li><a href="#" target="dispContent" onclick="openLang(''); return false;">Language</a></li>
				    	<li><a href="#" target="dispContent" onclick="openContact(''); return false;">Contact</a></li>
				<td class="parem" width="350"><a href="" target="_blank">Danfoss Solar Inverters</a></td>
<div id="customerWrapper">
<div id="customerData1"></div>
<div id="customerData2"><img src='/images/login_image_1.jpg'></div>

I’m not an expert but I think you should try along these lines


with XXX your username and YYY your password. You are absolutely right you should be able to do test this in a browser, once you have the exact URL pointing to the login cgi bin script handle_login.tcl you can then try to do it in openhab

This doesn’t work… seems like I need some kind of script to do the login, you haven’t put anything else in a file or something - only the scrip you write here?