diy solar

diy solar

All MODBUS Maps and Schneider XW 6848 PRO integration into Home Assistant via MODBUS TCP

NewGuyNoob

New Member
Joined
Jul 30, 2021
Messages
86
Here are the ModBus Maps for these Conext Devices, XW/XW+ , Microsoft Onelink shared below and attached to this thread:
SE Devices OneDrive Link PDF’s - Below:
503-0244-01-01_RevA.4_Modbus_Map_Conext_SW_Device.pdf
503-0245-01-01_RevA.4_Modbus_Map_Freedom_SW_Device.pdf
503-0246-01-01_RevA.4_Modbus_Map_Conext_XW_Device.pdf
503-0247-01-01_RevA.4_Modbus_Map_AGS_Device.pdf
503-0248-01-01_RevA.4_Modbus_Map_MPPT60_Device.pdf
503-0250-01-01_RevA.4_Modbus_Map_GridTie_Device.pdf
503-0251-01-01_RevA.4_Modbus_Map_SCP_Device.pdf
503-0252-01-01_RevA.4_Modbus_Map_MPPT80_Device.pdf
503-0253-01-01_RevA.4_Modbus_Map_ConverterComBox_Device.pdf
503-0261-01-01_RevA.4_Battery_Monitor_Device.pdf
503-0262-01-01_RevA.4_Freedom Sequence Device.pdf


configuration.yaml
YAML:
# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor: !include sensors.yaml

influxdb:
  host: a0d7b954-influxdb
  port: 8086
  database: homeassistant
  username: homeassistant
  password: homeassistant
  max_retries: 3
  default_measurement: state

modbus:
  - name: conext_gateway
    type: tcp
    host: 192.168.86.245
    port: 503
    delay: 2
    timeout: 15

      #Always double check your address for each device.
      #conext_gateway Device over MODBUS: XW Pro 6848 Bus ID 1, Bus address 0, Modbus SlaveAddress 10 (Port 502/503)
    
    
    sensors:
    

#############
#      - name: "Load AC Power"
#        data_type: uint32
#        unit_of_measurement: W
#        scale: 1
#        slave: 90
#        address: 132
#        device_class: energy
        
#      - name: "AC Input Power"
#        data_type: uint32
#        unit_of_measurement: W
#        scale: 1
#        slave: 90
#        address: 100
#        device_class: energy
        
#      - name: "Charge DC Power"
#        data_type: uint32
#        unit_of_measurement: W
#        scale: 1
#        slave: 90
#        address: 92
#        device_class: energy
#       
#      - name: "Load Output Energy Today"
#        data_type: uint32
#        unit_of_measurement: kWh
#        scale: 0.001
#       precision: 1
#        slave: 90
#        address: 220
#        device_class: energy
#        state_class: total_increasing
#       
#       
#      - name: "Energy From Battery This Hour"
#        data_type: uint32
#        unit_of_measurement: kWh
#        scale: 0.001
#        precision: 1
#        slave: 90
#        address: 144
#        device_class: energy
#        state_class: total_increasing
#       
#       
#      - name: "Energy to Battery This Hour"
#        data_type: uint32
#        unit_of_measurement: kWh
#        scale: 0.001
#        precision: 1
#        slave: 90
#        address: 168
#        device_class: energy
#        state_class: total_increasing
        
#     - name: "Generator Status"
#        data_type: uint16
#        scale: 1
#        slave: 51
#        address: 77
#        device_class: energy
#       
#      - name: "Generator to Battery This Hour"
#        data_type: uint32
#        unit_of_measurement: kWh
#        scale: 0.001
#        precision: 1
#        slave: 90
#        address: 192
#        device_class: energy
#        state_class: total_increasing
    ###############
    
    
#      - name: "EG4 Internal BMS - Battery SOC"
#        data_type: uint32
#        unit_of_measurement: V
#        scale: 1
#        slave: 230
#        address: 70

      - name: "XW 4868 Inverter Enabled"
        data_type: uint16
        input_type: input
        slave: 10
        address: 71

      - name: "XW 4868 Active Faults Flag"
        data_type: uint16
        input_type: input
        slave: 10
        address: 75

      - name: "XW 4868 Active Warnings Flag"
        data_type: uint16
        input_type: input
        slave: 10
        address: 76

      - name: "XW 4868 Battery Current"
        data_type: int32
        input_type: input
        count: 2
        slave: 10
        address: 82
        unit_of_measurement: A
        scale: 0.001
        offset: 0
        precision: 3

      - name: "XW 4868 Battery Power"
        data_type: int32
        input_type: input
        count: 2
        slave: 10
        address: 84
        scale: 1
        offset: 0
        precision: 0
        device_class: energy
        unit_of_measurement: W

      - name: "XW 4868 Battery Temperature"
        data_type: uint16
        input_type: input
        slave: 10
        address: 86
        unit_of_measurement: degC
        scale: 0.01
        offset: -273
        precision: 2

      - name: "XW 4868 Inverter Status"
        data_type: uint16
        input_type: input
        slave: 10
        address: 122

      - name: "XW 4868 Load AC Voltage"
        data_type: uint32
        input_type: input
        count: 2
        slave: 10
        address: 140
        unit_of_measurement: V
        scale: 0.001
        offset: 0
        precision: 3

      - name: "XW 4868 Load AC Current"
        data_type: int32
        input_type: input
        count: 2
        slave: 10
        address: 150
        unit_of_measurement: A
        scale: 0.001
        offset: 0
        precision: 3

      - name: "XW 4868 Load AC Frequency"
        data_type: uint16
        input_type: input
        slave: 10
        address: 152
        unit_of_measurement: Hz
        scale: 0.01
        offset: 0
        precision: 2

      - name: "XW 4868 Load AC Power"
        data_type: int32
        input_type: input
        count: 2
        slave: 10
        address: 154
        unit_of_measurement: W
        scale: 1
        offset: 0
        precision: 0
        scan_interval: 1
###
###
###
      #conext_gateway device over Modbus: MPPT600/100 0 - Bus ID:1, Bus address:1, Modbus Slave Address (Port 503): 170
###
###
###
      - name: "0 - MPPT100/600 100/600 Device State"
        data_type: uint16
        input_type: input
        slave: 170
        address: 64

      - name: "0 - MPPT100/600 Charger Enabled Status"
        data_type: uint16
        input_type: input
        slave: 170
        address: 65

      - name: "0 - MPPT100/600 Charge Mode Status"
        data_type: uint16
        input_type: input
        slave: 170
        address: 67

      - name: "0 - MPPT100/600 100/600 Active Faults"
        data_type: uint16
        input_type: input
        slave: 170
        address: 68

      - name: "0 - MPPT100/600 Active Warnings"
        data_type: uint16
        input_type: input
        slave: 170
        address: 69

      - name: "0 - MPPT100/600 PV Input Voltage"
        data_type: uint32
        input_type: input
        count: 2
        slave: 170
        address: 76
        unit_of_measurement: V
        scale: 0.001
        offset: 0
        precision: 3

      - name: "0 - MPPT100/600 PV Input Current"
        data_type: uint32
        input_type: input
        count: 2
        slave: 170
        address: 78
        unit_of_measurement: A
        scale: 0.001
        offset: 0
        precision: 3
        
      - name: "0 - MPPT100/600 PV Input Power"
        data_type: uint32
        input_type: input
        count: 2
        slave: 170
        address: 80
        scale: 1.0
        offset: 0
        precision: 0
        device_class: energy
        unit_of_measurement: W

      - name: "0 - MPPT100/600 Battery Temperature"
        data_type: uint16
        input_type: input
        slave: 170
        address: 86
        unit_of_measurement: degC
        scale: 0.01
        offset: -273
        precision: 2

      - name: "0 - MPPT100/600 PV Output Voltage"
        data_type: int32
        input_type: input
        count: 2
        slave: 170
        address: 88
        unit_of_measurement: V
        scale: 0.001
        offset: 0
        precision: 3

      - name: "0 - MPPT100/600 PV Output Current"
        data_type: int32
        input_type: input
        count: 2
        slave: 170
        address: 90
        unit_of_measurement: A
        scale: 0.001
        offset: 0
        precision: 3

      - name: "0 - MPPT100/600 PV Output Power"
        data_type: uint32
        input_type: input
        count: 2
        slave: 170
        address: 92
        scale: 1
        offset: 0
        precision: 0
        device_class: energy
        unit_of_measurement: W

      - name: "0 - MPPT100/600 Energy From PV This Hour"
        data_type: uint32
        input_type: input
        count: 2
        slave: 170
        address: 112
        unit_of_measurement: kWh
        scale: 0.001
        offset: 0
        precision: 3

      - name: "0 - MPPT100/600 PV Input Active This Hour"
        data_type: uint32
        input_type: input
        count: 2
        slave: 170
        address: 114
        unit_of_measurement: s
        scale: 0.001
        offset: 0
        precision: 3



OK, So is anyone integrating the 6.8K into their setup using closed loop communication with their EG4 batteries? I am trying to get SOC to show up in my HA setup. I can get anything else, except that. My insight Local, says my slave address for the BMS is 230, but that address is dead.

Anyone have any success?
 

Attachments

  • 503-0244-01-01_RevA.4_Modbus_Map_Conext_SW_Device.pdf
    116 KB · Views: 6
  • 503-0261-01-01_RevA.4_Battery_Monitor_Device.pdf
    93.7 KB · Views: 9
  • 503-0253-01-01_RevA.4_Modbus_Map_ConverterComBox_Device.pdf
    133.7 KB · Views: 5
  • 503-0252-01-01_RevA.4_Modbus_Map_MPPT80_Device.pdf
    104.7 KB · Views: 4
  • 503-0251-01-01_RevA.4_Modbus_Map_SCP_Device.pdf
    80.6 KB · Views: 4
  • 503-0250-01-01_RevA.4_Modbus_Map_GridTie_Device.pdf
    89.1 KB · Views: 5
  • 503-0248-01-01_RevA.4_Modbus_Map_MPPT60_Device.pdf
    104.5 KB · Views: 5
  • 503-0247-01-01_RevA.4_Modbus_Map_AGS_Device.pdf
    107.3 KB · Views: 4
  • 503-0246-01-01_RevA.4_Modbus_Map_Conext_XW_Device.pdf
    160.2 KB · Views: 8
  • 503-0245-01-01_RevA.4_Modbus_Map_Freedom_SW_Device.pdf
    127.5 KB · Views: 5
I don't know if the SOC functionality works yet as I still setting up XW Pro into my system but my bank of 6 EG4-LL 6 dipswitch batteries all show up in the Insight home after I updated the firmware on the batteries and set the dip switches to 1 through 6 on them. Which EG4 batteries do you have ?
 
I don't know if the SOC functionality works yet as I still setting up XW Pro into my system but my bank of 6 EG4-LL 6 dipswitch batteries all show up in the Insight home after I updated the firmware on the batteries and set the dip switches to 1 through 6 on them. Which EG4 batteries do you have ?
I have the older EG4-LL V1 Pro [With Display] batteries. I'm thinking about using CAN for XW to EG4 BMS communication, then using RS485 with with solar assistant for individual cell monitoring.

This way I can get my SOC to show within Home Assistant.
 
The BMS is only available using the 502 port not the 503. You also need to use the Li-Ion Battery Management System Modbus map that is different than the battery monitor Modbus map on port 503.

Also, you need to use the full 40XXX address.



modbus:
- name: conext_gateway
type: tcp
host: 192.168.86.245
port: 502
delay: 2
timeout: 15

# - name: "EG4 Internal BMS - Battery SOC"
# data_type: uint16 #correct SOC data_type when using 502 port register map
# unit_of_measurement: V
# scale: 1
# slave: 230
# address: 40081 #correct SOC register address
 
The BMS is only available using the 502 port not the 503. You also need to use the Li-Ion Battery Management System Modbus map that is different than the battery monitor Modbus map on port 503.

Also, you need to use the full 40XXX address.
The BMS is only available using the 502 port not the 503. You also need to use the Li-Ion Battery Management System Modbus map that is different than the battery monitor Modbus map on port 503.

Also, you need to use the full 40XXX address.
Hi sancsam, long story short: the only info I am missing to get data off the EG4 batteries (via Schneider InsightHome) was the full modbus addresses. I was able to get SOC data with the 40081 address you gave here. Can you share the full modbus map for the EG4 internal BMS?
 
Hi sancsam, long story short: the only info I am missing to get data off the EG4 batteries (via Schneider InsightHome) was the full modbus addresses. I was able to get SOC data with the 40081 address you gave here. Can you share the full modbus map for the EG4 internal BMS?

Have you thought about putting this on github, so that people can duplicate the work, keep up with updates/changes, or potentially contribute back?
 
Have you thought about putting this on github, so that people can duplicate the work, keep up with updates/changes, or potentially contribute back?
Thats a great idea.

Can make one for Home Assistant and Node Red which are the most common way to get data.
 
Last edited:
Great!

The modbus map you need is in the 502 folder. There is a pdf for the Battery Management System.

https://solar.se.com/us/wp-content/...y-InsightHome-InsightFacility-Modbus-Maps.zip
Awesome, thanks!
Thats a great idea.

Can make one for Home Assistant and Node Red which are the most common way to get data.
Have you thought about putting this on github, so that people can duplicate the work, keep up with updates/changes, or potentially contribute back?
Wish I had the skill set to do that, but I'm learning. Happy to share my experience with anyone having a similar setup to mine:
- Schneider SW4048 (specifically 485-4048-21, if you're running FW 3.12 and experience high AC load voltages around 256-258V when off-grid, there is a fix).
- 2 APSystems QS1 PV inverters, 2.4kW combined, AC Coupled
- 2 EG4 Lifepower4 batteries
I am now able to pull data off all these into HA, with a lot of insights provided by this and other communities. Happy to reciprocate!
 
The BMS is only available using the 502 port not the 503. You also need to use the Li-Ion Battery Management System Modbus map that is different than the battery monitor Modbus map on port 503.

Also, you need to use the full 40XXX address.

Can I have more than one connection via TCP? So I can pull data from port 502 & 503?

EDIT: I have read up on mulitiple connections and am still having some difficulty. Will either of you please post your config?

YAML:
#data_type: int, uint, float, string, custom (default int)
#count: 1, 2 (default 1 for 16-bit register, 2 for 32-bit register)
#input_type: holding, input (default holding)


# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

#sensor: !include sensors.yaml

influxdb:
  host: a0d7b954-influxdb
  port: 8086
  database: homeassistant
  username: homeassistant
  password: homeassistant
  max_retries: 3
  default_measurement: state
 
modbus:
  - name: BMS
    type: tcp
    host: 192.168.1.179
    port: 502
    delay: 2
    timeout: 15

  - name: conext_gateway
    type: tcp
    host: 192.168.1.179
    port: 503
    delay: 2
    timeout: 15
    sensors:

################################################################################################################
################################################################################################################
################################################################################################################
##########                   SEMB_BMS 0 Modbus SlaveAddress (Port 503): 230                            #########
################################################################################################################
################################################################################################################
################################################################################################################
      - name: "EG4 Internal BMS - Battery SOC"
        data_type: uint16
        unit_of_measurement: V
        scale: 1
        slave: 230
        address: 40081

################################################################################################################
################################################################################################################
################################################################################################################
##########                   XW Pro 6848 Modbus SlaveAddress (Port 503): 171                           #########
################################################################################################################
################################################################################################################
################################################################################################################

      - name: "0 - XW 4868 Inverter Enabled"
        data_type: uint16
        input_type: input
        slave: 10
        address: 71
        scan_interval: 1

      - name: "0 - XW 4868 Active Faults Flag"
        data_type: uint16
        input_type: input
        slave: 10
        address: 75
        scan_interval: 1

      - name: "0 - XW 4868 Active Warnings Flag"
        data_type: uint16
        input_type: input
        slave: 10
        address: 76
        scan_interval: 1

      - name: "0 - XW 4868 Battery Current"
        data_type: int32
        input_type: input
        count: 2
        slave: 10
        address: 82
        unit_of_measurement: A
        scale: 0.001
        offset: 0
        precision: 3
        scan_interval: 1

      - name: "0 - XW 4868 Battery Power"
        data_type: int32
        input_type: input
        count: 2
        slave: 10
        address: 84
        scale: 1
        offset: 0
        precision: 0
        device_class: energy
        unit_of_measurement: W
        scan_interval: 1

      - name: "0 - XW 4868 Battery Temperature"
        data_type: uint16
        input_type: input
        slave: 10
        address: 86
        unit_of_measurement: degC
        scale: 0.01
        offset: -273
        precision: 2
        scan_interval: 1

      - name: "0 - XW 4868 Inverter Status"
        data_type: uint16
        input_type: input
        slave: 10
        address: 122
        scan_interval: 1


      - name: "0 - XW 4868 Load AC Voltage"
        data_type: uint32
        input_type: input
        count: 2
        slave: 10
        address: 140
        unit_of_measurement: V
        scale: 0.001
        offset: 0
        precision: 3
        scan_interval: 1

      - name: "0 - XW 4868 Load AC Current"
        data_type: int32
        input_type: input
        count: 2
        slave: 10
        address: 150
        unit_of_measurement: A
        scale: 0.001
        offset: 0
        precision: 3
        scan_interval: 1


      - name: "0 - XW 4868 Load AC Frequency"
        data_type: uint16
        input_type: input
        slave: 10
        address: 152
        unit_of_measurement: Hz
        scale: 0.01
        offset: 0
        precision: 2
        scan_interval: 1


      - name: "0 - XW 4868 Load AC Power"
        data_type: int32
        input_type: input
        count: 2
        slave: 10
        address: 154
        unit_of_measurement: W
        scale: 1
        offset: 0
        precision: 0
        scan_interval: 1

#############UNUSED###########################

#      - name: "Load AC Power"
#        data_type: uint32
#        unit_of_measurement: W
#        scale: 1
#        slave: 90
#        address: 132
#        device_class: energy
        
#      - name: "AC Input Power"
#        data_type: uint32
#        unit_of_measurement: W
#        scale: 1
#        slave: 90
#        address: 100
#        device_class: energy
        
#      - name: "Charge DC Power"
#        data_type: uint32
#        unit_of_measurement: W
#        scale: 1
#        slave: 90
#        address: 92
#        device_class: energy
#       
#      - name: "Load Output Energy Today"
#        data_type: uint32
#        unit_of_measurement: kWh
#        scale: 0.001
#       precision: 1
#        slave: 90
#        address: 220
#        device_class: energy
#        state_class: total_increasing
#       
#       
#      - name: "Energy From Battery This Hour"
#        data_type: uint32
#        unit_of_measurement: kWh
#        scale: 0.001
#        precision: 1
#        slave: 90
#        address: 144
#        device_class: energy
#        state_class: total_increasing
#       
#       
#      - name: "Energy to Battery This Hour"
#        data_type: uint32
#        unit_of_measurement: kWh
#        scale: 0.001
#        precision: 1
#        slave: 90
#        address: 168
#        device_class: energy
#        state_class: total_increasing
        
#     - name: "Generator Status"
#        data_type: uint16
#        scale: 1
#        slave: 51
#        address: 77
#        device_class: energy
#       
#      - name: "Generator to Battery This Hour"
#        data_type: uint32
#        unit_of_measurement: kWh
#        scale: 0.001
#        precision: 1
#        slave: 90
#        address: 192
#        device_class: energy
#        state_class: total_increasing
 
Last edited:
Can I have more than one connection via TCP? So I can pull data from port 502 & 503?

EDIT: I have read up on mulitiple connections and am still having some difficulty. Will either of you please post your config?

YAML:
#data_type: int, uint, float, string, custom (default int)
#count: 1, 2 (default 1 for 16-bit register, 2 for 32-bit register)
#input_type: holding, input (default holding)


# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

#sensor: !include sensors.yaml

influxdb:
  host: a0d7b954-influxdb
  port: 8086
  database: homeassistant
  username: homeassistant
  password: homeassistant
  max_retries: 3
  default_measurement: state
 
modbus:
  - name: BMS
    type: tcp
    host: 192.168.1.179
    port: 502
    delay: 2
    timeout: 15

  - name: conext_gateway
    type: tcp
    host: 192.168.1.179
    port: 503
    delay: 2
    timeout: 15
    sensors:

################################################################################################################
################################################################################################################
################################################################################################################
##########                   SEMB_BMS 0 Modbus SlaveAddress (Port 503): 230                            #########
################################################################################################################
################################################################################################################
################################################################################################################
      - name: "EG4 Internal BMS - Battery SOC"
        data_type: uint16
        unit_of_measurement: V
        scale: 1
        slave: 230
        address: 40081

################################################################################################################
################################################################################################################
################################################################################################################
##########                   XW Pro 6848 Modbus SlaveAddress (Port 503): 171                           #########
################################################################################################################
################################################################################################################
################################################################################################################

      - name: "0 - XW 4868 Inverter Enabled"
        data_type: uint16
        input_type: input
        slave: 10
        address: 71
        scan_interval: 1

      - name: "0 - XW 4868 Active Faults Flag"
        data_type: uint16
        input_type: input
        slave: 10
        address: 75
        scan_interval: 1

      - name: "0 - XW 4868 Active Warnings Flag"
        data_type: uint16
        input_type: input
        slave: 10
        address: 76
        scan_interval: 1

      - name: "0 - XW 4868 Battery Current"
        data_type: int32
        input_type: input
        count: 2
        slave: 10
        address: 82
        unit_of_measurement: A
        scale: 0.001
        offset: 0
        precision: 3
        scan_interval: 1

      - name: "0 - XW 4868 Battery Power"
        data_type: int32
        input_type: input
        count: 2
        slave: 10
        address: 84
        scale: 1
        offset: 0
        precision: 0
        device_class: energy
        unit_of_measurement: W
        scan_interval: 1

      - name: "0 - XW 4868 Battery Temperature"
        data_type: uint16
        input_type: input
        slave: 10
        address: 86
        unit_of_measurement: degC
        scale: 0.01
        offset: -273
        precision: 2
        scan_interval: 1

      - name: "0 - XW 4868 Inverter Status"
        data_type: uint16
        input_type: input
        slave: 10
        address: 122
        scan_interval: 1


      - name: "0 - XW 4868 Load AC Voltage"
        data_type: uint32
        input_type: input
        count: 2
        slave: 10
        address: 140
        unit_of_measurement: V
        scale: 0.001
        offset: 0
        precision: 3
        scan_interval: 1

      - name: "0 - XW 4868 Load AC Current"
        data_type: int32
        input_type: input
        count: 2
        slave: 10
        address: 150
        unit_of_measurement: A
        scale: 0.001
        offset: 0
        precision: 3
        scan_interval: 1


      - name: "0 - XW 4868 Load AC Frequency"
        data_type: uint16
        input_type: input
        slave: 10
        address: 152
        unit_of_measurement: Hz
        scale: 0.01
        offset: 0
        precision: 2
        scan_interval: 1


      - name: "0 - XW 4868 Load AC Power"
        data_type: int32
        input_type: input
        count: 2
        slave: 10
        address: 154
        unit_of_measurement: W
        scale: 1
        offset: 0
        precision: 0
        scan_interval: 1

#############UNUSED###########################

#      - name: "Load AC Power"
#        data_type: uint32
#        unit_of_measurement: W
#        scale: 1
#        slave: 90
#        address: 132
#        device_class: energy
       
#      - name: "AC Input Power"
#        data_type: uint32
#        unit_of_measurement: W
#        scale: 1
#        slave: 90
#        address: 100
#        device_class: energy
       
#      - name: "Charge DC Power"
#        data_type: uint32
#        unit_of_measurement: W
#        scale: 1
#        slave: 90
#        address: 92
#        device_class: energy
#      
#      - name: "Load Output Energy Today"
#        data_type: uint32
#        unit_of_measurement: kWh
#        scale: 0.001
#       precision: 1
#        slave: 90
#        address: 220
#        device_class: energy
#        state_class: total_increasing
#      
#      
#      - name: "Energy From Battery This Hour"
#        data_type: uint32
#        unit_of_measurement: kWh
#        scale: 0.001
#        precision: 1
#        slave: 90
#        address: 144
#        device_class: energy
#        state_class: total_increasing
#      
#      
#      - name: "Energy to Battery This Hour"
#        data_type: uint32
#        unit_of_measurement: kWh
#        scale: 0.001
#        precision: 1
#        slave: 90
#        address: 168
#        device_class: energy
#        state_class: total_increasing
       
#     - name: "Generator Status"
#        data_type: uint16
#        scale: 1
#        slave: 51
#        address: 77
#        device_class: energy
#      
#      - name: "Generator to Battery This Hour"
#        data_type: uint32
#        unit_of_measurement: kWh
#        scale: 0.001
#        precision: 1
#        slave: 90
#        address: 192
#        device_class: energy
#        state_class: total_increasing
From the docs, it looks like when you are using multiple connections, you can add hub: with the name of the connection you want to use.

For example, for your BMS, something like this should work:

- name: "EG4 Internal BMS - Battery SOC"
data_type: uint16
unit_of_measurement: V
scale: 1
slave: 230
address: 40081
hub: BMS

Then on the entries you want to use the insight or conext gateway for, add hub: conext_gateway or whatever name you used for the initial connection configuration.

Be aware, I haven't tried this yet. This is purely my understanding from the docs.
 
@n2aws I think we may need to setup a GitHub and host a library of ready to use examples there. I'll get around to it next week.

@NewGuyNoob I think your problem is the YAML. Something similar to this should work.

YAML:
modbus:
  - name: BMS
    type: tcp
    host: 192.168.1.179
    port: 502
    delay: 2
    timeout: 15
    sensors:
      - name: "EG4 Internal BMS - Battery SOC"
        data_type: uint16
        unit_of_measurement: V
        scale: 1
        slave: 230
        address: 40081
      
  - name: BMS
    type: tcp
    host: 192.168.1.179
    port: 502
    delay: 2
    timeout: 15
    sensors:
      - name: "0 - XW 4868 Inverter Enabled"
          data_type: uint16
          input_type: input
          slave: 10
          address: 71
          scan_interval: 1
 
@sancsam I have tried this below. I have port 502 in the "BMS" entry and port "503" to pull from the gateway... Is this the correct way? It is failing for me.

YAML:
modbus:

  - name: BMS
    type: tcp
    host: 192.168.1.179
    port: 502
    delay: 2
    timeout: 15
   
   
    sensors:
################################################################################################################
################################################################################################################
################################################################################################################
##########                   SEMB_BMS 0 Modbus SlaveAddress (Port 502): 230                            #########
################################################################################################################
################################################################################################################
################################################################################################################

      - name: "EG4 Internal BMS - Battery SOC"
        data_type: uint16
        unit_of_measurement: V
        scale: 1
        slave: 230
        address: 40081
       

################################################################################################################
################################################################################################################
################################################################################################################
##########                   XW Pro 6848 Modbus SlaveAddress (Port 503): 171                           #########
################################################################################################################
################################################################################################################
################################################################################################################

  - name: conext_gateway
    type: tcp
    host: 192.168.1.179
    port: 503
    delay: 2
    timeout: 15
   
   
    sensors:

      - name: "0 - XW 4868 Inverter Enabled"
        data_type: uint16
        input_type: input
        slave: 10
        address: 71
        scan_interval: 1


error:
2023-08-24 15:14:44.461 ERROR (SyncWorker_4) [homeassistant.components.modbus.modbus] Pymodbus: BMS: Modbus Error: [Connection] ModbusTcpClient(192.168.1.179:502): Connection unexpectedly closed 5.269050598144531e-05 seconds into read of 8 bytes without response from unit before it closed connection
 
@n2aws I think we may need to setup a GitHub and host a library of ready to use examples there. I'll get around to it next week.

@NewGuyNoob I think your problem is the YAML. Something similar to this should work.

YAML:
modbus:
  - name: BMS
    type: tcp
    host: 192.168.1.179
    port: 502
    delay: 2
    timeout: 15
    sensors:
      - name: "EG4 Internal BMS - Battery SOC"
        data_type: uint16
        unit_of_measurement: V
        scale: 1
        slave: 230
        address: 40081
    
  - name: BMS
    type: tcp
    host: 192.168.1.179
    port: 502
    delay: 2
    timeout: 15
    sensors:
      - name: "0 - XW 4868 Inverter Enabled"
          data_type: uint16
          input_type: input
          slave: 10
          address: 71
          scan_interval: 1
[/QUOTE]

[QUOTE="sancsam, post: 857809, member: 83333"]


I don't think this code will work. The docs say that "name" needs to be unique when defining more than 1 modbus TCP connection.

I think it's going to be more like:



YAML:
modbus:  
  - name: bms
    type: tcp
    host: 192.168.1.179
    port: 502
    delay: 2
    timeout: 15

  - name: insight
    type: tcp
    host: 192.168.1.179
    port: 503
    delay: 2
    timeout: 15

     sensors:
        - name: "EG4 Internal BMS - Battery SOC"
          data_type: uint16
          unit_of_measurement: V
          scale: 1
          slave: 230
          address: 40081
          hub: bms

        - name: "0 - XW 4868 Inverter Enabled"
          data_type: uint16
          input_type: input
          slave: 10
          address: 71
          scan_interval: 1
          hub: insight
 
I don't think this code will work. The docs say that "name" needs to be unique when defining more than 1 modbus TCP connection.
You are right. I forgot the change the name of the connection.


I just tested the following config.

YAML:
modbus:
  - name: BMS
    type: tcp
    host: 192.168.1.179
    port: 502
    delay: 2
    timeout: 15
    sensors:
      - name: "EG4 Internal BMS - Battery SOC"
        data_type: uint16
        unit_of_measurement: V
        scale: 1
        slave: 230
        address: 40081
 
  - name: insight
    type: tcp
    host: 192.168.1.179
    port: 503
    delay: 2
    timeout: 15
    sensors:
      - name: "XW 6848 Inverter Enabled"
        data_type: uint16
        input_type: input
        slave: 10
        address: 71
        scan_interval: 1

Your error may be due to incorrect slave device address. Confirm that it is the correct slave address on both the BMS and the XW.

They slave address can be found on each device Configuration (Advance) - > Modbus Settings

I tried @n2aws config and was not able to make it work with the hub attribute. I think it's used for writing.
1692958162718.png
 
Last edited:
Looks like I was pulling data, but the poll was set to be too high, therefore the connection was being reset. I am trying different polling intervals now such as: scan_interval: 60

Thank you @n2aws & @sancsam for all the help! I'm going to now look for other useful registers.

1692966181384.png

@sancsam could you post your config yaml here? Id like to see what information you have decided to use in your dashboard.... is that ok?

@attached BMS MODBUS MAP for port 502
 

Attachments

  • Battery Management System Modbus 502 spec 990-91344B.pdf
    396.4 KB · Views: 7
Last edited:
Just curious,

How did we determine that the BMS info is not available on port 503?

I'm not doubting that the info is accurate, but how did we figure out that the data was missing, and is this something we should report to Schneider?
 
Just curious,

How did we determine that the BMS info is not available on port 503?

I'm not doubting that the info is accurate, but how did we figure out that the data was missing, and is this something we should report to Schneider?
If you look at the modbus settings on each device you will see that the devices that exist on both 502 and 503 have an option to configure the server address for both. See below.
1692991020967.png

Devices that exist only on 503. See below.
1692991109425.png
1692991193135.png

And the BMS that doesn't say which port but only has one setting which we could assume its only supported on one port.
1692991516531.png


Also, the Modbus map for the BMS only exist on the 502 folders of the Modbus map documents.
 
Last edited:
If you look at the modbus settings on each device you will see that the devices that exist on both 502 and 503 have an option to configure the server address for both. See below.
View attachment 164490

Devices that exist only on 503. See below.
View attachment 164491
View attachment 164492

And the BMS that doesn't say which port but only has one setting which we could assume its only supported on one port.
View attachment 164494


Also, the Modbus map for the BMS only exist on the 502 folders of the Modbus map documents.
Good lord, man. I never even realized that some items only showed up on one or the other in the UI.

Thanks for that!
 
Good lord, man. I never even realized that some items only showed up on one or the other in the UI.

Thanks for that!
Yeah, a lot of these things aren't properly documented/not documented at all, and Tech support is not much help. ?

I think your idea of the GitHub is the way to go to share all these Modbus examples. I can probably get around to it after next week and share it.

@sancsam could you post your config yaml here? Id like to see what information you have decided to use in your dashboard.... is that ok?

@NewGuyNoob Im using another system to get/store/visualize the schneider Modbus data but I want to move to homeassistant. I will share when done. Right now, I'm only using enough information for basic status and to change XW Inverter settings on different triggers.

In my system I have two XWPro. I have my system setup for grid export and leave the battery at 60%-70% SOC. I have a command to change those parameters on both XW at the same time to charge to 100% SOC. I use it if there is a storm warning, or the power company announces possible load shed due to not enough generation. By having the system at 50%-70% for many days the BMS SOC is off, so I have a trigger weekly to disable grid export and charge the battery bank to 56V so that the BMS recalibrate the SOC.
 
Back
Top