fboundy / pv_opt

Home Assistant PV Optimisation for Solis Inverters
MIT License
19 stars 3 forks source link

Independent minimum SoC level for pv_opt, to prevent Inverter becoming idle #216

Closed punkymuzzle closed 47 minutes ago

punkymuzzle commented 1 month ago

Is your feature request related to a problem? Please describe. Currently working with the dev on Solax X1 AC integration, which is going well. Link to thread Here

When pv_opt is setting a charging schedule overnight, and the start SoC is 10% (default for the inverter), the inverter is going idle before the charging schedule is being written to it. Pv_opt seems to delay writing the charging schedule until just before the charging slot, but by that time the inverter has discharged to it's minimum (10%) and has become idle, thereby not accepting any modbus writes to charge. I have tried to fix this by running an automation in HA to change the mode to "backup mode" when SoC is 13% or lower, but HA overwrites this and I have a battle between it and the automation and I see it flip-flopping between "Backup mode" and "Self use Mode" but with no charging times. image

Here's what is set for tonight - based on previous experience this will fail: image

As a work around last night, I had to change the pv_opt status to read only, then set a charging schedule through the Solax app so it charged overnight; then re-enable pv_opt this morning. Whilst it is possible to continue this way, it's not manageable long term and defeats the object of an automatic charging approach.

Describe the solution you'd like There are a number of ways to fix this (send the charge plan to the inverter earlier, send the "wake up" command to the inverter prior to setting the charge etc) but I think the easiest way would be to have a setting where we can set the minimum SoC that pv_opt uses. Then, as this SoC is reached, pv_opt sends a command to the inverter to stop it discharging, thereby staying above the 10% level and preventing the inverter becoming idle. In my case above, when it reached 13% it would stop discharging and would remain active so pv_opt could write the next charge for 03:00 - 05:00

Describe alternatives you've considered Alternatives as above, and part of the link above.

Additional context

Automation:

alias: Keep Inverter and battery from going idle ver 2 description: Keep Inverter and battery from going idle trigger:

  • platform: time_pattern minutes: /10 condition:
  • condition: sun before: sunrise after: sunset
  • condition: numeric_state entity_id: sensor.solax_battery_soc below: 13 action:
  • device_id: 5eced548962c60b81bd3a91b8a392f41 domain: select entity_id: e8f01dbc8553c8261d0b33d05550d36b type: select_option option: Back Up Mode mode: single
fboundy commented 1 month ago

Been busy with other things but will look at this as soon as I can

punkymuzzle commented 1 month ago

Awesome, thank you

punkymuzzle commented 3 weeks ago

Hi, any update on this please? Thank you very much

silverhouse3 commented 3 weeks ago

@punkymuzzle do you have example of your files as I've got an X1 and its just a bunch of errors on the dashboard 😁

punkymuzzle commented 3 weeks ago

@silverhouse3 there are a couple of (long) threads which should contain most of what you need: https://github.com/fboundy/pv_opt/issues/149 https://github.com/fboundy/pv_opt/issues/188

I have been working with @fboundy to get the X1AC working with pv_opt. It's mostly working now (thanks to @fboundy 's awesome programming skills), the only outstanding issues I have are:

  1. When the inverter discharges to 10% SoC it goes idle so pv_opt can't write to it (enhancement https://github.com/fboundy/pv_opt/issues/216 raised)
  2. No way of ringfencing my 16:00 - 19:00 peak slot so the batteries are guaranteed full just before the peak time is reached (no official request yet, will need to raise this)

Hope this helps - let me know if you need anything further after reading the above links.

punkymuzzle commented 2 weeks ago

Hi, any update on this please? Thank you very much

fboundy commented 1 week ago

Finally found time tio have a look at this. Would it help to have a "Wake-Up SOC" parameter so that PV-Opt always tries to keep the SOC above this level?

punkymuzzle commented 1 week ago

Sure, what do you need from me?

On Mon, 20 May 2024, 16:24 fboundy, @.***> wrote:

Finally found time tio have a look at this. Would it help to have a "Wake-Up SOC" parameter so that PV-Opt always tries to keep the SOC above this level?

