BlazejosP / huawei-sun2000-API-CLI

Huawei SUN2000 compatible devices which working with Huawei Cloud Service command line bash API for monitoring or download data from their FusionSolarApp API
https://www.buymeacoffee.com/blazejosP
GNU General Public License v3.0
110 stars 15 forks source link

Offer to contribute #23

Closed bhaezlr closed 2 years ago

bhaezlr commented 2 years ago

Hello,

Your project got my interest. I'm running Domoticz with mqtt and I 'm searching a way to get the data from huwei in my dashboard in Domoticz. Especially the battery status.

Invert : SUN2000-4.6KTL-L1 Battery : HUAWEI-LUNA2000

If you like, maybe I can contribute to get these devices supported.

kind regards, Bart

BlazejosP commented 2 years ago

Hello, I'm really open to contribution from other persons and I will add you as contributor to repository.

So first I will try to explain general philosophy behind this project. Is written as for now in pure bash and main file is:

config.conf login and password to Huawei API is needed by function _login_toAPI from

functions.sh Here are stored all actions possible by Huawei API have their functions to handle them there are also some additional to deal with errors etc... but we have here functions like _login_toAPI or getDevList or getStationRealKpi. All of them are working now with file

fusionsolarapp.sh which is most basic graphical interface which shows data on terminal windows with echo this file to made him working to your liking need configuration simple comment uncomment necessary functions. Probably you also found on the beginning of this file commented part which is labelled # Sending data to influxDB this is not working now need bigger rewrite this is from times before Huawei server upgrade in may when this script was able to send data to database. Now I put this aside try finish rewriting code to made all function working and showing data correctly and then I will come back to this code again and plan to made export to influxDB a possibility inside this program. And here we come to the third file which I now develop most intense

fusionsolarapp_interface.sh build on Dialog TUI will be graphical interface to explore all possible data from Huawei API plant. This program is also using functions.sh to grab their data and that is why I'm now in process to rewrite this file to accommodate not only simple echo but also sending data to Dialog boxes. as for now only getStationRealKpi and getDevRealKpi are compatible with TUI but I'm nearly finishing rewriting of getDevFiveMinutes so will be also available in not so long time few days in repository.

About your battery I newer even saw one in real live and haven't this myself but will be really interested how this battery is working in terminal and in graphical interface so If you will be so kind first to post some screens here in [this post] (https://github.com/BlazejosP/huawei-sun2000-API-CLI/issues/19) be rally great of course after anonymisation of private data (plant number etc..) I write this code to handle with batteries based on huwei instruction and never tested that and there were mentioned that (only LG batteries are supported?) can you check this on real Huawei Luna2000 and tell me if device is mentioned in device list? & if you enter in TUI inside device if you can see any data from batteries? In TUI that is working only for function realtime line https://github.com/BlazejosP/huawei-sun2000-API-CLI/blob/a9617d0598dcea4da8e57b7ae756c50f7a48c009/functions.sh#L6579 but in getDevFiveMinutes

https://github.com/BlazejosP/huawei-sun2000-API-CLI/blob/a9617d0598dcea4da8e57b7ae756c50f7a48c009/functions.sh#L8315

is also code to deal with batteries which I will improve and will work with TUI too. Now only in terminal.

You may ask why is no export to MQTT, Domoticz, Home Asistant etc... to be honest I plan this modules but in a while now I d'like fully functional terminal with exports to files already implemented by @januweness his csv code. And TUI which have export to files csv,xml,txt,josn and all menus working and then will think about modules to export to MQTT, influxdb etc... So what do you think about this and if you really have your own idea what may be implemented additionally. I will be happy to accommodate this and help you to explain parts of code which is to complicated/bad write? (I know not enough comments inside files :-1: So first tell me how is working this battery with this software and then I will wait for your propositions what would you like to improve inside this software :+1:

BlazejosP commented 2 years ago

Invitation to access repository is already send to you!