This is driving me nuts.
I am trying to scrape a value from the web interface of a Greenstar ECU connected to my rooftop solar panels. The value represents the current power being generated.
Here is my config:
sensor:
- platform: scrape
resource: http://10.1.1.138/cgi-bin/home
name: solar_current
select: 'tr:nth-of-type(3) td:nth-of-type(2)'
value_template: '{{ value.split()[0] }}'
And here is the HTML up to the value I’m trying to scrape (1605).
<html>
<head>
<meta http-equiv=pragma content=no-cache>
<meta http-equiv=expire content=now>
<title/>
</head>
<body bgcolor=ffffff text=black>
<form action=config.cgi method=get>
<br>
<br>
<table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#008000 bordercolorlight=#ffffff borderdark=#808000 width=500>
<center>
<tr>
<td align=center>ECU ID</td>
<td align=center>203000012181</td>
</tr>
</center>
<center>
<tr>
<td align=center>Lifetime generation</td>
<td align=center>19076.84 kWh</td>
</tr>
</center>
<center>
<tr>
<td align=center>Current Power</td>
<td align=center>1605 W</td>
</tr>
</center>
I just keep getting an unknown value and an ‘Unable to extract data from HTML’ error in the log.
Can’t see what’s wrong and feel this should be so easy. If anyone has any ideas I’d be grateful for your input.