β€” Reply to this email directly, view it on GitHub https://github.com/fboundy/pv_opt/issues/216#issuecomment-2120683036, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNR352XHKCZKWMMXTNVA7LZDIITJAVCNFSM6AAAAABGW2JO5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRQGY4DGMBTGY . You are receiving this because you were mentioned.Message ID: @.***>

punkymuzzle commented 1 week ago

Yes that sounds great. We could either have it automatically be a couple of % above the minimum SOC level that you set, or just a manual figure that can be set. My minimum SOC is 10% so I always try to keep it 2% higher using an automation, but PV-opt always changes the Inverter state back to self use so it eventually discharges to 10% (and then goes idle) Thank you

On Mon, 20 May 2024, 16:24 fboundy, @.***> wrote:

Finally found time tio have a look at this. Would it help to have a "Wake-Up SOC" parameter so that PV-Opt always tries to keep the SOC above this level?

β€” Reply to this email directly, view it on GitHub https://github.com/fboundy/pv_opt/issues/216#issuecomment-2120683036, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNR352XHKCZKWMMXTNVA7LZDIITJAVCNFSM6AAAAABGW2JO5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRQGY4DGMBTGY . You are receiving this because you were mentioned.Message ID: @.***>

fboundy commented 1 week ago

So what happens if you just set the maximum depth of discharge to 12% in the config.yaml? On 21 May 2024 at 06:27 +0100, punkymuzzle @.***>, wrote:

Yes that sounds great. We could either have it automatically be a couple of % above the minimum SOC level that you set, or just a manual figure that can be set. My minimum SOC is 10% so I always try to keep it 2% higher using an automation, but PV-opt always changes the Inverter state back to self use so it eventually discharges to 10% (and then goes idle) Thank you

On Mon, 20 May 2024, 16:24 fboundy, @.***> wrote:

Finally found time tio have a look at this. Would it help to have a "Wake-Up SOC" parameter so that PV-Opt always tries to keep the SOC above this level?

β€” Reply to this email directly, view it on GitHub https://github.com/fboundy/pv_opt/issues/216#issuecomment-2120683036, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNR352XHKCZKWMMXTNVA7LZDIITJAVCNFSM6AAAAABGW2JO5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRQGY4DGMBTGY . You are receiving this because you were mentioned.Message ID: @.***>

β€” Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

punkymuzzle commented 1 week ago

Ooooh I wasn't aware of that setting πŸ™‚. I've now changed it and the next charging cycle (which was originally starting from 10%) has now recalcated to start from 12%. So hopefully this will fix my issue. Will let you know tomorrow once the charge cycle has completed. Thanks for your help.

On Thu, 23 May 2024, 08:21 fboundy, @.***> wrote:

So what happens if you just set the maximum depth of discharge to 12% in the config.yaml? On 21 May 2024 at 06:27 +0100, punkymuzzle @.***>, wrote:

Yes that sounds great. We could either have it automatically be a couple of % above the minimum SOC level that you set, or just a manual figure that can be set. My minimum SOC is 10% so I always try to keep it 2% higher using an automation, but PV-opt always changes the Inverter state back to self use so it eventually discharges to 10% (and then goes idle) Thank you

On Mon, 20 May 2024, 16:24 fboundy, @.***> wrote:

Finally found time tio have a look at this. Would it help to have a "Wake-Up SOC" parameter so that PV-Opt always tries to keep the SOC above this level?

β€” Reply to this email directly, view it on GitHub https://github.com/fboundy/pv_opt/issues/216#issuecomment-2120683036,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACNR352XHKCZKWMMXTNVA7LZDIITJAVCNFSM6AAAAABGW2JO5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRQGY4DGMBTGY>

. You are receiving this because you were mentioned.Message ID: @.***>

β€” Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

β€” Reply to this email directly, view it on GitHub https://github.com/fboundy/pv_opt/issues/216#issuecomment-2126404161, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNR353EDCJ6KRALCL2M3M3ZDWKHVAVCNFSM6AAAAABGW2JO5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRWGQYDIMJWGE . You are receiving this because you were mentioned.Message ID: @.***>

punkymuzzle commented 1 week ago

OK it did t work unfortunately. The charging schedule calculated from 12 percent but there wasn't anything to stop the battery discharging down to 10, so it went idle again. Is there any way that PV opt can send a setting to the Inverter to stop discharging at 12pc? Backup mode? Or better still, send the next charging times to the Inverter before it goes idle, that would be preferable, as the Inverter then remembers it even if it goes idle.

