dxoverdy / Alpha2MQTT

A smart home interface for AlphaESS solar and battery inverters.
GNU General Public License v3.0
41 stars 6 forks source link

Discharge mode #6

Closed jt1971 closed 5 months ago

jt1971 commented 1 year ago

Hi. I've been really impressed with the alpha2mqtt, both hardware and the software. I have mine connected to HA and have therefore used your excellent yaml code for the mqtt and the controls. Everything is working fine other than:

  1. With the exception of the charge mode, 'Dispatch mode' always states 'unknown' (the ModBus arduino code is reporting 'unknown'
  2. If I try to select discharge mode (to dump excess battery charge into the car for example), although the response status says 'setDischargeStatus' and and '0' for failure detail, the dispatch power does not budge from 32000W and other parameters in the Information entity box remain unchanged.

I'm not entirely sure how I can diagnose further. HA is sending out the correct mqtt message as far as I can tell (using MQTT explorer on my Mac).

Apologies if a bit of a lame question, but I'm not sure how to progress to resolve this?

Thanks!

ettiennecoetzee commented 6 months ago

Hi, mine says the same. What inverter do you have?

ettiennecoetzee commented 6 months ago

My discharge mode on the Smile G3S5 is also not working. I set the target soc and max dc wattage and 2 hour time span, but no discharge. Let me know if I can share specific details so that you can trouble shoot? @dxoverdy

dxoverdy commented 6 months ago

I’ve no idea what could be causing this as the steps are the same. But I’m thinking it may be down to the current regulation set in the system.

Can you read out regulation please and let me know what it is?

On Mon, 8 Jan 2024 at 13:33, Ettienne Coetzee @.***> wrote:

My discharge mode on the Smile G3S5 is also not working. I set the target soc and max dc wattage and 2 hour time span, but no discharge. Let me know if I can share specific details so that you can trouble shoot? @dxoverdy https://github.com/dxoverdy

— Reply to this email directly, view it on GitHub https://github.com/dxoverdy/Alpha2MQTT/issues/6#issuecomment-1881015561, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZC7OYMWHWZLCNUAMSCXZNDYNPYSDAVCNFSM6AAAAAAVK5DXOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBRGAYTKNJWGE . You are receiving this because you were mentioned.Message ID: @.***>

ettiennecoetzee commented 6 months ago

Where can I find that?

dxoverdy commented 6 months ago

Read out via handled register 0x1000

define REG_SAFETY_TEST_RW_GRID_REGULATION 0x1000

I’m wondering if your inverter is set to a grid regulation which doesn’t currently (or suggests) it doesn’t allow discharge.

Please let me know the return value and description. Mine for example is 16 / G99

On Mon, 8 Jan 2024 at 15:52, Ettienne Coetzee @.***> wrote:

Where can I find that?

— Reply to this email directly, view it on GitHub https://github.com/dxoverdy/Alpha2MQTT/issues/6#issuecomment-1881320003, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZC7OYIQSTMAA2PWDZTZGRLYNQI2PAVCNFSM6AAAAAAVK5DXOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBRGMZDAMBQGM . You are receiving this because you were mentioned.Message ID: @.***>

ettiennecoetzee commented 6 months ago

Data value: 10 Formatted: NRS097-2-1 Function code:3 Raw data: [0,10]

dxoverdy commented 6 months ago

Send four separate MQTT messages to this topic: Alpha2MQTT/request/write/register/raw/data

-- Dispatch Start { "registerAddress": "0x0880", "dataBytes": 2, "value": 1 }

-- Power (1000W discharge) { "registerAddress": "0x0881", "dataBytes": 4, "value": 33000 }

-- Time (Just two 2 minutes) { "registerAddress": "0x0887", "dataBytes": 4, "value": 120 }

-- SOC (down to 15%) 15 / 0.4 = 37.5, so 38 will do { "registerAddress": "0x0886", "dataBytes": 2, "value": 38 }

-- Mode - SOC Control (2) { "registerAddress": "0x0885", "dataBytes": 2, "value": 2 }

You don't have to rush them. Allow a few seconds before each, allowing plenty of time for copy and paste. I am wondering if pinging the four steps required to activate discharge (Start Dispatch, Set Power, Set Duration, Set Minimum SOC and Set Mode) if issued separately works. If it does that would suggest when Alpha2MQTT sends the messages, it is sending them all too quickly.

ettiennecoetzee commented 6 months ago

Done. No discharge.

This is what my Alpha Control Dash looks like: image

dxoverdy commented 6 months ago

Whoahh that percentage needs a bit of work. What is your battery percentage currently (proper) and why is battery power zero?

On Mon, 8 Jan 2024 at 18:20, Ettienne Coetzee @.***> wrote:

Done. No discharge.

This is what my Alpha Control Dash looks like: image.png (view on web) https://github.com/dxoverdy/Alpha2MQTT/assets/53652614/1987e12c-03b5-4952-87c6-be4d589b5de6

— Reply to this email directly, view it on GitHub https://github.com/dxoverdy/Alpha2MQTT/issues/6#issuecomment-1881601286, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZC7OYJP3BY6ZTMLBPPTVHLYNQ2GLAVCNFSM6AAAAAAVK5DXOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBRGYYDCMRYGY . You are receiving this because you were mentioned.Message ID: @.***>

dxoverdy commented 6 months ago

Does the same set of commands, albeit with 31000 power start charging at 1000W?

On Mon, 8 Jan 2024 at 18:20, Ettienne Coetzee @.***> wrote:

Done. No discharge.

This is what my Alpha Control Dash looks like: image.png (view on web) https://github.com/dxoverdy/Alpha2MQTT/assets/53652614/1987e12c-03b5-4952-87c6-be4d589b5de6

— Reply to this email directly, view it on GitHub https://github.com/dxoverdy/Alpha2MQTT/issues/6#issuecomment-1881601286, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZC7OYJP3BY6ZTMLBPPTVHLYNQ2GLAVCNFSM6AAAAAAVK5DXOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBRGYYDCMRYGY . You are receiving this because you were mentioned.Message ID: @.***>

ettiennecoetzee commented 6 months ago

Battery percentage was 90%. I think the power was zero since it wasnt charging or discharging. I changed the 33000 to 1000. This is what happened: image

ettiennecoetzee commented 6 months ago

But it still won't discharge

dxoverdy commented 6 months ago

Any idea why the battery is not either discharging or charging?

On Tue, 9 Jan 2024 at 07:13, Ettienne Coetzee @.***> wrote:

Battery percentage was 90%. I think the power was zero since it wasnt charging or discharging. I changed the 33000 to 1000. This is what happened: image.png (view on web) https://github.com/dxoverdy/Alpha2MQTT/assets/53652614/006a57fe-e1d4-4292-8d6c-c1574258576e

— Reply to this email directly, view it on GitHub https://github.com/dxoverdy/Alpha2MQTT/issues/6#issuecomment-1882522769, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZC7OYPSS4FHTDD4W3Y4SLDYNTUZHAVCNFSM6AAAAAAVK5DXOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBSGUZDENZWHE . You are receiving this because you were mentioned.Message ID: @.***>

dxoverdy commented 6 months ago

Either way the percentage reading is unexpected. Whilst it may not be to blame it doesn’t fill me with confidence anyway.

If you want to do what others have done, ping me a private message with details to access your home assistant instance (preferably a separate account for me so you can disable it after) and I’ll have a Quick Look around.

On Tue, 9 Jan 2024 at 07:13, Ettienne Coetzee @.***> wrote:

But it still won't discharge

— Reply to this email directly, view it on GitHub https://github.com/dxoverdy/Alpha2MQTT/issues/6#issuecomment-1882523074, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZC7OYIF52KXQWCCNLG5AFTYNTU2NAVCNFSM6AAAAAAVK5DXOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBSGUZDGMBXGQ . You are receiving this because you were mentioned.Message ID: @.***>

jt1971 commented 6 months ago

As an aside, my target soc has always shown spurious figures but still works great on my Smile5.Sent from my iPhone.On 9 Jan 2024, at 07:27, Daniel Young @.***> wrote: Either way the percentage reading is unexpected. Whilst it may not be to

blame it doesn’t fill me with confidence anyway.

If you want to do what others have done, ping me a private message with

details to access your home assistant instance (preferably a separate

account for me so you can disable it after) and I’ll have a Quick Look

around.

On Tue, 9 Jan 2024 at 07:13, Ettienne Coetzee @.***>

wrote:

But it still won't discharge

Reply to this email directly, view it on GitHub

https://github.com/dxoverdy/Alpha2MQTT/issues/6#issuecomment-1882523074,

or unsubscribe

https://github.com/notifications/unsubscribe-auth/AZC7OYIF52KXQWCCNLG5AFTYNTU2NAVCNFSM6AAAAAAVK5DXOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBSGUZDGMBXGQ

.

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 authored the thread.Message ID: @.***>

ettiennecoetzee commented 6 months ago

I am able to charge Screenshot_20240109_160450_Home Assistant

ettiennecoetzee commented 6 months ago

Even with the soc stating 0%, it charges to the target and then stops as commanded.

dxoverdy commented 6 months ago

So it looks like that safety regulation may prevent discharge from battery to grid. After all, the code to charge is the same code to discharge, one just uses a number above 32000 and the other uses one below. I can see the other fella in this chat now discharges fine so not sure what he’s done to get it working….

Perhaps mail alpha and ask if your regulation prevents discharge.

(You can always change it to something we know such as G99 to try)

Good luck!

On Tue, 9 Jan 2024 at 14:06, Ettienne Coetzee @.***> wrote:

Even with the soc stating 0%, it charges to the target and then stops as commanded.

— Reply to this email directly, view it on GitHub https://github.com/dxoverdy/Alpha2MQTT/issues/6#issuecomment-1883111871, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZC7OYONOJZPNOX4EG77SMLYNVFIFAVCNFSM6AAAAAAVK5DXOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBTGEYTCOBXGE . You are receiving this because you were mentioned.Message ID: @.***>

ettiennecoetzee commented 6 months ago

Sorry for bugging you again. Just a quick question. I want to try and set my 0x1000 register to your value (G99). This might be a dumb question, but how do I go about this? When I currently read my raw register, it looks like this:

image

What should I enter in my Alpha Control dash to change it to yours, and also, if I want to change it back? Thanks!

dxoverdy commented 6 months ago

Like so:

define GRID_REGULATION_AL_10 10

define GRID_REGULATION_AL_10_DESC "NRS097-2-1"

which is why yours currently returns raw data 0,10

define GRID_REGULATION_AL_16 16

define GRID_REGULATION_AL_16_DESC "G99"

Alpha2MQTT/request/write/register/raw/data

Set to G99 { "registerAddress": "0x1000", "dataBytes": 2, "value": 16 }

Set to NRS097-2-1 { "registerAddress": "0x1000", "dataBytes": 2, "value": 10 }

dxoverdy commented 5 months ago

Closing issue as op appears to be able to discharge now.