SAJ Solar inverter

nice to hear that it works
always important to restart HA after changes.

There is an addon on github SAJ eSolar Sensor. Uses the web data which is sent to SAJ. Also works with H2 Inverter

SAJ has started to integrate dynamic battery charging prices into its app (eSAJ Home and web version https://eop.saj-electric.com/).

Tibber, a German provider of dynamic electricity prices, uses ENTSOE prices as a source.

In SAJ Home app you can set AI dynamic charging. But has nothing to do with AI :slight_smile:

I have not been able to do it in the web version because the price template is still buggy.

Still a bit beta stage, but things are slowly moving in this direction

Cheers, yeah I was trying the AI charging and was chatting with SAJ and they were working to add my electricity provider. I think doing it manually in HA and having some parameters to set i.e. leave a certain minimum charge in the battery etc etc will be better.

I managed to get the grid charging script working fine too. Are there certain Modbus registers I can write to to enable/disable the battery discharging to the Home or Grid, or the amount of power it can discharge to home or grid? As I am on a wholesale live price account, it is quite often that the solar feed in tariff is negative i.e. you pay if you are producing excess solar, so I usually just setup some of my Servers or water pumps to run when there is excess solar, but unfortunately that also drains the battery so I’d like to be able to automate that in HA.

In the SAJ O&M app, you can activate/deactivate the feeding of power from the battery into the grid.
Is deactivated by default

it is possible to write the register for “Grid Feed Power Limit” with Elfin TCP/Modbus Adapter (but I don’t have an adapter, a friend uses Adaper and it seems to be possible to address all registers - but be careful!)

or set the “Application Mode” to “Self-Use/Time-of-Use/Backup”

Test the backup mode to see if excess PV energy is fed into the grid

i can send you the 2020 PDF Procotol - which you can also find in the Spanish Telegram group (see post above) Important only the 2020 version for H2

I’m demoralized. everything worked flawlessly until September, Saj updated the inverter and from that moment the modbus registers are all different. I’m in contact with Saj and they naturally deny that anything has changed, but if that hasn’t been the case I had no reason to complain. I bought both the ew11 and ew10 but I don’t have the data with that either. Saj can’t do a firmware downgrade it seems. what a disappointment.

I have this inverter:

Model:
H1-6K-S2
PC Code:
1020001700EN056800
Display Board:
v3.019
Ctrl. Boards:
v1.362
Module SN:
M5400J2231097856
Module PC
1030001100016100
Module version
v1.202

Does anyone else have the same version and maybe it works for them?

Before I didn’t trust Saj very much, in fact I had integrated with mqtt precisely to prevent them from somehow entering and causing damage, now I no longer trust it. Then I haven’t had an answer since September and this makes me very angry

let me know

Thank you

I’m having a H1-5K-S2 inverter with the same versions as you.
You might want to try out this: GitHub - paolosabatino/saj-mqtt-ha: Home Assistant integrator for SAJ H1 inverters

I’m running this and I’m able to get the realtime data. (Check the discussions on github on how to setup the mqtt bridging)

I own a saj H2 3 phase inverter. Does anyone have any documentation concerning the modbus registers?

Hi Ben, could you share SAJ technical contact details to me as well?
Thx!

I saw you got contact details from Ben for SAJ technical guys.
Were you able to contact them?
I suppose not, since you are requesting for modbus register documentation for your 3-phase inverter?

I use the WiFi one which seems to work fine but the morning after I installed the integration, my inverter stopped sending data (or was sending it with very long, irregular intervals). Could be a coincidence of course but I was wondering if this has happened to anyone else?

Yes, you are right, I mailed Ben two times, but got no answer (yet).

I also have a H2 three phase inverter with B2 batteries and AIO3 and have gotten some registers to work with a slightly modified modbus.yaml, based on wimb0:s script using modbus TCP.
Would be great to get a copy of the correct modbus register doc.
Tried to sniff the RS232 communication between AIO3 dongle and inverter using an esp8266 but it’s very chatty.

Hi, I’m trying to build an integration to read out multiple registers at different offsets, and I would think that running them in parallel would be faster than all sequentially…
Does anyone know if it’s a good idea to do multiple modbus queries in parallel, or should they all be send sequentially?

hi Stanus,

Sure you can write to the writable registers.

For example, I have an automation that regulates the amount of power (expressed in Ampere) of the decharging of my battery towards my home consumption, based on the power my car charger takes to charge my car. Basically I want to avoid my car battery to charged with my home energy. Please find my automation below.

ps, I had to write a factor 10 bigger due to scaling (so writing 600 equals 60 ampere).

I havent tried to write to other registers but I think a lot will be possible (also regulating the charging power of the battery).

choose:
  - conditions:
      - condition: numeric_state
        entity_id: sensor.eastron_activepower_laadpaal
        above: 500
      - condition: trigger
        id:
          - 1minuutfrequentie
      - condition: numeric_state
        entity_id: >-
          sensor.average_nettoverbruikhuiszonderlaadpaaluitgedruktinvoltagebatterij
        below: 5
    sequence:
      - service: modbus.write_register
        data:
          hub: SAJ
          address: 13140
          value: 50
          unit: 0
  - conditions:
      - condition: numeric_state
        entity_id: sensor.eastron_activepower_laadpaal
        above: 500
      - condition: trigger
        id:
          - 1minuutfrequentie
      - condition: numeric_state
        entity_id: >-
          sensor.average_nettoverbruikhuiszonderlaadpaaluitgedruktinvoltagebatterij
        above: 60
    sequence:
      - service: modbus.write_register
        data:
          hub: SAJ
          address: 13140
          value: 600
          unit: 0
  - conditions:
      - condition: numeric_state
        entity_id: sensor.eastron_activepower_laadpaal
        above: 500
      - condition: trigger
        id:
          - 1minuutfrequentie
      - condition: numeric_state
        entity_id: >-
          sensor.average_nettoverbruikhuiszonderlaadpaaluitgedruktinvoltagebatterij
        below: 60
      - condition: numeric_state
        entity_id: >-
          sensor.average_nettoverbruikhuiszonderlaadpaaluitgedruktinvoltagebatterij
        above: 5
    sequence:
      - service: modbus.write_register
        data_template:
          hub: SAJ
          address: 13140
          value: >-
            {{
            states('sensor.Average_nettoverbruikhuiszonderlaadpaaluitgedruktinvoltagebatterij')
            |int *10 |round(0) }}
          unit: 0
  - conditions:
      - condition: trigger
        id:
          - Charging<500watt
    sequence:
      - service: modbus.write_register
        data:
          hub: SAJ
          address: 13140
          value: 600
          unit: 0
alias: Fineregulation batterijlimiet

hi Mike,

Yes fully possible, I actively use this to avoid my car charging with my battery (see reply below)!

cheers,

Ben

Modbus Protocol 2020 Version

i use AIO3 over TCP. Modbus Port 502 is open and its very easy do get Data with the IP of the AIO3.

Hi, sorry for the question, but I’m a total HA-n00b…
I was able to use the first part of your solution (pasted it into configuration.yaml, and altered the IP-address according to my setup), and I am able to see the attributes under the SAJ-sensor.
Where I could need some help is with the second half of your solution. Where do I paste the template sensors config?
Thx for your help!

hi, I’m owning a H1 series inverter and noticed a weird behavior this weekend. When I was trying to switch between app modes, the display briefly went out and turned on, but suddenly, my energy totals were messed up. It seems to have added almost 1 month of energy to all the statistics (200kwh PV, 400kwh consumption, …) at that point. I tried it one more time, and again it did the same thing and the statistics were increased again.
Did anyone experienced a similar thing as well?
I must say, I was trying to switch the app mode via the O&M app, while I was also viewing the settings menu on the inverter, where the app mode is displayed (to see if it really switched).
Switching the app mode via O&M app, without going into the settings on the inverter at the same time, doesn’t cause issue.
So this seems like some very strange bug (when viewing the settings on the inverter when trying to switch the app mode in the O&M app), that totally messed up my energy statistics…
I’m wondering if these statistics can be corrected? Or is only a complete reset possible (I think I saw somehting like that in the settings to clear the energy statistics).

Not sure how well the inverter handles parallel calls, I have seen some weird things which may be related to that.
I found it faster to try to read in a few reasonable sized chunks and throw away some registers than doing more smaller requests.
Possibly see GitHub - johado/saj_modbus: Python scripts to read SAJ Inverter data via Modbus. for inspiration? (standalone python, but uses a modbus.yaml with HA syntax (with some newly invented data_types for date time time and schedules. I use it to log whats going in csv format, but trying to extend it to write registers and eventually program the whols schedule entries based on hourly spot price)

I think I’m also sticking to the idea of reading larger chunks instead of more parallel calls…