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

3 phase high voltage inverter support #218

Merged
merged 2 commits into from
Jan 2, 2024
Merged

3 phase high voltage inverter support #218

merged 2 commits into from
Jan 2, 2024

Conversation

rixxxx
Copy link
Contributor

@rixxxx rixxxx commented Dec 29, 2023

This is tested and working with Deye 20kw 3phase HV inverter(SUN-20K-SG01-HP3-EU-AM2).

Copy link

codecov bot commented Dec 29, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (8d1fe76) 71.28% compared to head (9da7b0e) 72.09%.
Report is 7 commits behind head on main.

Files Patch % Lines
src/ha_addon_sunsynk_multi/sensor_options.py 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #218      +/-   ##
==========================================
+ Coverage   71.28%   72.09%   +0.81%     
==========================================
  Files          23       24       +1     
  Lines        1689     1749      +60     
==========================================
+ Hits         1204     1261      +57     
- Misses        485      488       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rixxxx
Copy link
Contributor Author

rixxxx commented Dec 29, 2023

sorry for the mess I created with the commits while trying to fixup a style issue black didn't like

Copy link
Owner

@kellerza kellerza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @rixxxx !

This looks really good, some minor comments.

@@ -58,7 +58,7 @@ schema:
MODBUS_ID: int(1,16)
DONGLE_SERIAL_NUMBER: int?
PORT: str
SENSOR_DEFINITIONS: list(single-phase|three-phase)
SENSOR_DEFINITIONS: list(single-phase|three-phase|three-phase-hv)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you undo this change for now? Then we can release it on edge and test it for a while

(Changing multi's config without updating the version & tagging it causes inconsistencies between the addon's options & the built container)

1: "On",
}

# PROG_CHARGE_OPTIONS = {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove these commented lines

SelectRWSensor(175, "Prog4 charge", options=PROG_CHARGE_OPTIONS),
SelectRWSensor(176, "Prog5 charge", options=PROG_CHARGE_OPTIONS),
SelectRWSensor(177, "Prog6 charge", options=PROG_CHARGE_OPTIONS),
# SelectRWSensor(172, "Prog1 charge", options=PROG_CHARGE_OPTIONS, bitmask=0x03),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove these comments

@@ -9,6 +9,7 @@ There are several inverters that are rebranded Deye inverters, so you might have
| Sunsynk 5.5kW | Hubble AM-2 | beta/all | @kellerza | BMS485 (top left) |
| Sunsynk 8.8kW | BSL 8.2 kWH | 0.0.8 | @dirkackerman | RS485 (1 in image below) |
| Deye 8kW | Pylontech US3000C | 0.1.3dev | @Kladrie | RS485 (top left) |
| Deye 20kW 3PH HV | Deye BOS-G | head | | @rixxxx | Solarman |
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an extra | after head?

@@ -51,6 +51,17 @@ These definitions are used when you configure a three-phase inverter in the addo
```yaml
SENSOR_DEFINITIONS: three-phase
```
```
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra three backticks?

Suggested change
```

), # {2: "Inverter", 3: "Hybrid Inverter", 4: "Micro Inverter", 5: "3 Phase Hybrid Inverter" }),
FaultSensor((555, 556, 557, 558), "Fault"),
InverterStateSensor(500, "Overall state"),
SDStatusSensor(0, "SD Status", ""), # type: ignore # 3 Phase does not have SD Card but crashes when removed
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SDStatusSensor(0, "SD Status", ""), # type: ignore # 3 Phase does not have SD Card but crashes when removed
SDStatusSensor(0, "SD Status", ""), # type: ignore

Not sure why this would crash? Seems like a leftover from the 3-ph

@rixxxx
Copy link
Contributor Author

rixxxx commented Dec 30, 2023

Thanks for the feedback. I'll incorporate the fixes.

@RomcaKrestic
Copy link

Hello, I am sending greetings from the Czech Republic.
I was interested in the integration of KellerZA into Home Assistant and I would like to ask if you have tried this integration on the SOFAR Solar 3-phase HV inverter.
Specifically, my friend and I have a Sofar HYD 10KTL-3PH on the wall, each one his own :-) and I am looking in vain for the possibility of connecting to Home Assistant with your integration.
Thanks for any tips on solutions.
Beautiful sunny day 😁
Roman
SOFAR solar vs Solarman
SOFAR Solar MBus konection

@rixxxx
Copy link
Contributor Author

rixxxx commented Jan 2, 2024

I'm not 100% sure since I dont have Sofar HYD 10KTL-3PH, but based on the pictures and some register information I found, it seems to be different from Sunsynk/Deye. It doesn't look too difficult to add another variant, but this pull request doesn't address that.

@RomcaKrestic
Copy link

I'm not 100% sure since I dont have Sofar HYD 10KTL-3PH, but based on the pictures and some register information I found, it seems to be different from Sunsynk/Deye. It doesn't look too difficult to add another variant, but this pull request doesn't address that.

it is definitely different from Dey, you can see it when sewing the SN inverter. There are some pictures instead of the serial number I entered...
Do you think you would like to deal with it? I would be happy to send you a LOG, or create access to Home Assistant :-)
Thanks for your interest and interesting work for the community

@rixxxx rixxxx closed this Jan 2, 2024
@rixxxx rixxxx reopened this Jan 2, 2024
@rixxxx
Copy link
Contributor Author

rixxxx commented Jan 2, 2024

@kellerza all suggested fixed should be incorporated now. I'm not too familiar how the github ecosystem works and probably created unnecessary churn again, sorry for that.

@RomcaKrestic
Copy link

I probably won't be able to overcome that, I have no experience with reading data via MPTT and therefore I can't properly edit the definition file in src/sunsync/definitions3phhv.py. My limit is on the LOG file of the MPTT connection to the LSW-3 Logger. In the log, it can be seen that when querying the serial number, some nonsense value is returned and the communication is interrupted.. It looks like the inverter sent non-alphanumeric characters, but some nonsense characters, to the SN query via the Logger.
Would it be possible to somehow display what exactly comes from the inverter during communication, a complete communication LOG?
Thank you, Roman

@kellerza
Copy link
Owner

kellerza commented Jan 2, 2024

Thanks @rixxxx - this looks good

I’m not able to test it currently, but will merge - so please give some feedback

@kellerza kellerza merged commit 605e0f4 into kellerza:main Jan 2, 2024
8 checks passed
@kellerza
Copy link
Owner

kellerza commented Jan 2, 2024

@RomcaKrestic you can enable DEBUG to get extra logs

if you can find the registers you can use custome sensors - see mysensors in the docs to create these and test them

@rixxxx
Copy link
Contributor Author

rixxxx commented Jan 2, 2024

@RomcaKrestic there is nothing common with Deye/Sunsync 3ph hv inverter registers. This probably requires new definition file, doens't make sense to add conditions to each register. I think it would be best if you could file an issue with the problem. I may have a look.

@rixxxx
Copy link
Contributor Author

rixxxx commented Jan 2, 2024

@kellerza my existing config still works with the merged tree.

@JanKraslice
Copy link

Hello why even after your update the HV DEYE 30K still shows the battery voltage value for the LV ( low voltage) inverter
12 3 2024

@rixxxx
Copy link
Contributor Author

rixxxx commented Mar 12, 2024

@JanKraslice it should be Battery 1 voltage in the latest code. There has been additional work on top of what I did.
image

@JanKraslice
Copy link

JanKraslice commented Mar 12, 2024 via email

@rixxxx
Copy link
Contributor Author

rixxxx commented Mar 12, 2024

Ok, figured it out. LV definition has "Battery voltage", HV has "Battery 1 voltage. If you use battery_voltage in your configuration it will use the LV variant. I added both battery_1_voltage and battery_voltage and my sensors look like that:
image

I'm not using the HA addon and don't know how to do it but somewhere there should be a list of sensors where you need to change battery_voltage to battery_1_voltage.

@rixxxx
Copy link
Contributor Author

rixxxx commented Mar 12, 2024

@kellerza do we wan't to break LV backward compatibility and change the sensor name? Or add Battery voltage to HV to point to Battery 1?

@JanKraslice
Copy link

So in my case I don't know where to change, sorry I guess I need help. thanks (battery_1_voltage.)

@JanKraslice
Copy link

JanKraslice commented Mar 12, 2024 via email

@rixxxx
Copy link
Contributor Author

rixxxx commented Mar 12, 2024

Solar Sell should be "solar_export" and Max Sell Power should be "export_limit_power". You need to add them in the same way you did battery_1_voltage

@JanKraslice
Copy link

JanKraslice commented Mar 13, 2024 via email

@JanKraslice
Copy link

JanKraslice commented Mar 13, 2024 via email

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

Successfully merging this pull request may close these issues.

4 participants