-
-
Notifications
You must be signed in to change notification settings - Fork 742
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
Add support for SAJ H1 hybrid inverters #18097
base: master
Are you sure you want to change the base?
Conversation
No, but total power is fine. |
I think I have to omit the "grid" part, as it's not consistent. |
This is exactly what is needed for grid meter. |
Yes, I know, but this is only possible if you have the converter in combination with the meter. |
1p cannot be a grid meter, so 3p should be the case to add here imho. |
Ok, I'm going to leave out the grid, as it's too different (I just remember that with an older firmware, the meter readout was even in another register). meters:
- name: saj.h1.grid
type: custom
power:
source: modbus
id: 1
uri: <ip>:502
register:
address: 0x40A7 # TotalGridPowerWatt (giving wrong values for me, only smart meter gives correct values)
type: holding
decode: int16
timeout: 3s
- name: saj.h1.grid.meter
type: custom
power:
source: modbus
id: 1
uri: <ip>:502
register:
address: 0x40A1 # SmartMeterGridPowerWatt (undocumented)
type: holding
decode: int16
timeout: 3s |
Small question: is there a way to also test the "battery control" options with custom meters, without creating the template? |
Sure. See
What's "too different" about just using another register? |
Cool, thanks! I mean, the specific register works in my case with a specific firmware version (and with the smart meter). |
08e4d7a
to
2ddbb44
Compare
Last part is the battery control, but for that I need some more time/testing and clarification about the modes, especially about the "hold" mode... I suppose this tries to keep the battery with a specific soc? |
89fa0ff
to
eb93a7c
Compare
The "hold" just sets the backup-soc to the maxsoc value set in ui or evcc.yaml. This disables use of the battery under the set value for maxsoc and will not initiate charging, |
in this case I would switch to "self-use mode" and propose to use register "to be find out" for "hold" |
"hold" means disable discharge of the battery. Whenever possible do not use any SoC or time related controls for battery control. |
In Backup Mode the Battery is charged from solar up to parameter 13894 "maxload" which is 100%, but not from grid. The Batterie is discharched to the value in 13902 backup soc or to 13892 "lowlimit soc" depending which register has the higher value. I did know about the existense of passiv mode, but ignored this according to doc from saj. The total discharge soc 13892 has Shops discharging also in self-use mode. |
Sounds like you can use |
What's the behavior of this What about my suggestion of writing the value of the current |
eb93a7c
to
9362b61
Compare
I am interested in your complete custom configuration. Would you please provide this? |
Sure, will commit it already, so you can have a look. |
39a87fd
to
5650c27
Compare
@andig , @premultiply, I finally managed to setup my dev container to run it from source with the newly created template. Any idea what could be wrong with my template? EDIT: after some investigation, it comes back again to the same question if it's possible to use the current PS: it would be great if you could also reply on my questions related the |
5650c27
to
30cfb0c
Compare
Be aware that the power is coming from the additional smart meter that should be installed together with the inverter. Without the smart meter, the readings won't be correct or 0.
30cfb0c
to
e1ab3e4
Compare
Template is evaluated at startup. |
Exactly! |
I suppose the EDIT: I think this should be it: https://github.com/evcc-io/evcc/pull/18097/files#diff-4abfe070b75d043f244499a32940f0b439c9d526d0c72a62ee02a259e94f58feR139-R163 The only way to test this is probably via the |
I'm still struggling to get this properly tested. Can someone do a review on my template to see if I did something wrong? |
What errors? |
I'll have retest to get the exact modbus errors, as I've already closed my command window and they are gone... :( But I'm testing this over the AIO3 module of SAJ, which seems to be known as quite unstable.... Anyway, will retry and post the errors here. (probably this evening). |
@h3llrais3r, one hint for you: the SAJ / AIO3 connection does not like to much connections, I believe there is a limit of 2 concurrently. |
Thanks for the tip. I'm going to have a look at it. I'm currently testing the saj h1 template with custom sensors, which seems to work fine at first glance. I'm using my home assistant sensors for reading/writing to the registers instead of doing the modbus calls directly from the template. |
- use 'self-use' inverter mode for 'normal' battery mode - use 'passive' inverter mode for 'hold' battery mode - use 'time-of-use' inverter mode for 'charge' battery mode
I took some time to test it again with the modbus over tcp, and getting the following error when making too much calls too fast: I still feel the issue is related to the modbus over tcp via the AIO3 module. So I know the registers are correct but the readout can be unstable when using it directly over the AIO3 module. In the same home assistant community forum, they are also saying that some registers are not even writable via the AIO3 module. (see https://community.home-assistant.io/t/saj-solar-inverter/111932/205) So any suggestion on how to proceed with this? Or can we just keep it (but not really tested for now)? |
This PR contains the initial setup for a SAJ H1 inverter and is still work in progress for some additional meter sensors.
H1 inverter is quite similar as the H2 inverter, so I based myself the template for the H2 (https://github.com/evcc-io/evcc/blob/master/templates/definition/meter/saj-h2.yaml)
Documentation about H1:
https://img.saj-electric.com/file/H1-3-6K-S2-15%C2%A0user%20manual%20EN-V0.0-2023041004191770.pdf
https://github.com/sgsancho/saj_h1_s2_modbus_esp32/blob/main/documentacion/SAJ_Modbus_Communication_Protocol_2020.pdf
Included meters:
currents-> N/AAbout the grid meter:- I found a register which gives the total grid power, so adding the "power" shouldn't be a problem (individual powers for every phase are not available according to my knowledge)- For the currents, I only find 1 register which seems to contain the sum of all currents across all phases, not for every single phase. Is it possible to add this single current or not? I only see "currents", not "current" as an option?Grid has been added (power and energy).
Be aware that the grid meter requires the smart meter device (in my case dtsu666) to be installed together with the inverter.
I'm working on the battery control (I already found the similar registers as for the H2) but I would like to understand first how this works. Is there someone who can provide some info about the battery control of the H2 inverter?
As far as I understood the "backup mode" is used by default instead of the "self-use" mode?
@UDicke, it would be great if you could provide me some info as it seems that you did all the testing for the H2 inverter in #15988