djansen1987 / SAJeSolar

SAJ eSolar Portal Sensors
GNU General Public License v3.0
21 stars 13 forks source link

Add uuid param to reduce calls load and allow unpaired users to use the plugin #64

Closed elboletaire closed 8 months ago

elboletaire commented 8 months ago

Today I was migrating home assistant from a docker to a raspberry pi. Something I tried twice before, and had no issues, but today suddenly, after loading the backup in the raspberry pi, I noticed all the esolar sensors weren't working.

After debugging some time, I realized my plant was unlinked from my account in the saj website, but I can still access it via the URL

https://fop.saj-electric.com/saj/monitor/site/detailForm?plantuid={UUID}

I'm aware this plugin can't be the culprit, unless saj website has some serious issue in the used calls, and they unlinked my account when migrating (very unlikely, and remember I tried migrating twice this week without issues).

So I manually hardcoded the UUID in the sensor.py file in order to have it working. I do realize I lost some sensors that were taken from the plant list, but I'm not really using those, so I don't care.

I think you could add a configurable way of adding that UUID, and avoid the response2 entirely in such case (or find other means to get those values, without the plant list requirement). Obviously this should be accompanied with a notice warning about the possible missing sensors, in case you opt for that way.

djansen1987 commented 8 months ago

are you perhaps a greenheiss user ? If so please read here: https://github.com/djansen1987/SAJeSolar/issues/65

elboletaire commented 8 months ago

No, but it's the same issue. I'm from Solarprofit and the last comment adds a link to their manager (inversor.saj-electric.com). And login there I can see the plant. So it's probably a better idea to just add means to configure the domain, rather than adding the uuid feature I was requesting.

djansen1987 commented 8 months ago

fixed in https://github.com/djansen1987/SAJeSolar/releases/tag/v1.5.1