I am trying to get the 4 different values shown on this site:
I know there is an integration for Fronius and I already have that integration in my HA, but for me it is not really working as I have two inverters (different model) and I am unable to calculate proper data with that integration.
So that is why I would like to get that data from that website using scrape.
First of all I am not even sure if this is possible to do using scrape and the content of that site seems to be a bit complex.
Maybe someone could have a look at this and let me know how to start with.
but there appears to be some sort of authentication going on as I canāt access that URL directly ā it takes me to a login page.
Suggest you investigate setting up a REST sensor (with the [UNIX_TIMESTAMP] replaced with {{ now()|as_timestamp|int(0) }} in the resource_template definition):
@farmio this integration looks great, but the thing is that I donāt have an API key, fronius doesnāt provide that anymore to private customers, so I have no clue where I could get a proper API from:
and I think this is ok but I have no clue how to create tepmlates to get the values for āP_Gridā āP_Loadā āP_Akkuā āP_PVā and āP_SOCā
Maybe you could help with that as well.
Screenshot of the output I get please seee below:
Thanks Troon, I have tried that but I am not able to see a Sensor called SOC after reboot.
I guess I am not smart enough to do this.
I would like to get a Sensor for each item:
P_Grid
P_Load
P_Akku
P_PV
I am completely confused, sorry for that.
This is what I see when I check the states:
#Solarweb Rest
- platform: rest
resource_template: https://www.solarweb.com/ActualData/GetCompareDataForPvSystem?pvSystemId=b16d8d79-566d-449d-b809-a5ee0164faf9&_={{ now()|as_timestamp|int(0) }}
name: "Grid Power"
value_template: "{{ value_json['P_Grid'] }}"
unit_of_measurement: "W"
The sensor "Grid Power" is created but the value is "unknown"

Try this: at least then youāll know whether the data is coming in correctly. Make sure you put the YAML under the correct headings: there must only be one sensor: and one template: at the top level:
Once thatās working, sensor.solarweb_response should have the full JSON (provided itās still under 255 characters), and sensor.grid_power should have the grid number in it.
If not, post a screenshot of the states page for each.
So I made sure that there is only one Sensor: and one Template: as a header, however I have of course more other sensors and templates in this section, but I am sure that is ok.
The outcome is still āunavailableā on the āGrid Powerā sensor, the state attributes are shown so the sensor was created, but the state is āunavailableā
At a guess, thereās some sort of authentication between your browser and the server: likely a cookie. The request from HA doesnāt have that. Thatās going to be very hard for me to diagnose āremotelyā Iām afraid.
All I can suggest is to have a look in the HA logs; and to use your browserās Inspect tools to look at the request headers and response.
Understand this is very difficult for you. I could offer you a guest account with login to Solarweb if you let me know your email address then I could send you an invitation. Appreciate your effort
Youāve replied to me: I donāt have the Solarweb system so canāt help, sorry. If the web interface shows the number you want, you should be able to get it into HA but youāll need to work out which resource is providing it. See my first response to this topic.
Ya, I couldnāt get this to work reliably yet. Seems like in North America, we canāt get API access and the guest permissions do not work with this link (if youāre logged in, you can). So, I could have home assistant log in, then the scrape works but it basically times out.
Essentially using browserless chrome, I ran out of chatgpting skills to make it to the finish line. So, Iām kinda stuck unless someone can figure out how I can get the cookie going or figure out the javascript scraping that I was trying before⦠lol. Oh API access, why do you have to be so hard?
Ok, Iām now scraping from the guest interface, which is the āpublic displayā link. Here is the result. This gets the kw and the kwh separated by a space, without any characters, so now Iām just figuring out how to do formatting so itās reliable.