SAJ Solar inverter

Hi Bert,

The firmware update was done by the SAJ team itself (I had some earlier issues with the batteries going offline because there was not enough production - I live in Belgium ergo not a lot of sun this time of the year).

I will pm you with the contact details of the chinese tech representative that handles my case.

kind regards,

Ben

Ben,

I live also in the not sunny Belgium.
Do you use the ip adres you find in the eSolar O&M app to collect the soc of your battery?

Hi Bert,

No I use the data from the online platform above (the IP’s from the communciation module of the inverter are not reachable) and the AS1 itself doesn’t have an IP.

With the configuration in my post above, you should get an entity: “sensor.esolar_batenergypercent”(amongst many other esolar entities). This entity represents the SoC of your battery.

Btw, i just received the modbus definitions for the AS1, now to test if I can get all data out of the inverter itself on a real-time frequency.

Kr,

Ben

Hi, is this still working well?

They are going to install these inverters by me, and also their 5KWh battery pack (3 of them).

Have you those too? Is somebody be able to integrate them too?

Anybody that got the latest update with what is working with the esolar AIO3?

@BenV do you have the firmware version? I want to check with my version if it’s already installed or not.
BTW I’m also one of those people that live in the not so sunny belgium :stuck_out_tongue:

Hi all,

Just to inform everyone, I managed to get the modbus protocols for the AS1 inverter (+ 1 BS module) from SAJ directly. I currently am able to pull everyting (300-400 different data sets) directly over the modbus connection (real time - 1s poll rate).

Only minor disadvantage, you have to disconnect the wifi/ethernet/bluetooth module (AIO3), in order to gain access to the RS232 port (which is an usb bus and via which the modbus communciation goes).

My (draft) setup now:

Connect usb cable to usb port on the inverter:

strip the usb cable to get only the wires connecting to the RS232 parts on the usb hub (took me a while to figure this out):

the rs232 connection scheme on the AS1 USB port:
image

connect serial RS232 to ethernet converter to pull via tcp modbus:

my home assistant modbus sensors (i only took the data i needed):

modbus:
  - name: SAJ
    close_comm_on_error: true
    delay: 5
    type: tcp
    timeout: 5
    host: 192.168.8.134
    port: 23
    sensors:
      - name: display_board_error_message
        slave: 0
        address: 16389 
        count: 2
        scale: 1
        precision: 0
        data_type: uint32
        scan_interval: 10
      - name: display_controller_error_message
        slave: 0
        address: 16391 
        count: 2
        scale: 1
        precision: 0
        data_type: uint32
        scan_interval: 10
      - name: display_controller_error_message2
        slave: 0
        address: 16393 
        count: 2
        scale: 1
        precision: 0
        data_type: uint32
        scan_interval: 10
      - name: error_message_controller
        slave: 0
        address: 16395 
        count: 2
        scale: 1
        precision: 0
        data_type: uint32
        scan_interval: 10
      - name: error_message_controller2
        slave: 0
        address: 16397 
        count: 2
        scale: 1
        precision: 0
        data_type: uint32
        scan_interval: 10 
      - name: Inverter_working_mode
        slave: 0
        address: 16388 
        count: 1
        scale: 1
        precision: 0
        data_type: uint16
        scan_interval: 1
      - name: Grid_phase_voltage
        unit_of_measurement: "V"
        slave: 0
        address: 16433 
        count: 1
        scale: 100
        precision: 0
        data_type: uint16
        device_class: voltage
        scan_interval: 1
      - name: Grid_Phase_current
        unit_of_measurement: "A"
        slave: 0
        address: 16434 
        count: 1
        precision: 2
        scale: 0
        data_type: int16
        device_class: current
        scan_interval: 1
      - name: Battery_voltage
        unit_of_measurement: "V"
        slave: 0
        address: 16489 
        count: 1
        precision: 0
        scale: 1
        data_type: uint16
        device_class: voltage
        scan_interval: 1
      - name: Battery_current
        unit_of_measurement: "A"
        slave: 0
        address: 16490 
        count: 1
        precision: 0
        scale: 1
        data_type: int16
        device_class: current
      - name: Battery_power
        unit_of_measurement: "W"
        slave: 0
        address: 16493 
        count: 1
        precision: 0
        scale: 1
        data_type: int16
        device_class: power
        scan_interval: 1
      - name: Battery_temperature
        unit_of_measurement: "C°"
        slave: 0
        address: 16493 
        count: 1
        precision: 1
        scale: 1
        data_type: int16
        scan_interval: 1
        device_class: temperature
      - name: Battery_SOC
        unit_of_measurement: "%"
        slave: 0
        address: 16495 
        count: 1
        precision: 0
        scale: 0.01
        data_type: uint16
        device_class: battery
        scan_interval: 1
      - name: Battery_direction
        slave: 0
        address: 16534 
        count: 1
        precision: 0
        scale: 1
        data_type: int16
        scan_interval: 1
      - name: Gridconsumption
        unit_of_measurement: "W"
        slave: 0
        address: 16538 
        count: 1
        precision: 0
        scale: 1
        data_type: int16
        device_class: power
        scan_interval: 1
      - name: PVconsumptiontohouse
        unit_of_measurement: "W"
        slave: 0
        address: 16537 
        count: 1
        precision: 0
        scale: 1
        data_type: int16
        device_class: power
        scan_interval: 1
      - name: GridfeedinfromPV
        unit_of_measurement: "W"
        slave: 0
        address: 16539 
        count: 1
        precision: 0
        scale: 1
        data_type: int16
        device_class: power
        scan_interval: 1
      - name: Gridfeedinfrombattery
        unit_of_measurement: "W"
        slave: 0
        address: 16540 
        count: 1
        precision: 0
        scale: 1
        data_type: int16
        device_class: power
        scan_interval: 1
      - name: Batconsumptiontohouse
        unit_of_measurement: "W"
        slave: 0
        address: 16541 
        count: 1
        precision: 0
        scale: 1
        data_type: int16
        device_class: power
        scan_interval: 1
      - name: BatchargingfromPV
        unit_of_measurement: "W"
        slave: 0
        address: 16542 
        count: 1
        precision: 0
        scale: 1
        data_type: int16
        device_class: power
        scan_interval: 1
      - name: Batchargingfromgrid
        unit_of_measurement: "W"
        slave: 0
        address: 16543 
        count: 1
        precision: 0
        scale: 1
        data_type: int16
        device_class: power
        scan_interval: 1
      - name: Systemtotalloadpower
        unit_of_measurement: "W"
        slave: 0
        address: 16544 
        count: 1
        precision: 0
        scale: 1
        data_type: int16
        device_class: power
        scan_interval: 1
      - name: PVtotalpower
        unit_of_measurement: "W"
        slave: 0
        address: 16549 
        count: 1
        precision: 0
        scale: 1
        data_type: int16
        device_class: power
        scan_interval: 1
      - name: Batterytotalpower
        unit_of_measurement: "W"
        slave: 0
        address: 16549 
        count: 1
        precision: 0
        scale: 1
        data_type: int16
        device_class: power
        scan_interval: 1
      - name: Gridtotalpower
        unit_of_measurement: "W"
        slave: 0
        address: 16550 
        count: 1
        precision: 0
        scale: 1
        data_type: int16
        device_class: power
        scan_interval: 1
      - name: Today_pvenergy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16575 
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: Month_pvenergy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16577 
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: Year_pvenergy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16579 
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: Total_pvenergy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16581 
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: Today_batenergy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16583
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: Month_batenergy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16585
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: year_batenergy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16587
        count: 1
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: total_batenergy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16589
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: totay_batdischargeenergy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16591
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: month_batdischargeenergy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16593
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: year_batdischargeenergy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16595
        count: 2
        precision: 0
        scale: 0.01
        data_type: int32
        device_class: energy
        scan_interval: 100
      - name: total_batdischargeenergy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16597
        count: 2
        precision: 0
        scale: 0.01
        data_type: int32
        device_class: energy
        scan_interval: 100
      - name: today_pvconsumed_energy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16639
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: Month_pvconsumed_energy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16641
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: Year_pvconsumed_energy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16643
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: Total_pvconsumed_energy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16645
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: Today_gridconsumed_energy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16647
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: Month_gridconsumed_energy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16649
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: year_gridconsumed_energy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16651
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: total_gridconsumed_energy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16653
        count: 2
        precision: 0
        scale: 0.01
        data_type: int32
        device_class: energy
        scan_interval: 100
      - name: Today_gridfeedinfromPV_energy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16655
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: Month_gridfeedinfromPV_energy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16657
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: year_gridfeedinfromPV_energy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16659
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: total_gridfeedinfromPV_energy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16661
        count: 2
        precision: 0
        scale: 0.01
        data_type: int32
        device_class: energy
        scan_interval: 100
      - name: Today_Totalload_energy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16607
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: Month_Totalload_energy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16609
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: year_Totalload_energy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16611
        count: 2
        precision: 0
        scale: 0.01
        data_type: uint32
        device_class: energy
        scan_interval: 100
      - name: total_Totalload_energy
        unit_of_measurement: "Kwh"
        slave: 0
        address: 16613
        count: 2
        precision: 0
        scale: 0.01
        data_type: int32
        device_class: energy
        scan_interval: 100

Not sure if this work on other Saj inverters, but might be worth a shot?

Probably it’s also possible to command/steer the inverter (several write-addresses were also made available) but i will not be testing this. Please PM if you would like to know more info.

kind regards,

Ben

4 Likes

Thanks for the update.
Nice to see it’s working.
I’m interested in the modbus protocols documentation.

Sadly enough I will not be able to disconnect the AIO3 module.
The app still has to work for my GF.

I’m also going to have contact with somebody of SAJ through my solar panel installer.
Going to ask what the options are.

Sorry if what I am going to say is silly, I am very new to these things… if it is a USB, couldn’t it just be split into 2 and connect the AIO3 to one of them and use the other to tinker with the RS232?

Hi George,

Not sure that will work. Typically serial communications (especially RS232) are one street-communication only, meaning that only one ‘master’ will be able to request the data. Besides using a modbus gateway, i’m not sure multiple request can be done on the serial bus of the Saj.

Not really sure as to why you would need the AOI3 module though, with this modbus pulling, you will be able to pull all information off the inverter on a real time basis (1 sec). Everything that i can think off can be pulled without having to do a lot of calculations. With this info that you pull, you can do whatever you want to visualize this in home assistant.

Updating the sofware will not work, but for that, you can decouple the modbus USB and recouple the AOI3 module if needed.

eg:

, literally allmost all of the data for this graph comes from the SaJ inverter.

good luck!

kind regards,

Ben

Hi!
I went for the dns server + mqtt proxy.
mqtt payload is binary data, sent every 10 seconds as “realtime_data”.
Does someone know about the format?
[djansen1987] mentioned some article regarding this but cannot find anything related

1 Like

Hi guys. I have previously succesfully imported the data from my SAJ inverter into HA. However, after upgrading HA the connection has been lost. I can access the inverter via its IP address from my browser without any trouble.

Anybody has the same issue as me or might be able to help me trouble shoot? I see a warning/error on SAJ in the logs:

WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform command_line is taking over 10 seconds.
ERROR (MainThread) [homeassistant.components.sensor] Setup of platform saj is taking longer than 60 seconds. Startup will proceed without waiting any longer.

Hi,

I’m experiencing the same issue.

Miss configuration on my side.
Never mind it’s working on my side.

The issue is fixed with the recent .7 core update of HA.

Hi All,

I would like to ask some help. I am new with home assistant, I would like to ask some help.
I use the built in SAJ integration, this my configuration.

sensor:
#SAJ

  • platform: saj
    name: SAJ
    host: 10.10.10.60
    type: wifi
    username: admin
    password: admin

Everything looks good but my homeassistant log is full with this errors after I add the SAJ integration.

2022-07-16 09:15:47 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/saj/sensor.py”, line 159, in interval_listener
if await action():
File “/usr/src/homeassistant/homeassistant/components/saj/sensor.py”, line 114, in async_saj
values = await saj.read(sensor_def)
File “/usr/local/lib/python3.10/site-packages/pysaj/init.py”, line 141, in read
async with session.get(current_url) as response:
File “/usr/local/lib/python3.10/site-packages/aiohttp/client.py”, line 1138, in aenter
self._resp = await self._coro
File “/usr/local/lib/python3.10/site-packages/aiohttp/client.py”, line 559, in _request
await resp.start(conn)
File “/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py”, line 893, in start
with self._timer:
File “/usr/local/lib/python3.10/site-packages/aiohttp/helpers.py”, line 721, in exit
raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError

I installed my HA on a Synology Docker.
What can I do?

Hi Ben!
Please, can you share the modbus protocol provided by SAJ?
I own a SAJ H1 5K
thank’s!!

Hi Jorge, I own the same inverter.
Those are some of the modbus adresses:

HEX DEC Size (Word) Register Name Data Type Rate Unit Property Register Description
4032H 16434 1 ROutCurr Uint16 -2 A R R Phase Output Current
4033H 16435 1 RGridFreq Uint16 -2 Hz R R Phase Grid Frequency
4034H 16436 1 RGridDCI Int16 0 mA R R Phase Grid DC Component
4035H 16437 1 ROutPowerWatt Uint16 0 W R R Phase Output Active Power
4036H 16438 1 RGridPowerVA Uint16 0 W R R Phase Grid Apparent Power
4037H 16439 1 RGridPowerPF Int16 -3 R R Phase Grid Power Factor
4046H 16454 1 RInvVolt Uint16 -1 V R R Phase Inverting Voltage
4047H 16455 1 RInvCurr Int16 -2 A R R Phase Inverting Current
4048H 16456 1 RInvFreq Uint16 -2 Hz R R Phase Inverting Frequency
4049H 16457 1 RInvPowerWatt Int16 0 W R R Phase Inverting Active Power
404AH 16458 1 RInvPowerVA Uint16 0 VA R R Phase Inverting Apparent Power
4055H 16469 1 ROutVolt Uint16 -1 V R R Phase Output Voltage
4056H 16470 1 ROutCurr Uint16 -2 A R R Phase Output Current
4057H 16471 1 ROutFreq Uint16 -2 Hz R R Phase Output Frequency
4058H 16472 1 ROutDVI Int16 0 mV R R Phase Output Voltage DC Component
4059H 16473 1 ROutPowerWatt Uint16 0 W R R Phase Output Active Power
405AH 16474 1 ROutPowerVA Uint16 0 VA R R Phase Output Apparent Power
1 Like

Hello Hugo!
Thank you very much for your answer! I have been looking for this information for a long time.
If you can send me the complete file by PM, I would be very grateful!!

Thanks i also have a (two, yeah I got a cool 20KW panels) trifase inverter AIO3 with new dongle, will try your setup when the installation is done.
The models are

  • two of these hybrid inverters, H2-10K-T2 AIO3 type
  • together with 6 batteries B1-5.1-48V and
  • METER CHINT SMART DDSU666 trifase

Anyone else got the same invertee/batteries?

It’s done!