gluap / pyess

Python library for communication with LG ESS power converters
MIT License
31 stars 10 forks source link

Feature Request: Multiple Inverters #18

Closed flixlix closed 1 year ago

flixlix commented 1 year ago

I have a setup with two ESS inverters. One of them is now integrated into Home Assistant. I would like to integrate the other one.

I don't think this is possible atm, because I am using a systemd service, and would need to call another service for the other inverter.

Furthermore, the ESS sends its state to mqtt using the topic "/ess/...". I imagine adding the second one would result in a few issues regarding the mqtt integration.

https://github.com/gluap/pyess/blob/182a17b4933335234cdc8a116afa62e329bd97ed/pyess/essmqtt.py#L55 I took a quick glance over the code and noticed this hardcoded mqtt topic. Would it be enough to change this topic and creating a new systemd service?

gluap commented 1 year ago

Apologies for the late answer: Yes, it would be enough to change this topic (consistently throughout the code) and create a new service. Or one could make it configureable in the process, which might be a bit of work to carry the value to all the right places though.

I simply didn't think of someone operating several ESSes on the same network when writing it (otherwise it would be configureable).

flixlix commented 1 year ago

Thank you very much for your response, I was able to integrate both inverters. I can't tell exactly what I changed anymore, but I duplicated the file I mentioned, changed every instance where the mqtt topic was mentioned and created a new service with a different name, that routed to the new file created, now it's working like a dream :)