Thanks very much for your help

On Thu, 23 May 2024, 09:16 Steve Bond, @.***> wrote:

Ooooh I wasn't aware of that setting πŸ™‚. I've now changed it and the next charging cycle (which was originally starting from 10%) has now recalcated to start from 12%. So hopefully this will fix my issue. Will let you know tomorrow once the charge cycle has completed. Thanks for your help.

On Thu, 23 May 2024, 08:21 fboundy, @.***> wrote:

So what happens if you just set the maximum depth of discharge to 12% in the config.yaml? On 21 May 2024 at 06:27 +0100, punkymuzzle @.***>, wrote:

Yes that sounds great. We could either have it automatically be a couple of % above the minimum SOC level that you set, or just a manual figure that can be set. My minimum SOC is 10% so I always try to keep it 2% higher using an automation, but PV-opt always changes the Inverter state back to self use so it eventually discharges to 10% (and then goes idle) Thank you

On Mon, 20 May 2024, 16:24 fboundy, @.***> wrote:

Finally found time tio have a look at this. Would it help to have a "Wake-Up SOC" parameter so that PV-Opt always tries to keep the SOC above this level?

β€” Reply to this email directly, view it on GitHub https://github.com/fboundy/pv_opt/issues/216#issuecomment-2120683036,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACNR352XHKCZKWMMXTNVA7LZDIITJAVCNFSM6AAAAABGW2JO5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRQGY4DGMBTGY>

. You are receiving this because you were mentioned.Message ID: @.***>

β€” Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

β€” Reply to this email directly, view it on GitHub https://github.com/fboundy/pv_opt/issues/216#issuecomment-2126404161, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNR353EDCJ6KRALCL2M3M3ZDWKHVAVCNFSM6AAAAABGW2JO5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRWGQYDIMJWGE . You are receiving this because you were mentioned.Message ID: @.***>

fboundy commented 1 week ago

Ok - the latter might me easier. Will try to find some time over the weekend to implement it. On 24 May 2024 at 11:45 +0100, punkymuzzle @.***>, wrote:

OK it did t work unfortunately. The charging schedule calculated from 12 percent but there wasn't anything to stop the battery discharging down to 10, so it went idle again. Is there any way that PV opt can send a setting to the Inverter to stop discharging at 12pc? Backup mode? Or better still, send the next charging times to the Inverter before it goes idle, that would be preferable, as the Inverter then remembers it even if it goes idle.

Thanks very much for your help

On Thu, 23 May 2024, 09:16 Steve Bond, @.***> wrote:

Ooooh I wasn't aware of that setting πŸ™‚. I've now changed it and the next charging cycle (which was originally starting from 10%) has now recalcated to start from 12%. So hopefully this will fix my issue. Will let you know tomorrow once the charge cycle has completed. Thanks for your help.

On Thu, 23 May 2024, 08:21 fboundy, @.***> wrote:

So what happens if you just set the maximum depth of discharge to 12% in the config.yaml? On 21 May 2024 at 06:27 +0100, punkymuzzle @.***>, wrote:

Yes that sounds great. We could either have it automatically be a couple of % above the minimum SOC level that you set, or just a manual figure that can be set. My minimum SOC is 10% so I always try to keep it 2% higher using an automation, but PV-opt always changes the Inverter state back to self use so it eventually discharges to 10% (and then goes idle) Thank you

On Mon, 20 May 2024, 16:24 fboundy, @.***> wrote:

Finally found time tio have a look at this. Would it help to have a "Wake-Up SOC" parameter so that PV-Opt always tries to keep the SOC above this level?

β€” Reply to this email directly, view it on GitHub https://github.com/fboundy/pv_opt/issues/216#issuecomment-2120683036,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACNR352XHKCZKWMMXTNVA7LZDIITJAVCNFSM6AAAAABGW2JO5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRQGY4DGMBTGY>

. You are receiving this because you were mentioned.Message ID: @.***>

β€” Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

β€” Reply to this email directly, view it on GitHub https://github.com/fboundy/pv_opt/issues/216#issuecomment-2126404161, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNR353EDCJ6KRALCL2M3M3ZDWKHVAVCNFSM6AAAAABGW2JO5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRWGQYDIMJWGE . You are receiving this because you were mentioned.Message ID: @.***>

β€” Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

punkymuzzle commented 1 week ago

Awesome, thank you very much

On Fri, 24 May 2024, 12:06 fboundy, @.***> wrote:

Ok - the latter might me easier. Will try to find some time over the weekend to implement it. On 24 May 2024 at 11:45 +0100, punkymuzzle @.***>, wrote:

OK it did t work unfortunately. The charging schedule calculated from 12 percent but there wasn't anything to stop the battery discharging down to 10, so it went idle again. Is there any way that PV opt can send a setting to the Inverter to stop discharging at 12pc? Backup mode? Or better still, send the next charging times to the Inverter before it goes idle, that would be preferable, as the Inverter then remembers it even if it goes idle.

Thanks very much for your help

On Thu, 23 May 2024, 09:16 Steve Bond, @.***> wrote:

Ooooh I wasn't aware of that setting πŸ™‚. I've now changed it and the next charging cycle (which was originally starting from 10%) has now recalcated to start from 12%. So hopefully this will fix my issue. Will let you know tomorrow once the charge cycle has completed. Thanks for your help.

On Thu, 23 May 2024, 08:21 fboundy, @.***> wrote:

So what happens if you just set the maximum depth of discharge to 12% in the config.yaml? On 21 May 2024 at 06:27 +0100, punkymuzzle @.***>, wrote:

Yes that sounds great. We could either have it automatically be a couple of % above the minimum SOC level that you set, or just a manual figure that can be set. My minimum SOC is 10% so I always try to keep it 2% higher using an automation, but PV-opt always changes the Inverter state back to self use so it eventually discharges to 10% (and then goes idle) Thank you

On Mon, 20 May 2024, 16:24 fboundy, @.***> wrote:

Finally found time tio have a look at this. Would it help to have a "Wake-Up SOC" parameter so that PV-Opt always tries to keep the SOC above this level?

β€” Reply to this email directly, view it on GitHub < https://github.com/fboundy/pv_opt/issues/216#issuecomment-2120683036>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ACNR352XHKCZKWMMXTNVA7LZDIITJAVCNFSM6AAAAABGW2JO5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRQGY4DGMBTGY>

. You are receiving this because you were mentioned.Message ID: @.***>

β€” Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

β€” Reply to this email directly, view it on GitHub https://github.com/fboundy/pv_opt/issues/216#issuecomment-2126404161,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACNR353EDCJ6KRALCL2M3M3ZDWKHVAVCNFSM6AAAAABGW2JO5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRWGQYDIMJWGE>

. You are receiving this because you were mentioned.Message ID: @.***>

β€” Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

β€” Reply to this email directly, view it on GitHub https://github.com/fboundy/pv_opt/issues/216#issuecomment-2129263081, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNR355MPKGSHNQFTUYEVGDZD4NL7AVCNFSM6AAAAABGW2JO5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRZGI3DGMBYGE . You are receiving this because you were mentioned.Message ID: @.***>

punkymuzzle commented 4 days ago

Hi Is there any update on this please? Thanks very much

fboundy commented 2 hours ago

Should be fixed in 3.14.10. You’ll need to add sleep_soc: 15 (for example) to your config.yaml On 29 May 2024 at 10:39 +0100, punkymuzzle @.***>, wrote:

Hi Is there any update on this please? Thanks very much β€” Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

punkymuzzle commented 2 hours ago

You are a star, thank you very much.for your help I'll set it up and monitor tonight. Thanks again

On Sun, 2 Jun 2024, 13:50 fboundy, @.***> wrote:

Should be fixed in 3.14.10. You’ll need to add β€˜sleep_soc: 15’ (for example) to your config.yaml On 29 May 2024 at 10:39 +0100, punkymuzzle @.***>, wrote:

Hi Is there any update on this please? Thanks very much β€” Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

β€” Reply to this email directly, view it on GitHub https://github.com/fboundy/pv_opt/issues/216#issuecomment-2143840730, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNR35ZMSW6W6XVWYXGDJKDZFMIKVAVCNFSM6AAAAABGW2JO5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBTHA2DANZTGA . You are receiving this because you were mentioned.Message ID: @.***>