Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TUI implemended but need feedback about other devices in plant #19

Open
8 of 12 tasks
BlazejosP opened this issue Aug 13, 2021 · 54 comments
Open
8 of 12 tasks

TUI implemended but need feedback about other devices in plant #19

BlazejosP opened this issue Aug 13, 2021 · 54 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@BlazejosP
Copy link
Owner

BlazejosP commented Aug 13, 2021

Now in TUI in real-time function are implemented parts of code which are able to work with various devices which can be connected to plant.
I implemented also other devices which can be inside plant but without testing and verification. If is someone who have them can mention how they work I will be very happy. The are:

  • String inverter
  • Dongle
  • Residential inverter
  • Smart Logger
  • EMI
  • Meter (Grid meter)
  • Power Sensor
  • Battery LG
  • Battery Huawei Luna 2000

Also will be great if someone who have 2 or more plants related with his account can said how this software handle them because that was also implemented without way for checking this.

  • One plant related with account
  • Two plants
  • More until ∞ ;)
@BlazejosP BlazejosP added help wanted Extra attention is needed question Further information is requested labels Aug 13, 2021
@BlazejosP BlazejosP pinned this issue Aug 13, 2021
@januweness
Copy link
Collaborator

Hello, thanks so much for keeping this alive. I can serve with two inverters on a single account and can do some testing. However, I have not done anything lately because I really only need one rather simple thing the tools does and have not managed to modify it for my purposes. Maybe this is the opportunity to work together on that as this may be quite easy for you:
What I would like is to produce a csv file with the columns:
Date/Time (hour intervals)
Yield (kWh)
Export (kWh)
Self-consumption (kWh)
Import (kWh)
thus the data behind the curves one can see on the App. I think that would be quite a common use case - do you think that would be easy to do?

@BlazejosP
Copy link
Owner Author

BlazejosP commented Aug 13, 2021

There is already export option to csv in fusionsolarapp_interface.sh for plant and for device. As for now you can export only realtime datata because that is what I done now for TUI. In a while will be also ready possibility to export hourly/daily/monthly/yearly data. If you d'like a little bit different schema of exported data will be great to accommodate this in code simple push your code to repository. I forgot to add this export option to txt version of interface fusionsolarapp.sh propably also will add this in a while.

Now questions to you can you check in both interfaces fusionsolarapp_interface.sh & fusionsolarapp.sh how this software handle two power plants and if everything is ok? or is necessary to repair something? will be great and tick box that is checked with two

@BlazejosP BlazejosP added the enhancement New feature or request label Aug 15, 2021
@mnuxx
Copy link

mnuxx commented Aug 19, 2021

I have
String Inverter Model: SUN2000-30KTL-M3
Grid meter Model: PowerMeter
Distributed SmartLogger Model: Smart Logger
Happy to help , currently i cant see getDevRealKpi, opened another ticket for that.

@BlazejosP BlazejosP reopened this Aug 20, 2021
@BlazejosP
Copy link
Owner Author

Hello mnuxx
Can you describe which devices in graphical interface TUI are working fine and with wich you have problem so I will be able to mark this which are working fine and help you with the rest?

@mnuxx
Copy link

mnuxx commented Aug 20, 2021

