davidusb-geek / emhass

emhass: Energy Management for Home Assistant, is a Python module designed to optimize your home energy interfacing with Home Assistant.
MIT License
263 stars 51 forks source link

Bug: Incorrect list of supported modules / inverters in docs #145

Closed ha-enthus1ast closed 3 months ago

ha-enthus1ast commented 6 months ago

Hi,

According to the the documentation the list of modules / inverters supported are found here and here.

However, as far as I can tell inverter/modules are retrieved from the oline SAM database. See snippet below

https://github.com/davidusb-geek/emhass/blob/56913605ad36a4b674c294c48a90ea1d2a6fdb7b/src/emhass/forecast.py#L413

Which indicates, according to pvlib docs that the online database is used.

The actual list of supported modules are located here

Thanks in advance

davidusb-geek commented 6 months ago

Hi,

That's just not the case. Take a look at this line of code from PVLib, this is the line where the exact same CSV file that I indicate in the documentation is loaded: https://github.com/pvlib/pvlib-python/blob/16017609ea2765c4651dbc13b4743578363b641a/pvlib/pvsystem.py#L2052C71-L2052C71

That's what it is for PVLib. I hope that there will be another method with a more updated database. But there isn't and is up to PVLib developers to update this. Maybe you can open an issue there to ask for this update. If you're having problems finding you module or inverter model just skip PVLib altogether and use solcast or solar.forecast methods, they work just fine.

ha-enthus1ast commented 6 months ago

Oh, you are correct. That was very suprising and I think the pvlib documentation is insufficient in this case.

However, looking at the pvlib source you linked, it should be possible to supply your own csv file, right? ie by only passing a path to a cvc file, rather that passing a name.

cec_inverters = pvlib.pvsystem.retrieve_sam('<path_to_custom_csv>')

I am not stuck in any way I was just confused on which file was actually used.

Thanks for getting back to me!

davidusb-geek commented 6 months ago

Yes if we can put together un updated version of the CSV file then maybe we can pass it directly yes. it can be an option. Now where can we find this updated version. We need to keep the same formatting as the current CSV file.

ha-enthus1ast commented 6 months ago

As I mentioned in the issue, pvlib refers to files here where it seems the latest update of the list is for fall 2023. It seems to me that the format of the inverter file has somewhat changed, but the one for the modules seems to be at least similar. Whether any of these potential format changes are supported by pvlib or not i do not know..

ha-enthus1ast commented 6 months ago

This approach would however require someone to manually update the csv file on new lists. It could of course be retreived from the source by supplying a URL instead, but that is probably a bad idea since it would rely on an internet connection and on the fact that pvlib supports all future formats of the file.

davidusb-geek commented 6 months ago

I didn't saw that option to pass a CSV path and from what I can see that updated CSV has the same format except for the last column. I think that we could use that. I will try it and if it works I will include it in the next release.

ha-enthus1ast commented 6 months ago

Cool thanks!

ha-enthus1ast commented 6 months ago

Closing issue as invalid, see this comment

davidusb-geek commented 5 months ago

I reopened this issue because we could possible update the CSV files stored in EMHASS to those more updated files from SAM. But this need to be tested.

davidusb-geek commented 3 months ago

I made the needed changes for this. It will be available in the following releases. Here is a post in the community forum: https://community.home-assistant.io/t/emhass-an-energy-management-for-home-assistant/338126/2031?u=davidusb And the link to the new webapp to help search the modules and inverter names for your configuration: https://emhass-pvlib-database.streamlit.app/

davidusb-geek commented 3 months ago

Released on latest version. Closing