Solar forecast - custom api calls possible? #21882
|
I see that there now is an option to get solar forecasts into evcc. (solcast , open-meteo etc). I mean like But then for this: And if so, would that expect the same json dataformat as the custom grid tarrif? Like I want to avoid having to pull the same external api twice if possible and my solar predictions in home assistant are parsed by EMHASS machine learning module to take local offset into account (specific shaddow, dirty solar panels etc..) (https://emhass.readthedocs.io/en/latest/forecasts.html#adjusting-pv-forecasts-using-machine-learning) |
Replies: 6 comments 12 replies
|
Yes, that is possible. You can take a look at the templates |
tariffs:
solar:
- type: custom
forecast: ## Open-Meteo-Forecast integration HA
source: http
uri: http://127.0.0.1:8123/api/states/sensor.energy_production_72h_forecast
method: GET
headers:
- content-type: application/json
- authorization: Bearer eyxxxxxGFiODM2xxxMCIsImlhdCI6MTY1NzQ0NjQ3xxxx.EtakTBxxxr61U1jmLb4PxxxxxC6_w1cxx0
insecure: false # set to true to trust self-signed certificates
jq: |
.attributes.watts | to_entries
| map({
"datetime": (.key | strptime("%Y-%m-%dT%H:%M:%S%z") | mktime),
"value": .value
})
| group_by(.datetime - (.datetime % 3600))
| map({
start: (.[0].datetime | strftime("%FT%TZ")),
end: (.[0].datetime + 3600 | strftime("%FT%TZ")),
value: (map(.value) | add / length | round)
})
| tostring |
|
I stepped over the same issue today. This is the configuration for evcc. and this is how your json output should look like from the script which generates the data: |
|
Thanks guys, got it working. Anyone else trying to re-use emhass solar predictions from home assistant in evcc: create a template in home assistant that formats the data and the definition en evcc.yaml becomes: Output of the home assistant template looks like this : Anyone know what the adjust solar forecast button in evcc does? Is this based on machine learning like emhass or just scales down to instant solar production measurement? |
|
Could someone give me a hand? I created a sensor in HA because I want to include the power output of a fuel cell in the forecast. The sensor is initially providing values, and I've resolved the previous error messages in evcc: However, I configured the integration in evcc as follows: This doesn't cause any error messages in tariffs, but the forecast is grayed out, and the following error message appears in site: My assumption (sorry – I simply don't know what evcc expects) is that evcc can't add the existing natively integrated forecasts with the HA custom forecast. Therefore, my question is: |




I stepped over the same issue today. This is the configuration for evcc.
and this is how your json output should look like from the script which generates the data: