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"
![image|561x500](upload://nEk4DbGnJd6CDRUGzvLD7avfDsN.jpeg)
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