batpred icon indicating copy to clipboard operation
batpred copied to clipboard

Pls add support for Foxess

Open rddelacosta opened this issue 1 year ago • 15 comments

Is your feature request related to a problem? Please describe. no

Describe the solution you'd like Please add support for Foxess

Describe alternatives you've considered n/a

Additional context n/a

rddelacosta avatar Apr 11 '24 12:04 rddelacosta

Hi,

This is very likely possible, but I'm afraid I don't own a Fox so I can't just add support with no details.

Do you have the battery integration into home assistant and if so are the control documented?

springfall2008 avatar Apr 12 '24 07:04 springfall2008

I'm about to set this integration up for a family member in the next few weeks: https://github.com/nathanmarlor/foxess_modbus - using the USB to RS485 adapter.

Happy to help with testing when I've got it up and running for them.

nickgee31 avatar Apr 12 '24 10:04 nickgee31

Hi,

This is very likely possible, but I'm afraid I don't own a Fox so I can't just add support with no details.

Do you have the battery integration into home assistant and if so are the control documented?

I integrated it via https://github.com/nathanmarlor/foxess_modbus. There is a similar integration for controlling charging but is better suited for octopus flux rather than octopus agile (https://github.com/nathanmarlor/foxess_em)

rddelacosta avatar Apr 12 '24 15:04 rddelacosta

I've had a go at setting this up with Predbat today but seem to be hitting a bit of a stumbling block. It starts the discharge from 23:10 and then appears to get stuck when trying to switch into charge mode at 23:30 with the error: Exception raised argument of type 'int' is not iterable.

I've attached the predbat.log and the apps.yaml that I've made which seems to work well. But clearly there is something wrong with what I've done!

predbat.log Apps.yaml - https://pastebin.com/LKPXYJHW

nickgee31 avatar Apr 19 '24 22:04 nickgee31

I've got this up and running now - https://pastebin.com/qvru4Csf

Created two number helpers as it seems to need to control the charge and discharge rate. In reality these two created helpers do nothing but they're just there to make it work.

nickgee31 avatar Apr 21 '24 18:04 nickgee31

If you set 'output_charge_control' to 'current' then it will control the charge/discharge using

timed_charge_current/timed_discharge_current entities configured in apps.yaml

Or if you set it to 'none' then it won't do either of these

springfall2008 avatar Apr 21 '24 19:04 springfall2008

Ah perfect will give that a go thanks! Not sure if this is specific to this or needs a general discussion but do you know how to stop the discharge during the day: Screenshot 2024-04-22 at 09 36 18 I would think it would be better to leave the discharge as late as possible in case the battery is needed. I've attached a couple of predbat logs in case it gives any insight. predbat.log predbat-1.log

nickgee31 avatar Apr 22 '24 08:04 nickgee31

@nickgee31 @springfall2008 thanks for your work for potentially supporting foxess!

Did you manage to sort out the issue re the discharging during the day?

rddelacosta avatar May 05 '24 21:05 rddelacosta

Hi both, thanks for these.

@springfall2008 I've managed to set this up - for the most part it works (will see if it charges actually), but I regularly encounter "Error: Exception raised 'NoneType' object has no attribute 'split'".

Pls see my setup here: https://pastebin.com/1UVtMwRB

Pls see log for predbat here: https://pastebin.com/hbbdjv5v

Also, for some reason when it force charged, only 41w was used to charge my batteries. Hence instead of c. 20% to c. 70%, my batteries were essentially uncharged even though it did charge. Any fix for this?

Hope you could please assist me on this.

Thanks

rddelacosta avatar Jun 25 '24 01:06 rddelacosta