in GUI
PowerMeter Optsions exit gui
./fusionsolarapp_interface.sh: line 501: [: ==: unary operator expected
./fusionsolarapp_interface.sh: line 501: [: =: unary operator expected
./fusionsolarapp_interface.sh: line 501: [: =: unary operator expected
./fusionsolarapp_interface.sh: line 555: [: ==: unary operator expected
./fusionsolarapp_interface.sh: line 555: [: =: unary operator expected
./fusionsolarapp_interface.sh: line 555: [: =: unary operator expected

StringINverter is 3th item on list,when open options, it shows device1 (in my case SmartLogger) information

image

@BlazejosP
Copy link
Owner Author

BlazejosP commented Aug 20, 2021

I think that I found this error in ./fusionsolarapp_interface.sh
line 501

if [ $3 == "String_Inverter" ] || [ $3 = "Residential_inverter" ] || [ $3 = "Battery" ];

to

if [ $3 == "String_Inverter" ] || [ $3 == "Residential_inverter" ] || [ $3 == "Battery" ];

line 558

elif [ $3 == "EMI" ] || [ $3 = "Grid_meter" ] || [ $3 = "Power_Sensor" ];

to

elif [ $3 == "EMI" ] || [ $3 == "Grid_meter" ] || [ $3 == "Power_Sensor" ];

So now you should be able to check first device Distributed smart meter and will be communicate that there are no any data to see and for Grid meter and String Inverter you should be able to see them under Options. I will upload this modified file and ask to your raport about TUI if is working OK or need deeper analysis?

BlazejosP added a commit that referenced this issue Aug 20, 2021
Add changes to repair error found in #19
@januweness
Copy link
Collaborator

After fixing these two lines, I still get the same issue, but but seems to work if also put $3 into quotes, thus:
if [ "$3" == "String_Inverter" ] || [ "$3" == "Residential_inverter" ] || [ "$3" == "Battery" ];
elif [ "$3" == "EMI" ] || [ "$3" == "Grid_meter" ] || [ "$3" == "Power_Sensor" ];

I think that I found this error in ./fusionsolarapp_interface.sh
line 501

if [ $3 == "String_Inverter" ] || [ $3 = "Residential_inverter" ] || [ $3 = "Battery" ];

to

if [ $3 == "String_Inverter" ] || [ $3 == "Residential_inverter" ] || [ $3 == "Battery" ];

line 558

elif [ $3 == "EMI" ] || [ $3 = "Grid_meter" ] || [ $3 = "Power_Sensor" ];

to

elif [ $3 == "EMI" ] || [ $3 == "Grid_meter" ] || [ $3 == "Power_Sensor" ];

So now you should be able to check first device Distributed smart meter and will be communicate that there are no any data to see and for Grid meter and String Inverter you should be able to see them under Options. I will upload this modified file and ask to your raport about TUI if is working OK or need deeper analysis?

@januweness
Copy link
Collaborator

Hi, I have two power plants, and with fusionsolarapp.sh I can see both of them while with the interface only one.

Now questions to you can you check in both interfaces fusionsolarapp_interface.sh & fusionsolarapp.sh how this software handle two power plants and if everything is ok? or is necessary to repair something? will be great and tick box that is checked with two

@BlazejosP
Copy link
Owner Author

After fixing these two lines, I still get the same issue, but but seems to work if also put $3 into quotes

Can you add this as your modification to fusionsolarapp_interface.sh was great and really nice that you found this error I have no way to verify this myself because I have only one power plant with just boring inverter&dongle. I d'like to ask so now you can access to TUI and check every device without any unexpected issues?

@BlazejosP
Copy link
Owner Author

BlazejosP commented Aug 21, 2021

Hi, I have two power plants, and with fusionsolarapp.sh I can see both of them while with the interface only one.

If i look on the code of fusionsolarapp.sh I think that I not implemented working with two power plants probably because I have only one and is hard to test this without API where you can test behavior of the code. Just only theoretically.

As you mentioned function getStationList found both powerplants without problem but then we have code of our station in variable ${stations_Code_array[0]} here first then in ${stations_Code_array[1]} second etc. line 1468 in functions.sh

This station code is used then by function getDevList to print all the devices inside particular power plant
in fusionsolarapp.sh line 174

getDevList ${stations_Code_array[0]} $number_of_plants

Meaby try also add you second powerplant

getDevList ${stations_Code_array[0]} $number_of_plants
getDevList ${stations_Code_array[1]} $number_of_plants

Or in other way different experiment according to Huawei API manual

getDevList ${stations_Code_array[0]}","${stations_Code_array[1]} $number_of_plants

Tell me what will be the result of this experiment if goes well you should have txt with devices displayed from both powerplants? If that will work we can try to found way to display getStationRealKpi & getDevRealKpi from both plants together.

@januweness
Copy link
Collaborator

Hi, I have fixed this now in the code.

After fixing these two lines, I still get the same issue, but but seems to work if also put $3 into quotes, thus:
if [ "$3" == "String_Inverter" ] || [ "$3" == "Residential_inverter" ] || [ "$3" == "Battery" ];
elif [ "$3" == "EMI" ] || [ "$3" == "Grid_meter" ] || [ "$3" == "Power_Sensor" ];

@januweness
Copy link
Collaborator

januweness commented Aug 21, 2021 via email

@BlazejosP
Copy link
Owner Author

If you like these changes I can implement them in the official version.

That will be great if you can add this piping to josn and date argument to functions.sh especially if that will be modular
don't forgot to add some examples of using piping function in fusionsolarapp.sh and also how you extract data from two power plant to the same file

@januweness
Copy link
Collaborator

Hi, ok, date argument is implemented and statistical data examples for second plant with comments in code.

The json parsing I will do later. Are you ok that the screen output in the statistical data functions are removed? I could try to pipe them into a master log file if you like.

Btw, I have for now only worked with the function getKpiStationHour, will check the others later.

If you like these changes I can implement them in the official version.

That will be great if you can add this piping to josn and date argument to functions.sh especially if that will be modular
don't forgot to add some examples of using piping function in fusionsolarapp.sh and also how you extract data from two power plant to the same file

@januweness
Copy link
Collaborator

So far I have tested offline and implemented my changes in the web page. I am trying now to move to git pull/push but don't get this right (sorry, not experienced with git). I tried:
git pull huawei-sun2000-API-CLI
fatal: not a git repository (or any of the parent directories): .git

Can someone help me how to pull this correctly?
Thanks!

@BlazejosP
Copy link
Owner Author

Now if you d'like to commit some changes to repository you need use personal token so this is how final push command will looks like

git push https://<your token>@github.com/BlazejosP/huawei-sun2000-API-CLI.git

but from where you can take this token?
https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/
https://webkul.com/blog/github-push-with-two-factor-authentication/
so this problem is since 13th ;) of August

but for me after generation of this token and using in CLI is now working.

@BlazejosP
Copy link
Owner Author

I made this modifications in separate folder lets named them Github

cd Github
ls

then I download data from github page

git clone https://github.com/BlazejosP/huawei-sun2000-API-CLI.git

then I go inside folder

cd huawei-sun2000-API-CLI

Made my changes in files

add comment to changes

git commit -m "small changes in order in fusionsolarapp.sh"

if all OK

git push https://github.com/BlazejosP/huawei-sun2000-API-CLI.git

asking about username and password
And all should working OK like before but there is error with this communicate:

"remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information."

So looks like best solution is to enable two-factor authentication
https://docs.github.com/en/github/authenticating-to-github/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication
https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/

@BlazejosP
Copy link
Owner Author

So far I have tested offline and implemented my changes in the web page. I am trying now to move to git pull/push but don't get this right (sorry, not experienced with git). I tried:
git pull huawei-sun2000-API-CLI
fatal: not a git repository (or any of the parent directories): .git

Can someone help me how to pull this correctly?
Thanks!

I done this with token and now is working again inside CLI hope that you also will be able to generate this and use in your case.

@januweness
Copy link
Collaborator

Hi, I have generated a token and also two factor authentication. I can clone the code but when trying to push, I just get:
Everything up-to-date

I have added two new functions to dump data to a file and would like to publish this.

@BlazejosP
Copy link
Owner Author

BlazejosP commented Sep 3, 2021

if you have actual repository try add your changes and
add comment

 git commit -m "small changes in order in fusionsolarapp.sh"

then add token to CLI git application only one time

git remote add origin https://token to account: <--Your token-->@github.com/BlazejosP/huawei-sun2000-API-CLI.git

And now you can send data to repository

git push https://<--Your token-->@github.com/BlazejosP/huawei-sun2000-API-CLI.git

I checked settings and you are added as collaborator so here from server side looks that all is OK

@BlazejosP BlazejosP added the documentation Improvements or additions to documentation label Sep 8, 2021
@BlazejosP
Copy link
Owner Author

BlazejosP commented Oct 18, 2021

I have feeling that I know why you have always Dongle data in fusionsolarapp.sh ?

lets see on example you d'like to see real-time data for particular device and you uncomment this
getDevRealKpi ${device_Id_array[0]} ${device_TypeId_array[0]}
0 means that you see data for first device. So everything depending from order of your devices on your account on. You can check this in TUI when you see devices inside plant or in fusionsolarapp.sh in function getDevList
In my case looks like this that is why I chose 0 to take data from inverter in your case maybe different order

`
API getDevList connection OK
Normal Status
Time of your Request to API: XXXXXX

Plant 1: XXXXXXXXXX
Number of devices: 2

Device 1: XXXXXXXXXX
String Inverter	Model: SUN2000-5KTL-M0
Device Name: XXXXXXXXXX
Device SN: XXXXXXXXXX
Software version: V100R001C00SPC120
longitude: Not existing
latitude: Not existing

Device 2: XXXXXXXXXX
Dongle	Model: SDongleA-05
Device Name: XXXXXXXXXX
Device SN: XXXXXXXXXX
Software version: V100R001C00SPC111
longitude: Not existing
latitude: Not existing

`
In case of fusionsolarapp_interface.sh things are more complicated again I have feeling that this $3 is needed by interface to take data from array for different devices if you mess with this and replace with $2 is possible that all the devices are recognised as this first one with 0 number and you always try to see Dongle internal data even If you chosen different devices from list.

@bhaezlr
Copy link

bhaezlr commented Oct 18, 2021

I didn't change anything in the file fusionsolarapp.sh
The line was already uncommented in the download. Saved a copy of the original download

@BlazejosP
Copy link
Owner Author

Sorry I assumed that this errors are not only in TUI but also in fusionsolarapp.sh
great that you solved some problems with showing your Luna2000 battery in menu but there is problem with data from particular devices as I understand. Look inside Devices_list_menu () in fusionsolarapp_interface.sh line 431 to 451 isnecessary to create entry for your luna battery which will execute function getDeviceKPI_menu to show something from inside of your battery. Next thing in the same file lines inside function getDeviceKPI_menu line 501
if [ "$3" == "String_Inverter" ] || [ "$3" == "Residential_inverter" ] || [ "$3"== "Battery" ]; will be necessary to create something for Lune2000 like
if [ "$3" == "String_Inverter" ] || [ "$3" == "Residential_inverter" ] || [ "$3"== "Battery" ] || [ "$3"== "Huawei_LUNA2000_Battery" ]; whothever string you named your battery in functionDevice_type_ID () in functions.sh
then in functions.sh is necessary to create code which will deal with your Luna for getDevRealKpi() line 3002

can you uncomment this #echo $getDevRealKpi | jq in line 3024 and then execute fusionsolarapp.sh with getDevRealKpi ${device_Id_array[0]} ${device_TypeId_array[0]} with number of your Luna battery probably different than 0 and show results in josn then we can see what is answer of your battery in API and plan what should be coded in functions.sh to made your device working in TUI?

@BlazejosP
Copy link
Owner Author

Hello @bhaezlr
after this update I have now really time and willingness to implement your Luna2000 battery. I will need some help from your side especially answers on different questions from side of Luna2000. You can also push to repository your modifications but now I hope I can really help you to made this working.

@bhaezlr
Copy link

bhaezlr commented Oct 30, 2021 via email

@bhaezlr
Copy link

bhaezlr commented Nov 8, 2021

@BlazejosP : I'm back from holiday, with what can I help ? I cloned the latest version
In the website the battery is visilble.
I haved installed postman in case of.

@BlazejosP
Copy link
Owner Author

BlazejosP commented Nov 8, 2021

So your battery is visible because we added Sun 2000 based on your data which you provided earlier. But that is just a mock-up because like from a dongle you can't see any thing from inside data. I don't know what type of data are available from your battery because is no any documentation about Luna2000 so all will be build based on your experiments with postman.

So first in Postman try to login with your username and password
by POST try this
https://eu5.fusionsolar.huawei.com/thirdData/login
in Body
{ "userName": "<yourusername>", "systemCode": "<yourpassword>" }

from answer window if "success": true, check

screenshot

Cookies in menu where is Body and copy from there value of XSRF-TOKEN will be necessary to have that for others questions

Next question station list insert into Headers your XSRF-TOKEN and perform question by POST

https://eu5.fusionsolar.huawei.com/thirdData/getStationList
{ }
You have code of your station
{ "data": [ { "aidType": 1, "buildState": null, "capacity": 12, "combineType": null, "linkmanPho": "XXXXXX", "stationAddr": "XXXXXXXXXXXXXXXX", "stationCode": "<here station code>", "stationLinkman": "XXXXXXXXXXXX", "stationName": "XXXXXXXXXX" } ], "failCode": 0, "message": null, "params": { "currentTime": 1636405920176 }, "success": true }

Then devices inside your station

also copy XSRF-TOKEN and perform this question by POST
https://eu5.fusionsolar.huawei.com/thirdData/getDevList
{ "stationCodes": "<Here station code from previous question" }
Answer will be like this
{ "data": [ { "devName": "XXXXXXX", "devTypeId": 1, "esnCode": "XXXXXXX", "id": <here id of device>, "invType": "SUN2000-5KTL-M0", "latitude": 1.0, "longitude": 1.0, "softwareVersion": "V100R001C00SPC120", "stationCode": "XXXXXXXXXXXXXXX" }, { "devName": "XXXXXXX", "devTypeId": 62, "esnCode": "XXXXXXXXX", "id": <here id of device>, "invType": "SDongleA-05", "latitude": 1.0, "longitude": 1.0, "softwareVersion": "V100R001C00SPC111", "stationCode": "XXXXXXXXXXXXXX" } ],23032 "failCode": 0, "message": null, "params": { "currentTime": 1636406083367, "stationCodes": "XXXXXXXXXXX" }, "success": true }

So now when you copy id of your Luna 2000 battery you are ready to ask this questions to API which we really need.

First if you can perform this real-time performance question for Luna 2000 don't forgot insert XSRF-TOKEN

https://eu5.fusionsolar.huawei.com/thirdData/getDevRealKpi

inside Body {"devIds": "<here id of device from previous question>", "devTypeId": "23032"}

So if you can show how looks answer for this Luna2000 in postman of course after anonymisation of some data. based on that answer we can prepare addition in function to show real time data from your battery. About next question I ask you letter when we both figured out how Luna2000 battery answer for this Real time API question meaby similarly to LG battery who now?

@bhaezlr
Copy link

bhaezlr commented Nov 9, 2021

The last query gave a negative result:
{
"data": null,
"failCode": 20006,
"message": null,
"params": {
"currentTime": 1636443370390,
"devIds": "",
"devTypeId": 23032
},
"success": false
}

I cross checked it with other devices and they gave a positive result.

@BlazejosP
Copy link
Owner Author

So looks like manual said true Luna2000 like a dongle has no any internal/historical data and is only possible to have this device on list and nothing more. Or meaby only real-time question is not working and historical data is still possible to extract. Before we close this subject can you check rest of historical data extraction questions to be certain? Here they are:

https://eu5.fusionsolar.huawei.com/thirdData/getDevRealKpi Not Working!

https://eu5.fusionsolar.huawei.com/thirdData/getDevFiveMinutes
Question:
{ "devIds" : "<here your device id>", "devTypeId": 23032, "collectTime" : "1636395918000" }

https://eu5.fusionsolar.huawei.com/thirdData/getDevKpiDay
Question:
{ "devIds" : "<here your device id>", "devTypeId": 23032, "collectTime" : "1636395918000" }

https://eu5.fusionsolar.huawei.com/thirdData/getDevKpiMonth
Question:
{ "devIds" : "<here your device id>", "devTypeId": 23032, "collectTime" : "1636395918000" }

https://eu5.fusionsolar.huawei.com/thirdData/getDevKpiYear
Question:
{ "devIds" : "<here your device id>", "devTypeId": 23032, "collectTime" : "1636395918000" }

Let's see if will be any answer from Luna2000 to be certain that all is working correctly you can also perform this question also on your inverter in my case devIds number is with minus "-XXXXXX" and "devTypeId": 1 you can take this from question https://eu5.fusionsolar.huawei.com/thirdData/getDevList answer so hope that one of them my work with your battery.

For now that all looks that your Battery is different that this of LG and API can't take from them any data like manual said. But if you use TUI graphical interface can you see base data about battery like device name, software version etc? I have them for dongle even if options button can't show anything.

@bhaezlr
Copy link

bhaezlr commented Nov 9, 2021

All the requests returns the same negative result:
{
"data": null,
"failCode": 20006,
"message": null,
"params": {
"currentTime": 1636489592610,
"collectTime": 1636395918000,
"devIds": "",
"devTypeId": 23032
},
"success": false
}

It looks the parameters of the battery aren't available with API, but are available within the website

@BlazejosP
Copy link
Owner Author

I checked your fail code 20006 what mean "Some devices do not match the device type"
can you check one of the questions. For example

https://eu5.fusionsolar.huawei.com/thirdData/getDevKpiDay
Question:
{ "devIds" : "<here your device id>", "devTypeId": 39, "collectTime" : "1636395918000" }

but with device type 39 Battery even if manual said that only LG batteries supported. Meaby that helps?

@BlazejosP
Copy link
Owner Author

So you have some success? or Luna battery is still not responding?

@bhaezlr
Copy link

bhaezlr commented Nov 14, 2021

Same negative result. getDevKpiDay et the other functions does not accept devtypeid 23032
Tried them also with 39 as devtypeid
I fear that I will need a webscrapper to get the percentage of the battery

@BlazejosP
Copy link
Owner Author

We have still two/three options some peoples asked on official forum of Huawei API subject here but as I can see without answer from Huawei employees:
https://forum.huawei.com/enterprise/en/communicate-with-fusionsolar-through-an-openapi-account/thread/591478-100027?page=4

diarmuid Created May 24, 2021 08:39:29

Posted by maartenva at 2021-05-16 13:01 Hi is there an updated version of the API request that also include the status of the LUNA2000 batt ...

I have the same question. I am choosing between a Huawei SUN200L + 3x LUNA500 vs an AlphaESS system for which I will do a custom integration with NEST. The most important information for that integration if the SOC (state of charge) of the battery ... I have not been able to find anything from Huawei re the battery.

Second option ask about API interface to Luna2000 official help-desk [email protected]

Third option There existing other than fusion solar API interface from https://eu5.fusionsolar.huawei.com to access to data from inverter is called Modbus TCP and you can access data directly on device without use of any servers on internet. Simple inverter brodcast wifi network when you login inside this network you can ask some registers about data which are interesting for you. That for sure working with inverter I don't know that battery also brodcast some wifi you must check. Here is a long subject with software to connect to this Modbus interface.
https://community.home-assistant.io/t/integration-solar-inverter-huawei-2000l/132350/804

That is all option which you have in this moment I will be interested what support will answer meby existing some "secret" call to API to grab this data or meaby that is possible only with use of Modbus acess?

BTW. Even if we have a stalemate with Luna 2000 may I ask you how now is working Power Sensors from your installation are still there any errors when you try check this device?

@bhaezlr
Copy link

bhaezlr commented Nov 15, 2021

I go for the second option. I have sent an email. We'll wait & see if there will be any response
A no go for the third option , I can't switch all the time my wifi connection

@BlazejosP
Copy link
Owner Author

Lets see what they said. I'm also curious?

And in case of Modbus TCP you don't must reconnect each time easier solution is install second Wi-Fi interface in your monitoring computer just for that.

@bhaezlr
Copy link

bhaezlr commented Nov 19, 2021

Lets see what they said. I'm also curious?

And in case of Modbus TCP you don't must reconnect each time easier solution is install second Wi-Fi interface in your monitoring computer just for that.

Message was sorted as spam :-(
The raspberry Pi that is used serves already my Domoticz system. Second WIFI is option.
Currently I'm in contact with Huawei support.

@bhaezlr
Copy link

bhaezlr commented Nov 20, 2021

The Luna-battery is solved!
I don't know what they changed, but first the helpdesk asked my API-account to check something.
I got a message that there was an upgrade planned on the Fusionsolar server from 22:00:00 November 19 to 06:00:00 November 20 < UTC+02:00 >. I accidently saw the message on the website
Retried my queries that were saved in Postman and now the battery is recognized as devtypeid 39 instead of 23032

I dump the data later.

@bhaezlr
Copy link

bhaezlr commented Nov 20, 2021

The data map:
getDevList
{
"devName": "Battery",
"devTypeId": 39,
"esnCode": null,
"id": xxxxxxxxxxxxxxxxx,
"invType": null,
"latitude": xxxxxxxx,
"longitude": xxxxxxxxx,
"optimizerNumber": null,
"softwareVersion": null,
"stationCode": "NE=xxxxxxxxx"
}

getDevRealKpi
{
"data": [
{
"devId": xxxxxxxxxxxxxxxx,
"dataItemMap": {
"max_discharge_power": 5000.0,
"max_charge_power": 5000.0,
"battery_soh": 0.0,
"busbar_u": 423.8,
"discharge_cap": 0.14,
"ch_discharge_power": 24.0,
"run_state": 1,
"battery_soc": 1.0,
"ch_discharge_model": 4.0,
"charge_cap": 0.24,
"battery_status": 2.0
}
}
],
"failCode": 0,
"message": null,
"params": {
"currentTime": 1637430222772,
"devIds": "xxxxxxxxxxxxxxxx",
"devTypeId": 39
},
"success": true
}

getDevFiveMinutes
{
"data": [
{
"devId": xxxxxxxxxxxxxxxx,
"collectTime": 1636326000000,
"dataItemMap": {
"max_discharge_power": null,
"max_charge_power": null,
"battery_soh": null,
"busbar_u": 423.9,
"discharge_cap": 0.0,
"ch_discharge_power": 24.0,
"battery_soc": 1.0,
"charge_cap": 0.0,
"ch_discharge_model": null,
"battery_status": null
}
},
...
],
"failCode": 0,
"message": null,
"params": {
"currentTime": 1637430383806,
"collectTime": 1636395918000,
"devIds": "xxxxxxxxxxxxxxxx",
"devTypeId": 39
},
"success": true
}

getDevKpiDay
getDevKpiMonth
getDevKpiYear

{
"data": [
{
"devId": xxxxxxxxxxxxxxxx,
"collectTime": 1635721200000,
"dataItemMap": {
"discharge_cap": 3.03,
"charge_cap": 3.15,
"charge_time": 15.0,
"discharge_time": 8.75
}
},
...
],
"failCode": 0,
"message": null,
"params": {
"currentTime": 1637430357951,
"collectTime": 1636395918000,
"devIds": "xxxxxxxxxxxxxxxx",
"devTypeId": 39
},
"success": true
}

@BlazejosP
Copy link
Owner Author

Hurray!! so now we can implement using of battery in software

@bhaezlr
Copy link

bhaezlr commented Nov 22, 2021

Hurray!! so now we can implement using of battery in software

Let me know if I have to test something.
My mission succeeded. I have my battery charging status in Domoticz via MQTT/nodered

@BlazejosP
Copy link
Owner Author

BlazejosP commented Nov 23, 2021

Thanks for that that you share your data that helps improve this program a little bit and hopefully helps also add your battery to supported device. I just uploaded new version which also working with yearly data period.

  1. Can you check last time how Luna2000 is looking in CLI and graphical interface my question is all the data are displayed correctly and if you can export them to files.
  2. I know that you have also Power Sensors in your installation if you can also check this and tell me if all is working correctly?
  3. I have my battery charging status in Domoticz via MQTT/nodered

That sound interesting for this project I just now planed to start implementing MQTT and InfluxDB exporting if you have already working solution and d'like to share to implement in this project will be really great and my speed-up development so If you will be interested in contribution let me know especially part which export to NodeRED&MQTT?.

@BlazejosP
Copy link
Owner Author

Hurray!! so now we can implement using of battery in software

Let me know if I have to test something. My mission succeeded. I have my battery charging status in Domoticz via MQTT/nodered

So and how that look like are you happy from that as is working now?

@BlazejosP BlazejosP unpinned this issue Jan 1, 2022
@igerlster
Copy link

@bhaezlr i have the same Problem like you had with empty response from getDevRealKpi, can you tell me who you contacted for this ? Today Huawei Support told me i can not use the API for this at all. :-(

@bhaezlr
Copy link

bhaezlr commented Jan 19, 2022

@bhaezlr i have the same Problem like you had with empty response from getDevRealKpi, can you tell me who you contacted for this ? Today Huawei Support told me i can not use the API for this at all. :-(

Did you request an openAPI account ?
I can still read my batterystatus, but since the upgrade not every 5min the data comes through.
I read the batterystatus with a script based on fusionsolarapp.sh

@igerlster
Copy link

dataItemMap

Did you request an openAPI account ?
I can still read my batterystatus, but since the upgrade not every 5min the data comes through.
I read the batterystatus with a script based on fusionsolarapp.sh

Yes i have the openAPI account, but dataItemMap for the getDevRealKpi call ist empty for me i can list alle the devices including battery

@igerlster
Copy link

Ok fixed.. the Support Team helped me, some permissions hat to be set and now it's working :-)

@BlazejosP
Copy link
Owner Author

BlazejosP commented Jan 21, 2022

Hello As I understand # @igerlster has the same problem to @bhaezlr that some part of data from his account was blocked on Huawei server when you use this software and as I understand Huawei unblock this and now especially when login working again you can check status of your batteries inside this software if I think correct?
I have question to @igerlster what type of battery do you have Luna 2000 or LG?
And question to @bhaezlr if real time status of battery really disappear or is only blocked on your account or there were changes in API and meaby they need adjustment in code of this software?

@igerlster
Copy link

I have question to @igerlster what type of battery do you have Luna 2000 or LG?

i have the Luna 2000, yes Huawei hat so set some permissions and now its working fine .-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants