Skip to content
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

Power values jump to 65535 kW and -65509 kW #398

Open
Doesi opened this issue Jan 18, 2025 · 32 comments
Open

Power values jump to 65535 kW and -65509 kW #398

Doesi opened this issue Jan 18, 2025 · 32 comments

Comments

@Doesi
Copy link

Doesi commented Jan 18, 2025

Issue related to

Sunsynk / mbusd Home Assistant Add-On

Describe the issue/bug

Since the last commit, power sensors randomly jump to 65535 kW and -65509 kW.

Expected behavior
Real values should be shown

Your environment

  • Home Assistant version: 2025.1.2
  • Addon:
    • Name: sunsynk-multi
    • Version: f23619a
  • Inverter:
    • Make: Deye
    • Model: SUN 20K-SG01 HP3-EU-AM2
    • Firmware: -
  • Adaptor details:
    • solarman

See also #391 (comment)

@JanKraslice
Copy link

Hello yes that's right version:f23619a is wrong
I'm attaching pictures, please kellerza

Image

Image

Image

@Marow
Copy link

Marow commented Jan 22, 2025

I have exactly the same problem with DEYE SG05LP3 20K (the new one).

I am using Sunsynk/Deye Inverter Add-on (edge/dev) with Version: e6c5d80

@kellerza
Copy link
Owner

Can you test with the new edge version that includes #397 ?

@proggaras
Copy link
Contributor

Unfortunately I can't update:

Image

@maslyankov
Copy link
Contributor

Unfortunately I can't update:

Image

There seem to be some build cicd issues occasionally which I've noticed. They have affected the new version build. I have made a PR that aims to fix this.

@maslyankov
Copy link
Contributor

Looks like there no peaks anymore with 02f085f

I will check it again after few hours and will send information here. But first, looks good!

Let's keep this issue open for now. Pls confirm in a day or two if fix is consistent.

@Marow
Copy link

Marow commented Jan 22, 2025

Its not fixed with the new commit. 02f085f

Image

As you can see on the bottom right. There you can see, it says each phase -65xxx

@Marow
Copy link

Marow commented Jan 22, 2025

Its not fixed with newest version 02f085f. Thats last 8 minutes.

Image

Up and down 65xxx Watts.

I found that:
StephanJoubert/home_assistant_solarman#329

Looks nearly the same problem on Solarman. Probably you can check how they fixed it.
They have also same Problem with 65xxx Watts up and down

@maslyankov
Copy link
Contributor

maslyankov commented Jan 22, 2025

Yes, I just checked over at https://github.com/davidrapan/ha-solarman/blob/c1e893c1c79e2b969104bf478deca8f2e286f504/custom_components/solarman/inverter_definitions/deye_p3.yaml#L2461-L2485 that they have the same registers are defined here:

Sensor((650, 656), "Load L1 power", WATT, -1),
Sensor((651, 657), "Load L2 power", WATT, -1),
Sensor((652, 658), "Load L3 power", WATT, -1),

This appears to be the fix they implemented: StephanJoubert/home_assistant_solarman#270

@Marow
Copy link

Marow commented Jan 22, 2025

Yes, I just checked over at https://github.com/davidrapan/ha-solarman/blob/c1e893c1c79e2b969104bf478deca8f2e286f504/custom_components/solarman/inverter_definitions/deye_p3.yaml#L2461-L2485 that they have the same registers are defined here:

sunsynk/src/sunsynk/definitions/three_phase_common.py

Lines 78 to 80 in bbb7a60

Sensor((650, 656), "Load L1 power", WATT, -1),
Sensor((651, 657), "Load L2 power", WATT, -1),
Sensor((652, 658), "Load L3 power", WATT, -1),
This appears to be the fix they implemented: StephanJoubert/home_assistant_solarman#270

Yeah, that can be a fix.
Hope for update soon, than i can try again.

@Marow
Copy link

Marow commented Jan 22, 2025

For your information:

I've found out something else that's very strange! Since the solar has stopped coming in because the sun has gone, there have been no more peaks. From about 4 p.m. onwards, you can't see any more peaks.

Is it somehow related to this?
Maybe too much data being sent together, which is messing things up or something?

Image

@maslyankov
Copy link
Contributor

maslyankov commented Jan 22, 2025

Probably is related, yes. Now that I think of it, I also get spikes when there is solar production. Maybe data gets a bit messed up when many modbus frames come in. For this reason, I also implemented CRC validation as well (in the last PR above), like other projects have.

@maslyankov
Copy link
Contributor

maslyankov commented Jan 22, 2025

Version e37dd6d is up 🙌 Hopefully this does it. 🤞

@Doesi
Copy link
Author

Doesi commented Jan 22, 2025

Now it's completely broken. In the logs I get continously:

Error reading: PySolarmanV5Async.read_holding_registers() got an unexpected keyword argument 'sequence_number'

@Marow
Copy link

Marow commented Jan 23, 2025

Now it's completely broken. In the logs I get continously:

Error reading: PySolarmanV5Async.read_holding_registers() got an unexpected keyword argument 'sequence_number'

Not for me. I didnt have that error.

Version e37dd6d is up 🙌 Hopefully this does it. 🤞

Will check it later, when Solar Power comes in. Without solar, i didnt have that peaks

Image

@maslyankov
Copy link
Contributor

maslyankov commented Jan 23, 2025

Now it's completely broken. In the logs I get continously:

Error reading: PySolarmanV5Async.read_holding_registers() got an unexpected keyword argument 'sequence_number'

Not for me. I didnt have that error.

Version e37dd6d is up 🙌 Hopefully this does it. 🤞

Will check it later, when Solar Power comes in. Without solar, i didnt have that peaks

Image

Are you using solarman connection? I am guessing not (tcp to modbus?)

@Doesi
Copy link
Author

Doesi commented Jan 23, 2025

Yes, solarman with the original wifi dongle.

@Marow
Copy link

Marow commented Jan 23, 2025

Now it's completely broken. In the logs I get continously:
Error reading: PySolarmanV5Async.read_holding_registers() got an unexpected keyword argument 'sequence_number'

Not for me. I didnt have that error.

Version e37dd6d is up 🙌 Hopefully this does it. 🤞

Will check it later, when Solar Power comes in. Without solar, i didnt have that peaks
Image

Are you using solarman connection? I am guessing not (tcp to modbus?)

No, i am using cable from modbus with Waveshare RS485 to USB (USB into my Home Assistant mini PC)
And pymodbus config

@martinarva
Copy link

martinarva commented Jan 23, 2025

I'm running the latest and still have issue with power jumps. Connection is direct modbus to PC.

Image

@maslyankov
Copy link
Contributor

maslyankov commented Jan 23, 2025

Just found that there is a related issue from a long time ago: #184

This is strange, as when using the pysolarman driver, under the hood we had already been doing these checks I added, yet the issue is there.

Looking through the code, I am starting to think that my validations were not implemented on the right place... This does not change my confusion with why the issue persists when using the pysolarman driver, as they should be already there in the recent versions...

@kellerza any ideas here?

@Marow
Copy link

Marow commented Jan 23, 2025

My Solar Power starts now, lets see... right now, on low solar power there are no peaks with newest version. Hope that also doesnt comes with more power soon

@maslyankov
Copy link
Contributor

My Solar Power starts now, lets see... right now, on low solar power there are no peaks with newest version. Hope that also doesnt comes with more power soon

I am skeptical. #408 I think we need to revert this PR, as it only affects solarman (pysolarmanv5) driver usage (and overlaps with validations inside it).

@proggaras
Copy link
Contributor

Mine is working just some spikes are there from time to time...

Image

Your environment

  • Home Assistant version: 2025.1.3
  • Addon:
  • Inverter:
    • Make: Deye
    • Model: SUN-25K-SG01HP3-EU-AM2
    • Firmware: HMI: Ver 2001-C030 MAIN: Ver 3002-1066-1E08
  • Adaptor details:
    • RS485
    • Waveshare RS485_TO_POE_ETH

@maslyankov
Copy link
Contributor

I will do another PR with revert of solarman breaking changes, also will add more validation to reading of data and more debug logs, so it it continues to happen we can hopefully see why.

@Marow
Copy link

Marow commented Jan 23, 2025

Peaks starting again :(

Image

@Saurman
Copy link

Saurman commented Jan 23, 2025

e37dd6d fixed blank data for me

@Marow
Copy link

Marow commented Jan 23, 2025

e37dd6d fixed blank data for me

It looks like that, but if you get to much power (solar) or anything else, than you get peaks

@Saurman
Copy link

Saurman commented Jan 23, 2025

yes, I get 65k spikes for CT entities

@spinza
Copy link

spinza commented Jan 23, 2025

Running add on version e37dd6d (edge) with recent bugfix.
Sunsynk 3 Phase Inverter

Type: Three phase LV Hybrid
SW Ver.:M 2005-1140 / S  18-07 / C 1001-E037

Connected via pymodbus to mbusd instance running on a separate Raspberry Pi.

Still get glitchy values after the latest fix.

I get it on the grid power for each of the three phases as well as on the total grid power value.

Below I show:

  • sunsynk_grid_l1_power
  • sunsynk_grid_l2_power
  • sunsynk_grid_l3_power
  • sunsynk_grid_power
  • sunsynk_pv_power

Image

Versions:

Core 2025.1.3
Supervisor 2024.12.3
Operating System 14.1
Frontend 20250109.0

Logs for add-on is spammed with this (Repeating):

12:39:21 WARNING microinverter_export_to_grid_cutoff: Unknown register value 0
12:39:21 WARNING gen_peak_shaving: Unknown register value 0
12:39:21 WARNING grid_peak_shaving: Unknown register value 0
12:39:21 WARNING on_grid_always_on: Unknown register value 0
12:39:21 WARNING external_relay: Unknown register value 0
12:39:21 WARNING drm: Unknown register value 0
12:39:21 WARNING us_version_grounding_fault: Unknown register value 0
12:39:21 WARNING allow_remote: Unknown register value 0

Other errros in add-on log repeating less frequently.

12:35:00 ERROR   (1 in 5 min) OSError in callback read_sunsynk: OSError reading 4 registers from 650: failed to read register 650 - function code: 131 poll_need_to_read
12:35:00 ERROR   (1 in 5 min) OSError in callback read_sunsynk: OSError reading 4 registers from 555: failed to read register 555 - function code: 131 poll_need_to_read
12:35:00 ERROR   (1 in 5 min) OSError in callback read_sunsynk: OSError reading 20 registers from 148: failed to read register 148 - function code: 131 poll_need_to_read

@Marow
Copy link

Marow commented Jan 23, 2025

For your info: I started 16000 Watt charging my car with a wallbox.

There are no peaks!
Peaks are really only coming, when solar power is coming

When peaks are stopping, solar was at the end of power

Image

@JanKraslice
Copy link

I've got them in and out of solar.

See picture this morning I have 65000W even when it's still dark outside

Image

@spinza
Copy link

spinza commented Jan 24, 2025

I believe this happens when the grid is not being used. See below. The times when it' s not spiking is when the battery is at it's lower limit after dark.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants