Hi, first post here so let me know if this is in the wrong place
I’m trying to set up a scraper to get solar data from the solar controllers web page but I keep getting this error in the log:
Error fetching data: http://192.168.68.120/cgi-bin/home/ failed with illegal header line: bytearray(b'debug9')
In my YAML config I have this:
sensor:
- platform: scrape
name: APSystems
resource: "http://192.168.68.120/cgi-bin/home/" # your ecu ip address
select: "tr:nth-child(2) > td:nth-child(2)"
value_template: '{{ ((value.split(" ")[0]) | replace ("KW", "")) }}'
unit_of_measurement: "kWh"
headers:
User-Agent: Mozilla/5.0
the pages source (sorry, I don’t know how to display it better):
<html><head><meta http-equiv=pragma content=no-cache><meta http-equiv=expire content=now><title></title><script type="text/javascript" src="http://gc.kis.v2.scr.kaspersky-labs.com/FD126C42-EBFA-4E12-B309-BB3FDD723AC1/main.js?attr=6vTldPB7mX88hZJxLeAMQcGRUOPM43nNwfnYm5N3ZKv8hr8BzpJgTQjKg36p7jFUX0gJClEopUR7Tn7pDDX9iA" charset="UTF-8"></script></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>203000016362</td></tr></center><center><tr><td align=center>Lifetime generation</td><td align=center>39567.56 kWh</td></tr></center><center><tr><td align=center>Last System Power</td><td align=center>879 W</td></tr></center><center><tr><td align=center>Generation Of Current Day</td><td align=center>13.81 kWh</td></tr></center><center><tr><td align=center>Last connection to website</td><td align=center>2021-04-11 16:23:09</td></tr></center><center><tr><td align=center>Number of Inverters</td><td align=center>10</td></tr></center><center><tr><td align=center>Last Number of Inverters Online</td><td align=center>10</td></tr></center><center><tr><td align=center>Current Software Version</td><td align=center>V3.11.4</td></tr></center><center><tr><td align=center>Database Size</td><td align=center>29298 kB</td></tr></center><center><tr><td align=center>Current Timezone</td><td align=center>Australia/Melbourne</td></tr></center><center><tr><td align=center>ECU Mac Address</td><td align=center>80:97:1B:00:40:3F</td></tr></center></table><br><br><hr></hr><center><tr><td>©2013 Altenergy Power System Inc.</td></tr></center></body></html>
I’ve googled the error but can’t find anything out about it. To my limited knowledge it looks like it is receiving something not expected, but I can’t figure out where I’m going wrong.
If anyone can help, it would be very much appriciated.
Thanks.