-
Notifications
You must be signed in to change notification settings - Fork 15
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
Comments
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: |
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 |
I have |
Hello mnuxx |
in GUI StringINverter is 3th item on list,when open options, it shows device1 (in my case SmartLogger) information |
I think that I found this error in ./fusionsolarapp_interface.sh
to
line 558
to
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? |
Add changes to repair error found in #19
After fixing these two lines, I still get the same issue, but but seems to work if also put $3 into quotes, thus:
|
Hi, I have two power plants, and with fusionsolarapp.sh I can see both of them while with the interface only one.
|
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? |
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
Meaby try also add you second powerplant
Or in other way different experiment according to Huawei API manual
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. |
Hi, I have fixed this now in the code.
|
Hi,
great job, I can access both plants with the fusionsolarapp.sh. I have now activated your function to getKpiStationHour to get my hourly production which works very well, and as an improvement I am piping the output into a temporary file:
0) Generate a variable for temporary files that will be deleted after the script ends:
out=`mktemp tempXXXXXX` || exit 1
trap "rm -f $out*" 0 1 2 3 5
1) Create station list data for plant 1 and pipe into a temporary file
getDevList ${stations_Code_array[0]} $number_of_plants
getKpiStationHour ${stations_Code_array[0]} $curent_time > ${out}.json
There are a few non-json lines in this output file because the function getKpiStationHour is a bit too chatty in lines 2330-2358 in functions.sh, I have in my local copy commented them out, perhaps a chatter flag could be introduced that controls what kind of screen output is being produced. Or, we could write all the screenoutput we see right now into a log file rather than on screen?
My suggestion how to create the type of file I have in mind, thus
date | produced power
1) Extract the inverter power and pipe into temporary file:
less ${out}.json | jq '.data[].dataItemMap.inverterPower' > ${out}.power
2) Extract date from the json output:
less ${out}.json | jq '.data[].collectTime' > ${out}.time
3) Convert the cryptic date (nanoseconds from 1970-01-01T00:00:00) to Calendar date:
while read d; do
d3=$(echo ${d::-3})
date -d@${d3} +%Y-%m-%dT%H:%M:%S >> ${out}.dates
done < ${out}.time
4) Merge the temporary files into a final permanent file:
paste -d'|' ${out}.dates ${out}.power > device1.stats
Same works for my second plant with
getDevList ${stations_Code_array[0]} $number_of_plants
getKpiStationHour ${stations_Code_array[0]} $curent_time > ${out}.json
[.....]
paste -d'|' ${out}.dates ${out}.power > device2.stats
If you want, I can add this into the public tool.
==============================
Another suggestion is to allow the user to provide a date:
if test x${1} = x; then
mydate=0
else
mydate=$1
fi
[....]
if test "$mydate" != "0"; then
echo Extracting hourly data for date=$mydate
curent_time=$(date -d$mydate +%s)000
echo corresponding to $curent_time nonoseconds since 1970 01 01
else
curent_time=1621981136530
fi
With this change, the tool could be called with
./fusionsolarapp.sh 20210801
for August 1st
If you like these changes I can also implement them in the official version.
Cheers,
Jan
From: "BlazejosP" ***@***.***>
To: "BlazejosP/huawei-sun2000-API-CLI" ***@***.***>
Cc: "Jan-Uwe Ness" ***@***.***>, "Comment" ***@***.***>
Sent: Saturday, August 21, 2021 11:54:02 AM
Subject: Re: [BlazejosP/huawei-sun2000-API-CLI] TUI implemended but need feedback about other devices in plant (#19)
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
Tell me what will be the result of this experiment if goes well you should have txt with devices displayed from both powerplants?
—
You are receiving this because you commented.
Reply to this email directly, [ #19 (comment) | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/ABTM3ACYANU3LJVMHY4JKZLT55ZTVANCNFSM5CDE6TTA | unsubscribe ] .
Triage notifications on the go with GitHub Mobile for [ https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 | iOS ] or [ https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email | Android ] .
This message is intended only for the recipient(s) named above. It may contain proprietary information and/or
protected content. Any unauthorised disclosure, use, retention or dissemination is prohibited. If you have received
this e-mail in error, please notify the sender immediately. ESA applies appropriate organisational measures to protect
personal data, in case of data privacy queries, please contact the ESA Data Protection Officer ***@***.***).
|
That will be great if you can add this piping to josn and date argument to functions.sh especially if that will be modular |
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.
|
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: Can someone help me how to pull this correctly? |
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
but from where you can take this token? but for me after generation of this token and using in CLI is now working. |
I made this modifications in separate folder lets named them Github
then I download data from github page
then I go inside folder
Made my changes in files add comment to changes
if all OK
asking about username and password "remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. So looks like best solution is to enable two-factor authentication |
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. |
Hi, I have generated a token and also two factor authentication. I can clone the code but when trying to push, I just get: I have added two new functions to dump data to a file and would like to publish this. |
if you have actual repository try add your changes and
then add token to CLI git application only one time
And now you can send data to repository
I checked settings and you are added as collaborator so here from server side looks that all is OK |
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 ` Plant 1: XXXXXXXXXX
` |
I didn't change anything in the file fusionsolarapp.sh |
Sorry I assumed that this errors are not only in TUI but also in fusionsolarapp.sh can you uncomment this #echo $getDevRealKpi | jq in line 3024 and then execute fusionsolarapp.sh with |
Hello @bhaezlr |
I'm surely want to help.
Currently I'm on holiday till the 7th november
Op za 30 okt. 2021 21:09 schreef BlazejosP ***@***.***>:
… Hello @bhaezlr <https://github.com/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.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE2AN7OXVE2VVNQCUSRYXNDUJRGG7ANCNFSM5CDE6TTA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@BlazejosP : I'm back from holiday, with what can I help ? I cloned the latest version |
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 from answer window if 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 Then devices inside your station also copy XSRF-TOKEN and perform this question by POST 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 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? |
The last query gave a negative result: I cross checked it with other devices and they gave a positive result. |
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/getDevFiveMinutes https://eu5.fusionsolar.huawei.com/thirdData/getDevKpiDay https://eu5.fusionsolar.huawei.com/thirdData/getDevKpiMonth https://eu5.fusionsolar.huawei.com/thirdData/getDevKpiYear 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. |
All the requests returns the same negative result: It looks the parameters of the battery aren't available with API, but are available within the website |
I checked your fail code 20006 what mean "Some devices do not match the device type" https://eu5.fusionsolar.huawei.com/thirdData/getDevKpiDay but with device type 39 Battery even if manual said that only LG batteries supported. Meaby that helps? |
So you have some success? or Luna battery is still not responding? |
Same negative result. getDevKpiDay et the other functions does not accept devtypeid 23032 |
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:
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. 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? |
I go for the second option. I have sent an email. We'll wait & see if there will be any response |
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 Luna-battery is solved! I dump the data later. |
The data map: getDevRealKpi getDevFiveMinutes getDevKpiDay |
Hurray!! so now we can implement using of battery in software |
Let me know if I have to test something. |
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.
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?. |
So and how that look like are you happy from that as is working now? |
@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 ? |
Yes i have the openAPI account, but dataItemMap for the getDevRealKpi call ist empty for me i can list alle the devices including battery |
Ok fixed.. the Support Team helped me, some permissions hat to be set and now it's working :-) |
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 the Luna 2000, yes Huawei hat so set some permissions and now its working fine .-) |
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:
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.
The text was updated successfully, but these errors were encountered: