Hello dear HA community members!
I am trying to scrape some values, from a Data Logger. I have been able to get current Power and Energy readings, but I also want to get individual Inverters readings, so if an inverter is off I get some sort of notification.
The html page, is the following:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--$Id: onlineOverWr.html 3607 2012-12-12 10:54:46Z mcwbl $-->
<html>
<head>
<meta http-equiv="expires" content="0" />
<meta http-equiv="content-type" content="text/html; charset=windows-1252" />
<title>Online values » Inverter Survey</title>
<link rel="stylesheet" type="text/css" href="../css/ist.css" />
<link rel="stylesheet" type="text/css" href="../css/nav.css" />
<script language="javascript" src="js/ist.js" type="text/javascript"></script>
<script language="javascript" src="js/nav.js" type="text/javascript"></script>
</head>
<body onload="start()">
<!-- $Id: Umenu.html 3064 2012-06-15 12:56:42Z mcwbl $ -->
<!--common-->
<div id="divSelectA" class="cSelect" style="left:10px;">
<a href="javascript:pruef('divMenuA');subpruef()" onmouseover="pruef('divMenuA');subpruef()"> General </a>
</div>
<div id="divMenuA" class="cMenu" style="left:10px;">
<a href="login.html" onmouseover="subpruef()" target="_top"> Login</a><br />
<a href="index.html" onmouseover="subpruef()" target="_top"> Start page</a><br />
</div>
<!--online values-->
<div id="divSelectB" class="cSelect" style="left:72px;">
<a href="javascript:zeig('divMenuB')" onmouseover="pruef('divMenuB');subpruef()"> Online values </a>
</div>
<div id="divMenuB" class="cMenu" style="left:72px; width:150px;">
<a href="onlineAd.html" target="_top" onmouseover="subpruef()"> Analog / Digital</a><br />
<a href="onlineOcs.html" onmouseover="subpruef()" target="_top"> Current Sensors</a><br />
<a href="onlineOverModbus.html" onmouseover="subpruef()" target="_top"> Modbus devices survey</a><br />
<a href="onlineunvmodbus.html" onmouseover="subpruef()" target="_top"> Modbus devices</a><br />
<a href="onlineArgus.html" onmouseover="subpruef()" target="_top"> Powador-Argus Boxes</a><br />
<a href="onlineOverWr.html" onmouseover="subpruef()" target="_top"> Inverter Survey</a><br />
<a href="onlineWr.html" onmouseover="subpruef()" target="_top"> Inverter Details</a><br />
<a href="onlinePwrCtrl.html" target="_top" onmouseover="subpruef()"> Power Control</a>
</div>
<!--state-->
<div id="divSelectC" class="cSelect" style="left:166px;">
<a href="javascript:zeig('divMenuC')" onmouseover="pruef('divMenuC');subpruef()"> Status </a>
</div>
<div id="divMenuC" class="cMenu" style="left:166px;">
<a href="viewAlarmStatus.html" onmouseover="subpruef()" target="_top"> Plant Messages</a><br />
<a href="viewStatusWrKaco.html" onmouseover="subpruef()" target="_top"> Inverters</a>
</div>
<!--configuration-->
<div id="divSelectD" class="cSelect" style="left:215px;">
<a href="javascript:zeig('divMenuD')" onmouseover="pruef('divMenuD');subpruef()"> Configuration </a>
</div>
<div id="divMenuD" class="cMenu" style="left:215px;">
<a href="confAnlage.html" onmouseover="subpruef()" target="_top"> Plant Data</a><br />
<a href="confStdKontakt.html" onmouseover="subpruef()" target="_top"> Default Contact</a><br />
<a href="confDate.html" onmouseover="subpruef()" target="_top"> Date / Time</a><br />
</div>
<!--headline - product name -->
<div class="cKopfzeile">
<div class="cProductname"> Powador-proLOG</div>
<div class="cProductimage"><img src="../IMAGES/logo.gif" alt="" /></div>
</div>
<!-- welcome message -->
<div id="welcome_text" style="visibility:hidden;">Welcome to « WEB'log » Monitoring System </div>
<script language="javascript" type="text/javascript">
//<![CDATA[
function setWelcomeText() {
var text = document.getElementById( "welcome_text" )
var entry = document.getElementById( "welcome");
entry.innerHTML = text.innerHTML;
}
//]]>
</script>
<!-- just a helper div to determine menu width during runtime -->
<div id="mcMenuHelp" style="left:5px; top:5px; visibility:hidden; position:absolute; border-width:0px; padding:0px; z-index:100"></div>
<!-- handler for dynamic menu width-->
<script language="JavaScript" src="js/menu.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
setupMenuWidth();
window.onresize = setupMenuWidth;
</script>
<div id="divInfo" class="cInfo">
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
<tr>
<td align="center">
<table class="tablebody" border="0" width="100%">
<tr>
<td class="cNavInfo">Online values » Inverter Survey</td>
</tr>
</table>
</td>
</tr>
<tr><td> </td></tr>
<tr>
<td class="tablebody">
<table width="100%" border="0">
<tr class="tablehead">
<td colspan="7"><strong>Sum of all Inverters</strong></td>
</tr>
<tr>
<td class="tablehead">Designation</td>
<td class="tablehead">Value</td>
<td class="tablehead">Unit</td>
<td> </td>
<td class="tablehead">Designation</td>
<td class="tablehead">Value</td>
<td class="tablehead">Unit</td>
</tr>
<tr>
<td>Current Power</td>
<td><b>226.841</b></td>
<td>kW</td>
<td> </td>
<td>Current monthly energy yield</td>
<td>25422.170</td>
<td>kWh</td>
</tr>
<tr>
<td>Current daily energy yield</td>
<td><b>202.987</b></td>
<td>kWh</td>
<td> </td>
<td>Current annual energy yield</td>
<td>1066648.960</td>
<td>kWh</td>
</tr>
<tr>
<td>Previous day energy yield</td>
<td>1698.805</td>
<td>kWh</td>
<td> </td>
<td>Total energy yield</td>
<td>10251322.985</td>
<td>kWh</td>
</tr>
</table>
</td>
</tr>
<tr><td> </td></tr>
<tr>
<td>
<table width="100%" border="0" class="tablebody">
<tr class="tablehead">
<td colspan="5"><strong>Survey of Individual Inverters</strong></td>
</tr>
<tr class="tablehead">
<td width="10%">Address</td>
<td width="10%">Power</td>
<td width="15%">Unit</td>
<td width="10%">Daily energy</td>
<td width="55%">Unit</td>
</tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?0">2</A></td><td>10405</td><td>W</td><td>10581</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?1">3</A></td><td>7191</td><td>W</td><td>7217</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?2">4</A></td><td>10739</td><td>W</td><td>9586</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?3">5</A></td><td>13430</td><td>W</td><td>11091</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?4">6</A></td><td>11879</td><td>W</td><td>10548</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?5">7</A></td><td>8444</td><td>W</td><td>7717</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?6">8</A></td><td>6846</td><td>W</td><td>6684</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?7">9</A></td><td>10200</td><td>W</td><td>10350</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?8">10</A></td><td>11599</td><td>W</td><td>12007</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?9">11</A></td><td>11372</td><td>W</td><td>12204</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?10">12</A></td><td>12678</td><td>W</td><td>12946</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?11">13</A></td><td>10246</td><td>W</td><td>9894</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?12">14</A></td><td>11696</td><td>W</td><td>10440</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?13">15</A></td><td>14345</td><td>W</td><td>11001</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?14">16</A></td><td>15819</td><td>W</td><td>12674</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?15">17</A></td><td>14607</td><td>W</td><td>11744</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?16">18</A></td><td>15445</td><td>W</td><td>12762</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?17">19</A></td><td>13037</td><td>W</td><td>11284</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?18">20</A></td><td>13047</td><td>W</td><td>10524</td><td>Wh</td></tr>
<tr><td CLASS="cLink"><A HREF="/httpGpmGotoWrID.cgi?19">21</A></td><td>2278</td><td>W</td><td>1733</td><td>Wh</td></tr>
</table>
</td>
</tr>
<tr><td> </td></tr>
<tr><td align="center"> </td></tr>
<tr><td> </td></tr>
<tr><td align="center"> </td></tr>
<tr><td height="100%"> </td></tr>
<tr>
<td align="center">
<table width="100%" border="0" class="tablebody">
<tr>
<td>Note: The highlighted values will be updated every 20 sec.</td>
</tr>
</table>
</td>
</tr>
<tr><td> </td></tr>
<tr><td> </td></tr>
</table>
<div class="x-align-right">
<div class="cStatuszeile"> System Time 10:03:48 / 18.12.2020 </div>
</div>
</div>
</body>
</html>
I am able to get the let’s say, 8th inverter, with the selection:
select:"tr tr:nth-child(10) td:nth-child(2)"
but for inverters, 1 or 2, I get wrong values.
Is there any solution that I don’t understand?
Is there any better idea? (node red, maybe???)
(I have been able to scrape this data, with an script in Python…maybe someone can suggest how to import the variables of this script, in HA? Maybe write them to a file and make HA read the file?)
Regards!