Closed tanuva closed 2 months ago
Hi
the certificate should be the problem, because they are not checked. Every SMA inverter is using the self signed certificates, so everyone should have this problem.
Setting up a home assistant instance for debugging makes a lot of work.
If you have a linux system available, it is easier to use the example.py from pysma-plus.
see https://github.com/littleyoda/pysma/blob/master/doc/connection.md
If you want to go the Home Assistant route, let me know. Then I can give you a few tips.
Hah, that's the funny part: Getting values with example.py
works perfectly fine. (After I renamed the I see you planned a symlink for that now.) It is just the HA extension that seems to be unhappy with something on the network, but alas I can't really tell from the error message here what might be wrong. 🤔pysma
folder to pysmaplus
for the imports to work.
Even if I curl --insecure -X POST https://SMAxxxx.local/api/v1/token
the request at least doesn't yield an error message. No success either because the parameters are missing, of course.
Back from vacation I experimented a bit further today. Turns out that the curl
incantation from above did work from the HA host system, but not from inside the HA docker container. For reasons yet unknown to me, resolving SMAxxx.local
does not work - using the hostname without .local
works however.
Consequently, I'd consider the error message I got ([Timeout]
) misleading. I want to first spend a bit of time on getting the right values out of my Sunny Boy SE now, but I can try improving the error messaging here afterwards.
I see this when I try to set up my inverter (SMA SBSE 4.0) in ha-pysmaplus. I suspect this happens because the inverter uses an SSL certificate that is not commonly accepted, e.g. it is signed by SMA, but not by any root CA that macOS or Debian know. Curl complains about it as well.
The code location that creates this error message handles both
ClientError
andTimeoutError
, this gives me reason to believe that it isn't actually a timeout. When I try tocurl <hostname>/api/v1/token
from the HA host, curl also returns a certificate problem:My first idea to fix this is to add a checkbox in the HA setup screen to disable SSL certificate validation.
Alas I don't see how I can run my own modified version of pysmaplus in HA. I don't want to publish it first so I can make my checkout of ha-pysmaplus depend on my fork. Let alone the turnaround times for debugging that would incur. (I have ha-pysmaplus installed manually on the HA host, so modifying that is not a problem. But where does it store the pysmaplus code it depends on?)