-
Notifications
You must be signed in to change notification settings - Fork 33
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
Solax Inverters #259
Comments
I’m working on support for Solis inverters which use the same integration. I’m hopeful that it’s nearly there but to support the Solax as well will require some additional information.
Once I have the Solis version working I’ll get in touch about Solax
…On 4 Nov 2023 at 21:53 +0000, Bart39 ***@***.***>, wrote:
Splitting this out to separate request.
Please add support for Solax inverters.
I use https://github.com/wills106/homeassistant-solax-modbus for HA integration (also supports other brands of inverters)
As I have an X1 gen 4 inverter https://github.com/wills106/homeassistant-solax-modbus/wiki/Modbus-Power-Control-(remotecontrol-power) is the preferred method as it avoids excessive writes to eeprom
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Perfect, many thanks |
OK - I think I'm getting there. What I first need to add Solax is for you to try to edit the config.yaml file with the entities you would use for a Solax inverter and then to comment any that are different. Then can you answer the following:
There's probably more but that would be a decent start! |
Thanks, will do (I have it already working in read only mode) |
OK - so I think I have BatPred working with the Solis. To get the Solax working, in addition to the above we need Constants
Entity IDs for the following sensors:Cumulative Daily Energy
Current Power / Battery Readings
Others
Entity IDs for the Modbus Power Control EntitiesI think I can get all of these from here but no harm to confirm them. |
Sorry it took a while as work has been crazy Constants
Cumulative Daily Energy
Current Power / Battery Readings
Others
Entity IDs for the Modbus Power Control Entities Set Mode
I prefer using battery control to charge, No discharge for charge freeze, and grid control for export Set Active Power (Watts - positive charge, negative discharge)
Set Autorepeat duration (seconds)
Main button press to start the selected mode with the active power for the specified duration
|
That’s fine I’ve been busy with other stuff anyway.
Will try to have a look at this over the next week
…On 12 Nov 2023 at 14:22 +0000, Bart39 ***@***.***>, wrote:
Sorry it took a while as work has been crazy
Constants
• Battery capacity in kWh
• 9.3
• Max Battery Power
• 6100w
• Max Inverter Power (if different from Battery)
• 6100w
Cumulative Daily Energy
• Load today in kWh (resetting daily)
• sensor.solax_today_house_load (utility helper as there is no daily total load from the inverter)
• Import today in kWh (resetting daily)
• sensor.solax_today_s_import_energy
• Export today in kWh (resetting daily)
• sensor.solax_today_s_export_energy
• PV Generation today in kWh (resetting daily)
• sensor.solax_today_s_solar_energy
Current Power / Battery Readings
• Battery power
• sensor.solax_battery_power_charge
• PV power
• sensor.solax_pv_power_total
• Load power
• sensor.solax_house_load
• Battery SOC (%)
• sensor.solax_battery_capacity
Others
• Inverter clock (if available) - if so let me know the format it reports in
• sensor.solax_rtc (disabled by default due to the constant updates)
• YYYY-MM-DD HH24:MI:SS
Entity IDs for the Modbus Power Control Entities
Set Mode
select.solax_remotecontrol_power_control
• > "Disabled",
• > "Enabled Power Control",
• > "Enabled Grid Control",
• > "Enabled Battery Control",
• > "Enabled Self Use",
• > "Enabled Feedin Priority"
• > "Enabled No Discharge"
• When remotecontrol_power_control = Enabled Power Control is chosen, the target value refers to the battery interface where positive values will cause batteries to charge, negative values will make the batteries discharge. When the target is set to zero, in the presence of PV, the PV will go to the battery, the house load will come from the grid. If in addition to selecting this mode, remote_control_import_limit is set to Zero, the house load will come from PV and battery only. Enabled Power Control is the basic mode offered by solax, it allows us to specify activepower directly, but the notion activepower may be difficult to understand, so grid control and battery control may be easier to understand.
• When remotecontrol_power_control = Enabled Grid Control is chosen, the target value refers to the grid interface where positive values mean import, negative values mean export. When using this mode, make sure that remotecontrol_import_limit is set to a high enough value so that the import target can be reached.
• When remotecontrol_power_control = Enabled Battery Control is chosen, the target value refers to the battery interface where positive values mean charge, negative values mean discharge. If target is set to zero, excess PV power will be sent to the grid.
• NEW: When remotecontrol_power_control = Enabled Self Use is chosen, the target value is ignored and the system will emulate the standard self-use mode for the specified (autorepeat) duration. This mode may not be as accurate/responsive as the builtin self_use mode.
• NEW: When remotecontrol_power_control = Enabled Feedin Priority is chosen, the target value is ignored and the system will emulate the standard feedin-priority mode for the specified (autorepeat) duration. This mode may not be as accurate/responsive as the builtin feedin_priority mode.
• NEW: When remotecontrol_power_control = Enabled No Discharge is chosen, the target value is ignored and the system will make sure that the battery does not discharge. Houseload will be provided by PV, and when PV is insufficient, from Grid.
I prefer using battery control to charge, No discharge for charge freeze, and grid control for export
Set Active Power (Watts - positive charge, negative discharge)
• number.solax_remotecontrol_active_power
Set Autorepeat duration (seconds)
• number.solax_remotecontrol_autorepeat_duration
Main button press to start the selected mode with the active power for the specified duration
• button.solax_remotecontrol_trigger
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Hey, I have a Solax system and use the same integration to control it. Anything a layperson can do to support at this stage? |
@nikotime the work so far has been pushed to main including the template configuration and the code. Maybe you can give it a try and feedback? |
Sorry @Bart39 , could you please share how you set up the utility sensor for total daily load? I've been struggling and getting some wildly wrong numbers!
|
There's a sample template sensor in the predbat docs for calculating house load https://springfall2008.github.io/batpred/config-yml-settings/#data-from-givtcp as I have two GivEnergy inverters and as they share the load between them, I found I couldn't use the inbuilt entities. You should be able to follow this approach for your inverter |
Sorry have been busy and not spotted this
|
@fboundy any progress on solax modbus control ? |
Sorry but my attention has been elsewhere. Have a look at https://github.com/fboundy/pv_opt which attempts to do much the same as PredBat but with a more open API for other inverters
…On 19 Jan 2024 at 19:29 +0000, Bart39 ***@***.***>, wrote:
@fboundy any progress on solax modbus control ?
If this is proving tricky or doesn't really fit with the other supported inverters @springfall2008 would it be worth considering exposing some sensors for the charging/discharging mode, power / Soc limits, start/end times etc ?
That way it would universally support any inverter that can be controlled through HA via our own automations
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Just got PV OPT set up with my Solax inverter and is now in read only mode :) I used the SOLIS_SOLAX_MODBUS inverter type and only had to make the following changes:
Big thing I guess relates to Bart's point earlier that PV OPT also seems to just work with this concept of timed_charge and discharge which doesn't exist in Solax. Need to configure the graphs etc and get more history for house load and then will look into GUI Automations to trigger changes to forced charge and forced discharge. You rock @fboundy |
I did release the solax code for Predbat also so I think it’s usable but I can’t test it myself. |
In read only it looks to work really well, just can't use it to control the charge / discharge as solax doesn't support a timed charge /discharge |
Timed charge should work as predbat has an immediate mode where it forces charging on and off at the correct times |
@springfall2008 I'm so sorry would you mind linking to the released Solax code in the github which supports the immediate mode? I've been trying to find how to change the Solis integration to use 'Modbus Power Control Mode' as per https://github.com/springfall2008/batpred/blob/c1d5d7087b927a4060ac36cfbf730bfc18ecfc1c/docs/other-inverters.md but can't see that option in the ginlong_solis.yaml or anything solax specific through searching through the repo. |
Sorry I’ve been a bit distracted, the code lists it as “SX4” which when enabled will use power control |
I can definitely try and help with that! Firstly I needed to create house load which was kindly provided by other clever people - I just have this in configuration.yaml:
apps.yaml settings I used (ps my intergration is called solaxmodbus rather than solax as default):
Then the problem I experienced was with the control. I tried:
But no luck, down to not enabling SX4 but I now can't find anything relating to SX4 in Github either 😅 |
Have you tried setting: inverter_type: "SX4" This should change the controls to be more suitable. Can you clarify how Predbat should start/stop charges and forced export? |
What would be good is if you can share an automation that charges the battery and one that exports it |
I will try changing inverter type hopefully tomorrow and see if it works (if my baby sleeps enough to buy me time!) For now here are my automations to force charge.
And discharge is exactly the Same as above but select option Force Discharge This is my code to reset it to normal after
|
I have just tried setting it as SX4 and get: Here it is the full log: https://pastebin.com/QfzNFpPs Can confirm read only mode still works and I get the full Predbat plan. Let me know if there are more detailed logs I can pull! |
For the error you probably need to capture the stack trace from 'settings, system, logs, appdeamon' so I can see what causes it. Taking a step back can you share your apps.yaml so far so I know what you have configured? |
Sure, thanks! Apps.yaml: https://pastebin.com/Ser82dSC And here is the stack trace:
|
Hi Many thanks in advance |
I'm not sure were @nikotime got with this, I kind of lost track. @punkymuzzle what is currently in your apps.yaml for Solax? If you have an automation example to start/stop charge we can use the service feature in apps.yaml to trigger it. |
See the end of this page on unsupported inverter types: https://springfall2008.github.io/batpred/other-inverters/ |
Hey! Where we got to I believe is that something was up with my apps.yaml as I was getting errors, so i shared my file and the error log. I have been able to build automations relying on a helper which spits out true or false (shared a few of my comments ago) if we are currently in the time set by predbat.best_charge_start but failed to get any further to let predbat control the inverter directly. The logic of reading all my solaxmodbus sensors to build out the plans works perfectly well though! |
Can you share your apps.yaml so far ? |
@springfall2008 no worries it’s here https://pastebin.com/Ser82dSC and have the stack trace above too |
This bit isn't correctly indented YAML: # Some inverters don't turn off when the rate is set to 0, still charge or discharge at around 200w
# The value can be set here in watts to model this (doesn't change operation)
inverter_battery_rate_min:
- 100 it should be: # Some inverters don't turn off when the rate is set to 0, still charge or discharge at around 200w
# The value can be set here in watts to model this (doesn't change operation)
inverter_battery_rate_min:
- 100 Two indented spaces before the dash This may be throwing the rest of the YAML file off. The export triggers also look to have too many spaces (3 or 4 rather than 2), but I don't think that's the issue |
|
@springfall2008 Amazing thanks. I just gave it a quick go and the error message went a way, the status is at Idle or turned to charging when I force charged but my batteries alas didn't charge. Going to have another look tomorrow to try and see why (if any entities change at all) and no errors sprung out the log that I saw, but will share logs properly when I give myself more time too. |
Have looked a little more. When I first change from read only mode I get an strptime error from inverter.adjust_charge_window(charge_start_time, charge_end_time, self.minutes_now) so guessing one of those entities isn't working (not sure how to check!). Log below
After leaving it for 5 minutes it then turns to Idle: And then allows me to try and charge. When I try and charge I get no errors other than the above strptime one appearing again and 'solaxmodbus_charger_use_mode' does not change from Self Use Mode to Manual Mode. These are the general logs
and again the stack trace logs:
So seems like something to do with that inverter.adjust_charge_window function! EDIT: And is probably a limitation of Solax to give you the present time. Solax seems to break when the time sensor is enabled so I pulled in a separate sensor just doing
This seems like it was a mistake.... |
This appears to relate to: charge_discharge_update_button: Where its expecting that this entity returns a time that it was last pressed. Your error indicates the sensor returned None, is this linked to anything or maybe the name is wrong? |
@springfall2008 Ah I must have forgotten to comment that one out/change it. I am not aware of anything in Solax that does directly that, but there is Errors:
|
Hey @springfall2008 , sorry me again! I saw you did a Predbat update which included Fixes for Solax so gave it another go. The errors in my last post are now completely gone, which is great, but unfortunately the batteries are still not charging or discharging. I do receive a warning which relates to the charge_discharge_update_button. I have tested button.solaxmodbus_sync_rtc, button.solaxmodbus_remotecontrol_trigger (which relates to Bart's post much earlier) but non seem to have any effect. @Bart39 Would you be able to give it a go on your system in its present state to make sure its not just me with the issues? My apps.yaml relates to Bart's post to here using remotecontrol_power_control. My manual automations work but do so a little differently to that post. I instead change select.solaxmodbus_charger_use_mode to 'Manual Mode' and select.solaxmodbus_manual_mode_select to 'Force Charge' or 'Force Discharge' depending on a Read Only use of Predbat tells me what to do. Not sure if that is helpful, another option, or just simply noise! |
I'm seeing the same error reported regarding the button.solis_update_charge_discharge_times: When I manually schedule charge/discharge, I adjust the times and then 'press' this button to save them. Unless the button is pressed within about a minute, the times revert to previous values. I guess Predbat is trying to do the same, but whatever test is used to confirm the button press is failing. It looks like the button 'press' worked fine: |
I did some digging and noticed that batpred/apps/predbat/predbat.py Line 3924 in 74b32a3
I changed it to the following and the error is gone:
|
Amazing! Does it control your charge and discharge now following that change ? |
It set the end discharge time and successfully presses the button to commit it, but then it sets the inverter mode to one where it doesn't apply the timed charge/discharge--so nothing happens. When I change it back to "Self-use" the discharge started, but Batpred switched it back almost immediately and the discharge stopped. I'm taking a look at the logic that changes the switch setting. For my personal set-up, I don't think the switch needs to change -- self-use will charge or discharge based on the timers, and if the timers are blank it defaults to charging from solar and supporting the house load. So I may as well leave it on self-use. |
batpred/apps/predbat/predbat.py Lines 3626 to 3627 in 74b32a3
I changed the above to force the test to fail, bypassing the code that chances the switch, I manually set the inverter control switch to "Self-Use" and it has successfully begun discharging the battery to Batpred's plan. My inverter is a Solis RHI-6K-48ES-5G hybrid inverter with a stack of Pylontech US3000C batteries. I'll take a look at a proper fix when I get back from vacation: I would like Batpred to control the switch to ensure it can correct it if an invalid manual choice was made by the user. |
I think force discharge is the only way to send the power back to the grid though? Timed discharge just lets the house draw from the battery between the set times. I've got this working with automations to switch manual mode accordingly and back to self use. Like above. It seems to be working well. |
Mine is set to "Self-Use" and happily discharging to the grid whenever it falls within a configured timed discharge. But it's possible that different models behave differently :-/ There is one gotcha: it does not discharge when a timed discharge overlaps with a timed charge. |
Last night’s schedule failed to work because the end time was overlapping the start time of the following window. Discharge was scheduled to end at 00:01 and charge to start at 00:00. As a result, the inverter did neither. As a test, I changed the discharge end-time manually to 00:00 and the inverter sprang to life. |
Hey @DougManton , was wondering whether you had made any more progress here ? :) would be fab to get this up and running in an official capacity |
Splitting this out to separate request.
Please add support for Solax inverters.
I use https://github.com/wills106/homeassistant-solax-modbus for HA integration (also supports other brands of inverters)
As I have an X1 gen 4 inverter https://github.com/wills106/homeassistant-solax-modbus/wiki/Modbus-Power-Control-(remotecontrol-power) is the preferred method as it avoids excessive writes to eeprom
The text was updated successfully, but these errors were encountered: