SAJ Solar inverter

hi Tash,

Why would you want the esolar platform or their app? Isn’t it your intention to get all the data inside home assistant and present it there, like you do for the SMA? In my setup, I combine all the data in a nice overview dashboard, so that I dont have to switch between several apps and just use the HA app.

Data refresh is almost instantly (vs minutes for the native app), moreover, if you explore modbus writing, you can easily command the battery (eg limit power) or switch charging modes, thereby fully obsoleting the native app.

Just my 2 cents!
kind regards,

Ben

Basically you remove all the way the dongle, and through Elfin Wifi, you connect straight to home assistant and monitor everything from there, so basically the Inverter becomes full local, right?

Thanks Ben,
Having full control sounds cool, but I would prefer to still have the historical data stored in the vendor platform. I do the same with the SMA inverter, although I have access to all the data locally the inverter is pushing data into the sunnyportal and I consider that as a feature since their platform besides being a backup in terms of data offers some additional features. While home assistant is great, every now and then I had few issues and you end up with gaps in terms of data. Having the info stored in the vendor allows me to benchmark the system values against the vendor recorded data, this allows to compare if there is any variance in performance or anomaly.
Anyhow I already have all these systems integrated in ha, the issue I’m facing with SAJ is that the data refresh is weird and sometimes the battery is disconnected from their platform for few hours before it pulls data again.
Thanks for the great support here!
Kind regards,
Tash

How where you able to keep the connection to the SAJ app if you remove the wifi dongle to put the Elfin thing for HA?

Hi,

In a nutshell, yes. you wont be able to control/monitor via the Saj app anymore. However you can gain FULL control over your SAJ battery as well as near realtime measurements of all parameters (voltage, power, amperage, etc etc etc). I do not use the wifi converter, but just a normal RS to ethernet converter.

cheers,

Ben

Would it be possible to use an ESP32/8266 connected to the USB with ESPHome on it like in : https://community.home-assistant.io/t/esphome-modbus-growatt-shinewifi-s/369171

Or do we really need the Wifi dongle

hi Roland,

Not sure on the ESP32/8266 module. I suppose this module (eg via ESPHome) could read and write modbus registers, so in theory it should be possible. but you do need then some sort of bridget between yoour ESP module and the SaJ converter. you could do this via eg an additional module (like https://www.amazon.de/dp/B09Z2GTMJ8?psc=1&ref=ppx_yo2ov_dt_b_product_details) which you connect the RS wires (you can put in a USB cable and strip that and use the correct wires) directly to.

good luck!

Hello,
I recently published some python code to read and write modbus registers via MQTT from/to SAJ H1 inverters. With this python library and scripts there is no need for additional hardware:

Also I made a Home Assistant integration using the same principles:

1 Like

Hi, could you please share also to me in PM. I have been looking for this. Many thanks!

Hi,

Dos anyone have the modbus documentation for the saj as1-3ks-5.1? I cant find it any where. I also have a saj R5 inverter and this one is ok but for the battery I cant find it.

Kind regards

Hello, can you share the documentation? I’m looking to use this data too but was not succesfull for the moment

Hello Ben,

I also have the saj as1 battery and want to read the data localy, with the data you send here i cant get it running.

  • What is de baudrate? I notice in documentation of the saj r5 inverter if its monophase that its 115200 , is this correct?

  • What is the default modbus adres of the battery?

Wich register is holding the data, for example for the saj R5 inverter i need to use 3 - read holding register (x4).

Maybe you can send me the documentation that you received?

The R5 inverter i can read but the AS1 battery is without succes.

Also where did you by the db9 with screws? Looks easy to use.

Kind regards

hi Kris,

All info you are looking for is mentioned in the thread above (Baudrate, modbuss addresses, modbus protocol, etc).

As for the DB9 connector, aliexpress and amazon are your friends here, just look for ‘DB9 connector’, you will find lots of possbilities.

Good luck and kind regards,
Ben

Small update from my end, I also managed to control the decharging power of the inverter (by writing to its registers) and am using this to avoid my car charger to drain my home battery. Basically i’ve written a small automation to set the power of the SaJ inverter depending on only the power load of my house (excluding the charging of my car) on the moments my car is charging.

Might be interesting for some I guess :slight_smile:

  - 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

Cheers,

Ben

ps, this is part of much bigger automation, which combines power and amperage, so might be confusing. If you need more info, please holler!

Hello Bert, did you get it working? I cant find documentation for the battery and also have it working on the saj r5 inverter been looking for it 1y

Kind regards

Hi Ben,

thanks for your replay, i checked everything but i have the feeling i get nothing from the battery.
My settings of my rtu to tcp converter are the same as yours:

i have to mention that my SAJ R5 inverter is also connected to my USR but via the RS485 port and uses a other port beceause i have read that this should be possible. thats why i use port 503.

What i get in my smarthome (Loxone) is the following:

These are request but dont get replys like from my SAJ R5 (offline for now in belgium) so cant show what this should look like.

It still can be that the serial cable is not good and maybe i need to solder a bridge between some pins or i need to add a resistor.
Do you see anything wrong?

extra info:
image

Kind regards

Hello bert,

never mind i have found the link to the document in this tread

Hi Rob, i have the same setup and got me a Elfin device, can you send me some pictures of how its all connected at your home? By the looks of it you seem dutch speaking probably belgium if i may guess?
You can always answer me in a PM in dutch for more clarity.
I really hope you can help.
greetings, Herman

Hi, would like to go for the dns server + mqtt proxy as well. (as I want to keep the AIO3 module and saj app as well)
Did you finally manage to get it working or not?
Would be great if you could share how, as I want to set it up in the same way. :wink:
EDIT: having the H1 hybrid inverter with 2 B1-5.1 batteries.
EDIT 2: have been sniffing my network and it seems the mqtt is also only sent every 5 minutes…so no benefits by choosing the mqtt dns poisoning, as it’s only sent every 5 minutes… :frowning:

@jock
Is this work in progress, or can this really be used already?