liveaverage / dc-powerwall-dashboard

Grafana dashboard showing trend & historical data polled from Tesla Powerwall 2 API served up in an easy to use docker image
13 stars 1 forks source link

Error in plugin #4

Open petercockroach opened 2 years ago

petercockroach commented 2 years ago

Apologies if this is something I'm misunderstanding. I got all services working but the db still doesn't seem to be ingesting any data. For the first 20-30 minutes, testing the data source gave me an error in Grafana about not being able to find the db. For some reason, that seems to have corrected itself but I'm not getting any data still.

I saw two types of errors. Earlier: 2021-11-11T22:55:45Z E! [inputs.http] Error in plugin: [url=https://powerwall/api/system_status/soe]: Get "https://powerwall/api/system_status/soe": context deadline exceeded (Client.Timeout exceeded while awaiting headers) 2021-11-11T22:55:50Z E! [inputs.http] Error in plugin: [url=https://powerwall/api/system_status/soe]: Get "https://powerwall/api/system_status/soe": dial tcp 192.168.1.80:443: connect: connection refused

Then later: 2021-11-11T23:03:50Z E! [inputs.http] Error in plugin: [url=https://powerwall/api/system_status/soe]: received status code 403 (Forbidden), expected any value out of [200]

telegraf-2.log

liveaverage commented 2 years ago

Looks like it's using an incorrect credential/password to poll the Powerwall API and receiving 403... You can step through cookie creation/testing by looking at the custom entrypoint.sh script: https://github.com/liveaverage/dc-powerwall-dashboard/blob/master/telegraf/entrypoint.sh#L5-L14 ... You'll want to update vales for POWERWALL_HOST and PASSWORD, possibly COOKIE too, or just run mkdir -p /tmp/cookie first...but other values can be left as-is. If successful a cookie will be created at /tmp/cookie/PWcookie.txt and then you can test whether your creds are correct:

## Note I'm using the Powerwall IP referenced in your logs -- if that's not correct then you may need to update your .env settings
curl -k -b /tmp/cookie/PWcookie.txt https://192.168.1.80/api/meters/aggregates

I also posted a couple troubleshooting steps here, but you really don't need a bearer token [yet]... just an auth cookie: https://github.com/rhodesman/teslaPowerDash/issues/27#issuecomment-873205382