troygNZ / homebridge-solax

Homebridge Solax Monitoring
Apache License 2.0
7 stars 1 forks source link

Battery state not working with SolaX hybrid inverter #23

Closed Cardo1 closed 4 years ago

Cardo1 commented 4 years ago

Describe the bug Not sure if a bug or an improvement / supporting more devices.

My inverter provides all the values for the battery in the data string. As follows:

"method":"uploadsn","version":"Solax_SI_CH_2nd_20160912_DE02","type":"AL_SE","SN":"serialnumber","Data":[6.1,6.4,212.0,178.9,0.9,245.6,97,37,2.2,8319.2,-48,1293,1144,54.78,41.19,2259,26,67,0.0,2823.5,,,,,,,,,,,,,,,,,,,,,,0.00,0.00,,,,,,,,50.03,,,0.0,0.0,0,0.00,0,0,0,0.00,0,9,0,0,0.00,0,9],"Status":"2"}

The “67” value above is the current battery %. The “2259” figure is the current watts going into the battery.

At the moment, the plugin shows 0% for my battery (says not supported in the Home app, but I get 0% on others).

To Reproduce N/A

Expected behavior The battery accessory to show the battery % from the above string, maybe a further accessory to show the battery input/output.

Screenshots N/A

Desktop (please complete the following information): N/A

Smartphone (please complete the following information): N/A

Additional context

Thanks for your work!

troygNZ commented 4 years ago

Thanks, I'll have a look at reproducing the issue this evening, and doing a possible fix.. It's been tough to do the battery stuff since I don't have one, but now have some test-data, thanks to you. Cheers

troygNZ commented 4 years ago

@Cardo1 based on your example data, I believe I've fixed the issue in reading battery percentage and charging state. I can't do anything about the Home app display issue until the officially support it, but Home+ is looking good.

If you update to version 1.3.1 when you get a chance, and let me know how it goes.

IMG_9081 IMG_9082

Cardo1 commented 4 years ago

Working now. Thanks!

troygNZ commented 4 years ago

Cool thanks for confirming @Cardo1 - let me know how the charging state behaves when you get observe it draining, or becoming full etc. Once again I had to code it in theory, with no clear docs for their JSON payload.

Cardo1 commented 4 years ago

Cool thanks for confirming @Cardo1 - let me know how the charging state behaves when you get observe it draining, or becoming full etc. Once again I had to code it in theory, with no clear docs for their JSON payload.

I don’t seem to have any accessories showing battery charging state. Where am I meant to be looking?

troygNZ commented 4 years ago

Cool thanks for confirming @Cardo1 - let me know how the charging state behaves when you get observe it draining, or becoming full etc. Once again I had to code it in theory, with no clear docs for their JSON payload.

I don’t seem to have any accessories showing battery charging state. Where am I meant to be looking?

When using Home+ (paid product, don't worry about it if you don't have it already) - if you click on the battery, you can get details. May be able to get it with some of the other free alternatives live Eve?

image

Cardo1 commented 4 years ago

I have Home+, however the Apple Home app also shows “Charging”. I’ll check tomorrow when the sun’s out. I thought I was looking for charge rate!

troygNZ commented 4 years ago

Sorry for the confusion, yeah was simply referring to the "Charging" field. The only test input I've got so far is the sample you've given which has helped immensely.

Cardo1 commented 4 years ago

I can confirm the “Charging” field changes to “Yes” in the Home app and “Charging” in Home+ when the battery is charging.