I have set this up as well, following the advise here. I get error:- 2024-06-25 22:29:48.958387: Error: Exception raised can only concatenate str (not "NoneType") to str 2024-06-25 22:29:48.960012: Error: Traceback (most recent call last): File "/config/predbat.py", line 11002, in update_time_loop self.update_pred(scheduled=False) File "/config/predbat.py", line 10029, in update_pred self.record_status( File "/config/predbat.py", line 1613, in record_status self.call_notify("Predbat status change to: " + message + extra) File "/config/predbat.py", line 109, in call_notify self.call_service_wrapper("notify/" + device, message=message) TypeError: can only concatenate str (not "NoneType") to str

This was because I left Notify blank. Putting something in here (ie a valid Telegram Notifier), and it all seems to magically work (In Monitor Mode). I will leave it overnight and see what occurs...

icornish72 avatar Jun 25 '24 21:06 icornish72

Have you tried commenting the notify line out of apps.yaml rather than setting it to a blank entry?

gcoan avatar Jun 25 '24 21:06 gcoan

I may try that tomorrow - I'm going to let it run overnight, as I kinda like the plan (and the charging toggle seems to work!). Getting Notifications keeps me aware of what it might be doing...

icornish72 avatar Jun 25 '24 21:06 icornish72

I may try that tomorrow - I'm going to let it run overnight, as I kinda like the plan (and the charging toggle seems to work!). Getting Notifications keeps me aware of what it might be doing...

personally I too like the notifications so have never tried it without notifications off. Good luck !

gcoan avatar Jun 25 '24 21:06 gcoan

I have set this up as well, following the advise here. I get error:- 2024-06-25 22:29:48.958387: Error: Exception raised can only concatenate str (not "NoneType") to str 2024-06-25 22:29:48.960012: Error: Traceback (most recent call last): File "/config/predbat.py", line 11002, in update_time_loop self.update_pred(scheduled=False) File "/config/predbat.py", line 10029, in update_pred self.record_status( File "/config/predbat.py", line 1613, in record_status self.call_notify("Predbat status change to: " + message + extra) File "/config/predbat.py", line 109, in call_notify self.call_service_wrapper("notify/" + device, message=message) TypeError: can only concatenate str (not "NoneType") to str

This was because I left Notify blank. Putting something in here (ie a valid Telegram Notifier), and it all seems to magically work (In Monitor Mode). I will leave it overnight and see what occurs...

Mine is blank and it works - I get notifications from my mobile app

rddelacosta avatar Jun 26 '24 01:06 rddelacosta

Have figured out that for the foxes modbus integration, I should specify the charge rate (number.foxess_inverter_force_charge_power) and discharge rate (number.foxess_inverter_force_discharge_power). I've calculated mine using 20A x lower end of my battery's voltage (i.e., c. 2kw), but I think max ampere is like 50A and default is like 35A. I've updated the pastebin data above for these. @springfall2008 if I want predbat to calculate the charging curve, should I use the charge rates above or should I use the actual historical charge rate (including data when battery was charged by the solar panel)? Also, is there a way to specify the fixed max SOC (in kw)? I've tried adding a helper for soc_max but it didn't work as the SOC in the predbat plan ended up being constant. Thanks

rddelacosta avatar Jun 26 '24 01:06 rddelacosta

Is there any YAML file available that I can just copy and paste over to my own set up? The below Pastebin links now seem to have been removed.

Hi both, thanks for these.

@springfall2008 I've managed to set this up - for the most part it works (will see if it charges actually), but I regularly encounter "Error: Exception raised 'NoneType' object has no attribute 'split'".

Pls see my setup here: https://pastebin.com/1UVtMwRB

Pls see log for predbat here: https://pastebin.com/hbbdjv5v

Also, for some reason when it force charged, only 41w was used to charge my batteries. Hence instead of c. 20% to c. 70%, my batteries were essentially uncharged even though it did charge. Any fix for this?

Hope you could please assist me on this.

Thanks

letsstartbeinganon avatar Aug 21 '24 21:08 letsstartbeinganon

I believe this is now documented, please review and raise a ticket for any new updates

springfall2008 avatar Sep 01 '24 16:09 springfall2008