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

order in device_Id_array #11

Closed
pol22pol opened this issue Mar 21, 2021 · 2 comments
Closed

order in device_Id_array #11

pol22pol opened this issue Mar 21, 2021 · 2 comments

Comments

@pol22pol
Copy link

In fusionsolarapp.sh you are using static relation to second position in array device_Id_array. You should check type of device because fusion can send device in other order. For example in my installation I received

Device 1: 7534929584736
Smart String Inverter	Inverter Type: SUN2000-5KTL-M0
Device Name: HV20500....
Device SN: HV20500....
Software version: V100R001C00SPC122

Device 2: 45711197793123
Dongle	Device Name: HV20500....
Device SN: HV20500....
Software version: V100R001C00SPC115
@BlazejosP
Copy link
Owner

Thanks for mentioning that. That was for now just the temporary solution just to proof that data can be pulled and show on the screen even if is just working in this specific configuration One Plant -> 2 devices [first inverter second Dongle] I have exactly the same configuration . I d'like to write interface which will show dynamically data on screen with use of TUI LINUX terminal TUI for user usage here you will be able chose from which Plant (Is possible more than one) and which device (as you mentioned can be in different order or can be more than one inverter or even more devices battery for example) you can present data on screen. Second issue is when TUI will be written will be just for user lookup sometimes. Real use of this script will be automatically pull up data to InfluxDB/domoticz/MQTT. Actually my plan is to made in TUI configuration option where you chose what will be scraped from which Plant->specific device that will be saved in config file and then in background file will pull-up data which you chosen before with use of TUI.

@BlazejosP
Copy link
Owner

BlazejosP commented Mar 22, 2021

No that is my

Device 1: [12345679]
Dongle	Device Name: bla bla
Device SN: [bla bla]
Software version: V100R001C00SPC111

Device 2: [12345679]
Smart String Inverter	Inverter Type: SUN2000-5KTL-M0
Device Name: [bla bla] 
Device SN: [bla bla]
Software version: V100R001C00SPC120

So inverter in in second place as (Device 2) That is when I call inverter device inside different functions I use position 1 in array we start from 0 in my case that is dongle in your case is reverse as you mentioned in your previous post.

My case

getDevRealKpi  ${device_Id_array[1]} ${device_TypeId_array[1]}			
getDevFiveMinutes ${device_Id_array[1]} ${device_TypeId_array[1]} $curent_time
getDevKpiDay ${device_Id_array[1]} ${device_TypeId_array[1]} $curent_time
getDevKpiMonth ${device_Id_array[1]} ${device_TypeId_array[1]} $curent_time
getDevKpiYear ${device_Id_array[1]} ${device_TypeId_array[1]} $curent_time

Proposition of solution for your configuration

getDevRealKpi  ${device_Id_array[0]} ${device_TypeId_array[0]}			
getDevFiveMinutes ${device_Id_array[0]} ${device_TypeId_array[0]} $curent_time
getDevKpiDay ${device_Id_array[0]} ${device_TypeId_array[0]} $curent_time
getDevKpiMonth ${device_Id_array[0]} ${device_TypeId_array[0]} $curent_time
getDevKpiYear ${device_Id_array[0]} ${device_TypeId_array[0]} $curent_time

But configurations and order of devices my be different for any person that is you have right is necessary to solve this in dynamical way whatever devices and order person will have. So this now is just temporary until I wrote interface in TUI and such numbers will be inserted inside functions in dynamically way. BTW if you d'like contribute your code related to this problem I will be really happy just create pull request :)

The same problem is with Power plants. I have only one because small solar installation but may existing peoples with more than one Plant. that is now is hardcoded position 0 in array. That must be also changed dynamically way

# We start function to get list of devices inside one particular plant
getDevList ${stations_Code_array[0]} $number_of_plants
			
						
# Statistical data about whole Power Plant
			
getStationRealKpi ${stations_Code_array[0]}	
getKpiStationHour ${stations_Code_array[0]} $curent_time
getKpiStationMonth ${stations_Code_array[0]} $curent_time
getKpiStationMonth ${stations_Code_array[0]} $curent_time
getKpiStationYear ${stations_Code_array[0]} $curent_time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants