Giter VIP home page Giter VIP logo

esphome-solax-x1-mini's Introduction

esphome-solax-x1-mini

GitHub actions GitHub stars GitHub forks GitHub watchers "Buy Me A Coffee"

ESPHome component to monitor a Solax X1 mini via RS485.

Lovelace entities card

Supported devices

  • SolaX X1 Mini
    • SolaX X1 Mini X1-0.6-S-D(L)
  • SolaX X1 Mini G2
    • SolaX X1 Mini X1-1.5-S-D(L) (master version 1.08, manager version 1.07) (reported by @beocycris)
    • SolaX X1 Mini X1-2.0-S-D(L) (master version 1.08, manager version 1.07) (reported by @zcloud-at)
  • SolaX X1 Mini G3
    • SolaX X1 Mini X1-0.6-S-D(L) (master version 1.08, manager version 1.07) (reported by @neujbit)

Requirements

  • ESPHome 2024.6.0 or higher.
  • One half of an ethernet cable with RJ45 connector
  • RS485-to-TTL module (HW-0519 f.e.)
  • Generic ESP32 or ESP8266 board

Schematics

RS485-TTL module without flow control pin

               RS485                        UART
┌─────────┐              ┌─────────────┐           ┌─────────────────┐
│         │              │          GND│<--------->│GND              │
│  Solax  │<-----B- ---->│  RS485   RXD│<--------->│RX    ESP32/     │
│ X1 Mini │<---- A+ ---->│  to TTL  TXD│<--------->│TX    ESP8266    │
│         │<--- GND ---->│  module  VCC│<--------->│3.3V          VCC│<--
│         │              │             │           │              GND│<--
└─────────┘              └─────────────┘           └─────────────────┘

RS485-TTL module with flow control pin

               RS485                        UART
┌─────────┐              ┌─────────────┐           ┌─────────────────┐
│         │              │           DI│<--------->│TX               │
│  Solax  │<-----B- ---->│  RS485    DE│<--\       │         ESP32/  │
│ X1 Mini │<---- A+ ---->│  to TTL   RE│<---+----->│GPIO0   ESP8266  │
│         │<--- GND ---->│  module   RO│<--------->│RX               │
│         │              │             │           │                 │
│         │              │          VCC│<--------->│3.3V          VCC│<--
│         │              │          GND│<--------->│GND           GND│<--
└─────────┘              └─────────────┘           └─────────────────┘

Please make sure to power the RS485 module with 3.3V because it affects the TTL (transistor-transistor logic) voltage between RS485 module and ESP.

X1 Mini RJ45 connector

Pin Purpose RS485-to-TTL pin Color T-568B
1 RefGen
2 Com/DRM0
3 GND_COM
4 A+ A+ Blue
5 B- B- Blue-White
6 E_Stop
7 GND_COM GND Brown-White
8 --

Installation

You can install this component with ESPHome external components feature like this:

external_components:
  - source: github://syssi/esphome-solax-x1-mini@main

or just use the esp32-example.yaml / esp8266-example.yaml as proof of concept:

# Install esphome
pip3 install esphome

# Clone this external component
git clone https://github.com/syssi/esphome-solax-x1-mini.git
cd esphome-solax-x1-mini

# Create a secrets.yaml containing some setup specific secrets
cat > secrets.yaml <<EOF
wifi_ssid: MY_WIFI_SSID
wifi_password: MY_WIFI_PASSWORD

mqtt_host: MY_MQTT_HOST
mqtt_username: MY_MQTT_USERNAME
mqtt_password: MY_MQTT_PASSWORD
EOF

# Validate the configuration, create a binary, upload it, and start logs
# If you use a esp8266 run the esp8266-examle.yaml
esphome run esp32-example.yaml

For a more advanced setup take a look at the esp32-example-advanced-multiple-uarts.yaml.

Known issues

All known firmware versions (V1.00) responds with the same serial number (3132333435363737363534333231) to the discovery broadcast (AA.55.01.00.00.00.10.00.00.01.10). For this reason it's challenging to use multiple devices on the same bus and assign an individual address per device.

Affected firmware versions:

  • 618.00207.00_X1_BOOST3.0_MINI2.0_AIR2.0_ARM_V1.32_20210625.usb, 618.00381.00_X1_BOOST3.0_MINI2.0_AIR2.0_DSP_V2.12_20210622.usb

Workaround: Use one UART per device to handle multiple devices.

Debugging

If this component doesn't work out of the box for your device please update your configuration to enable the debug output of the UART component and increase the log level to the see outgoing and incoming serial traffic:

logger:
  level: VERY_VERBOSE
  logs:
    scheduler: DEBUG
    component: DEBUG

uart:
  id: uart_0
  baud_rate: 9600
  tx_pin: ${tx_pin}
  rx_pin: ${rx_pin}
  debug:
    direction: BOTH

Protocol details

Discovery

# Send discovery to broadcast address (0x10 0x00)
[VV][solax_modbus:200]: TX -> AA.55.01.00.00.00.10.00.00.01.10 (11)
[VV][solax_modbus:084]: RX <- AA.55.00.FF.01.00.10.80.0E.31.32.33.34.35.36.37.37.36.35.34.33.32.31.05.75 (25)
                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[I][solax_modbus:105]: Inverter discovered. Serial number: 3132333435363737363534333231

# Assign address (0x0A) to the inverter via serial number (0x10, 0x01)
[VV][solax_modbus:200]: TX -> AA.55.00.00.00.00.10.01.0F.31.32.33.34.35.36.37.37.36.35.34.33.32.31.0A.04.01 (26)
                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                   Byte   0  1  2  3  4  5  6  7  8  9 10 11 12 13 14

# Register address confirmation (0x10, 0x81)
[VV][solax_modbus:084]: RX <- AA.55.00.0A.00.00.10.81.01.06.01.A1 (12)
                                                    ^
                                                    ACK

Request device infos

# Request info (0x11 0x03)
[18:13:12][VV][solax_modbus:214]: TX -> AA.55.01.00.00.0A.11.03.00.01.1E (11)

# Response (0x11 0x83)
[18:13:12][VV][solax_modbus:084]: RX <- AA.55.00.0A.01.00.11.83.3A.01.00.00.00.00.00.00.56.31.2E.30.30.20.20.20.20.20.20.20.20.20.20.20.20.20.20.73.6F.6C.61.78.20.20.20.20.20.20.20.20.20.58.4D.55.30.36.32.47.43.30.39.33.35.34.30.33.36.30.30.0C.0F (69)
                                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Data  0      (device type?):      0x01 (single phase)
Data  1...6  (rated power):       0x00 0x00 0x00 0x00 0x00 0x00 ()
Data  7...11 (firmware version):  0x56 0x31 0x2E 0x30 0x30 (V1.00)
Data 12...25 (module name):       0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 ( )
Data 26...39 (factory name):      0x73 0x6F 0x6C 0x61 0x78 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 (solax )
Data 40...53 (serial number):     0x58 0x4D 0x55 0x30 0x36 0x32 0x47 0x43 0x30 0x39 0x33 0x35 0x34 0x30 (XMU062GC093540)
Data 54...57 (rated bus voltage): 0x33 0x36 0x30 0x30 (3600)

Request live data

# Request live data (0x11 0x02)
[18:15:15][VV][solax_modbus:214]: TX -> AA.55.01.00.00.0A.11.02.00.01.1D (11)

# Response (0x11 0x82)
[18:15:15][VV][solax_modbus:214]: RX <-
AA.55.00.0A.01.00.11.82.34.00.19.00.01.02.46.00.00.00.0A.00.00.00.05.09.13.13.87.00.32.FF.FF.00.00.00.11.00.00.00.14.00.02.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.02.D0.06.21 (63)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Data  0...1  (temperature):        0x00 0x19 (25 C)
Data  2...3  (energy today):       0x00 0x01 (0.1 kWh)
Data  4...5  (pv1 voltage):        0x02 0x46 (58.2 V)
Data  6...7  (pv2 voltage):        0x00 0x00 (0.0 V)
Data  8...9  (pv1 current):        0x00 0x0A (1.0 A)
Data 10...11 (pv2 current):        0x00 0x00 (0.0 A)
Data 12...13 (ac current):         0x00 0x05 (0.5 A)
Data 14...15 (ac voltage):         0x09 0x13 (232.3V)
Data 16...17 (ac frequency):       0x13 0x87 (49.99 Hz)
Data 18...19 (ac power):           0x00 0x32 (50 W)
Data 20...21 (unused):             0xFF 0xFF
Data 22...25 (energy total):       0x00 0x00 0x00 0x11 (0.1 kWh)
Data 26...29 (runtime total):      0x00 0x00 0x00 0x14 (20 h)
Data 30...31 (mode):               0x00 0x02 (2: Normal)
Data 32...33 (grid voltage fault): 0x00 0x00 (0.0 V)
Data 34...35 (grid freq. fault)    0x00 0x00 (0.00 Hz)
Data 36...37 (dc injection fault): 0x00 0x00 (0 mA)
Data 38...39 (temperature fault):  0x00 0x00 (0 °C)
Data 40...41 (pv1 voltage fault):  0x00 0x00 (0 V)
Data 42...43 (pv2 voltage fault):  0x00 0x00 (0 V)
Data 44...45 (gfc fault):          0x00 0x00 (0 mA)
Data 46...49 (error message):      0x00 0x00 0x00 0x00 (No error)
Data 50...52 (ct pgrid):           0x02 0xD0 (720 W)

References

esphome-solax-x1-mini's People

Contributors

syssi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

esphome-solax-x1-mini's Issues

Support for solax X1-1.1-S-D(L)

Hello,
I have a Solax inverter Model X1-1.1-S-D(L) version Manager.1.07 Master: 1.08 to which I have connected an RS485-to-TTL module and a Wemos D1 mini pin TX (GPIO1) and RX (GPIO3) . Unfortunately I cannot recover the data from my inverter. See logs:
log
With my oscilloscope I see signals on the TX / RX pins and I see the TX led of RS485 converter blink periodically.
It looks like my inverter modbus is not active. I tried passwords 2014 and 6868 but I have no option for modbus, only DRM (disable)
Could you help me ?`

Add Solax X1 Mini G3 support

i have a problem with the Solax x1 mini G3 with following errors
[07:18:49][W][solax_x1:083]: Invalid response size: 56
[07:18:49][W][solax_x1:085]: Your device is probably not supported. Please create an issue here: https://github.com/syssi/esphome-modbus-solax-x1/issues
[07:18:49][W][solax_x1:087]: Please provide the following status response data: 00.17.00.00.03.DE.00.00.00.08.00.00.00.05.09.06.13.85.00.48.FF.FF.00.00.00.28.00.00.00.0C.00.02.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.01.00.8A.00.DE (56)

Add additional sensor for measured faults

  // register 32: Grid voltage fault in 0.1V
  // register 34: Grid frequency fault in 0.01Hz
  // register 36: DC injection fault in 1mA
  // register 38: Temperature fault in °C
  // register 40: Pv1 voltage fault in 0.1V
  // register 42: Pv2 voltage fault in 0.1V
  // register 44: GFC fault

Meter fault (solax-meter-gateway)

Hallo,
nachdem ich endlich dazu gekommen bin das gateway live in betrieb zu nehmen, habe ich festgestellt, dass der Umrichter immer auf "Meter fault" stehen bleibt.
Wenn ich das Log richtig interpretiere, bekoomt das Gateway die Werte vom Meter und kommuniziert auch mit dem Solax Umrichter. Warum geht der Umrichter nicht in die Produktion.
Solax Umrichter ist unter Erweitert - Einspeisebegrenzung auf Meter gestellt und in der Begrenzung auf 20000 für unbegrenzt, oder 0 auf keine Einspeisung gestellt. Der Umrichter bleibt aber mit fehler ausser Betrieb.

Log
INFO ESPHome 2023.5.5
INFO Reading configuration /opt/iobroker/iobroker-data/esphome.0/solax-meter-gateway-esp32.yaml...
INFO Updating https://github.com/syssi/esphome-modbus-solax-x1.git@main
INFO Starting log output from solax-meter-gateway-esp32.local using esphome API
INFO Successfully connected to solax-meter-gateway-esp32.local
[17:53:58][I][app:102]: ESPHome version 2023.5.5 compiled on Jun 14 2023, 11:06:16
[17:53:58][I][app:104]: Project syssi.esphome-modbus-solax-x1 version 2.1.0
[17:53:58][C][wifi:505]: WiFi:
[17:53:58][C][wifi:363]: Local MAC: C4:4F:33:6A:XX:XX
[17:53:58][C][wifi:364]: SSID: 'xxxx'[redacted]
[17:53:58][C][wifi:365]: IP Address: x.x.x.x
[17:53:58][C][wifi:367]: BSSID: B4:FB:E4:74:xx:xx[redacted]
[17:53:58][C][wifi:368]: Hostname: 'solax-meter-gateway-esp32'
[17:53:58][C][wifi:370]: Signal strength: -71 dB ▂▄▆█
[17:53:58][C][wifi:374]: Channel: 11
[17:53:58][C][wifi:375]: Subnet: 255.255.255.0
[17:53:58][C][wifi:376]: Gateway: x.x.x.x
[17:53:58][C][wifi:377]: DNS1: x.x.x.x
[17:53:58][C][wifi:378]: DNS2: 8.8.8.8
[17:53:58][D][sensor:094]: 'solax-meter-gateway-esp32 instantaneous power consumption': Sending state 499.64001 W with 2 decimals of accuracy
[17:53:58][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:53:58][C][logger:301]: Logger:
[17:53:58][C][logger:302]: Level: DEBUG
[17:53:58][C][logger:303]: Log Baud Rate: 115200
[17:53:58][C][logger:305]: Hardware UART: UART0
[17:53:58][C][logger:309]: Level for 'scheduler': DEBUG
[17:53:58][C][uart.arduino_esp32:124]: UART Bus 1:
[17:53:58][C][uart.arduino_esp32:125]: TX Pin: GPIO17
[17:53:58][C][uart.arduino_esp32:126]: RX Pin: GPIO16
[17:53:58][C][uart.arduino_esp32:128]: RX Buffer Size: 256
[17:53:58][C][uart.arduino_esp32:130]: Baud Rate: 9600 baud
[17:53:58][C][uart.arduino_esp32:131]: Data Bits: 8
[17:53:58][C][uart.arduino_esp32:132]: Parity: NONE
[17:53:58][C][uart.arduino_esp32:133]: Stop bits: 1
[17:53:58][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:53:58][C][solax_meter_modbus:096]: SolaxMeterModbus:
[17:53:58][C][solax_meter_gateway:095]: SolaxMeterGateway:
[17:53:58][C][solax_meter_gateway:096]: Address: 0x01
[17:53:58][C][solax_meter_gateway:097]: Power Demand 'solax-meter-gateway-esp32 power demand'
[17:53:58][C][solax_meter_gateway:097]: Device Class: 'power'
[17:53:58][C][solax_meter_gateway:097]: State Class: ''
[17:53:58][C][solax_meter_gateway:097]: Unit of Measurement: 'W'
[17:53:58][C][solax_meter_gateway:097]: Accuracy Decimals: 0
[17:53:58][C][solax_meter_gateway:098]: Operation name 'solax-meter-gateway-esp32 operation mode'
[17:53:58][C][solax_meter_gateway:098]: Icon: 'mdi:heart-pulse'
[17:53:58][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:53:58][C][solax_meter_gateway.switch:068]: SolaxMeterGateway Switch 'solax-meter-gateway-esp32 emergency power off'
[17:53:58][C][solax_meter_gateway.switch:070]: Icon: 'mdi:power'
[17:53:58][C][solax_meter_gateway.switch:091]: Restore Mode: restore defaults to OFF
[17:53:58][C][solax_meter_gateway.switch:052]: Restore Mode: Restore (Defaults to OFF)
[17:53:58][C][mdns:108]: mDNS:
[17:53:58][C][mdns:109]: Hostname: solax-meter-gateway-esp32
[17:53:58][C][ota:093]: Over-The-Air Updates:
[17:53:58][C][ota:094]: Address: solax-meter-gateway-esp32.local:3232
[17:53:58][C][ota:097]: Using Password.
[17:53:58][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:53:58][C][api:138]: API Server:
[17:53:58][C][api:139]: Address: solax-meter-gateway-esp32.local:6053
[17:53:58][C][api:141]: Using noise encryption: YES
[17:53:58][C][mqtt:065]: MQTT:
[17:53:58][C][mqtt:067]: Server Address: 192.168.168.201:2884 (192.168.168.201)
[17:53:58][C][mqtt:068]: Username: 'sonoff'[redacted]
[17:53:58][C][mqtt:069]: Client ID: 'solax-meter-gateway-esp32-c44f336a5301'[redacted]
[17:53:58][C][mqtt:071]: Discovery prefix: 'homeassistant'
[17:53:58][C][mqtt:072]: Discovery retain: YES
[17:53:58][C][mqtt:074]: Topic Prefix: 'solax-meter-gateway-esp32'
[17:53:58][C][mqtt:076]: Log Topic: 'DEBUG'
[17:53:58][C][mqtt:079]: Availability: 'solax-meter-gateway-esp32/status'
[17:53:58][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:53:58][C][mqtt_subscribe.sensor:031]: MQTT Subscribe 'solax-meter-gateway-esp32 instantaneous power consumption'
[17:53:58][C][mqtt_subscribe.sensor:031]: Device Class: 'power'
[17:53:58][C][mqtt_subscribe.sensor:031]: State Class: ''
[17:53:58][C][mqtt_subscribe.sensor:031]: Unit of Measurement: 'W'
[17:53:58][C][mqtt_subscribe.sensor:031]: Accuracy Decimals: 2
[17:53:58][C][mqtt_subscribe.sensor:032]: Topic: SolaxPowerControl/P_Wirk_L1
[17:53:58][C][mqtt.sensor:027]: MQTT Sensor 'solax-meter-gateway-esp32 power demand':
[17:53:58][C][mqtt.sensor:031]: State Topic: 'solax-meter-gateway-esp32/sensor/solax-meter-gateway-esp32_power_demand/state'
[17:53:58][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:53:58][C][mqtt.text_sensor:023]: MQTT Text Sensor 'solax-meter-gateway-esp32 operation mode':
[17:53:58][C][mqtt.text_sensor:024]: State Topic: 'solax-meter-gateway-esp32/sensor/solax-meter-gateway-esp32_operation_mode/state'
[17:53:59][C][mqtt.switch:041]: MQTT Switch 'solax-meter-gateway-esp32 emergency power off':
[17:53:59][C][mqtt.switch:042]: State Topic: 'solax-meter-gateway-esp32/switch/solax-meter-gateway-esp32_emergency_power_off/state'
[17:53:59][C][mqtt.switch:042]: Command Topic: 'solax-meter-gateway-esp32/switch/solax-meter-gateway-esp32_emergency_power_off/command'
[17:53:59][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:53:59][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:53:59][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:53:59][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:53:59][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:53:59][D][sensor:094]: 'solax-meter-gateway-esp32 instantaneous power consumption': Sending state 492.48999 W with 2 decimals of accuracy
[17:53:59][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:53:59][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:53:59][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:00][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:00][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:00][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:00][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:00][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:00][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:00][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:01][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:01][D][sensor:094]: 'solax-meter-gateway-esp32 instantaneous power consumption': Sending state 502.89001 W with 2 decimals of accuracy
[17:54:01][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:01][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:01][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:01][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:01][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:01][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:02][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:02][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:02][D][sensor:094]: 'solax-meter-gateway-esp32 instantaneous power consumption': Sending state 488.06000 W with 2 decimals of accuracy
[17:54:02][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:02][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:02][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:02][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:02][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:02][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:03][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:03][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:03][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:03][D][sensor:094]: 'solax-meter-gateway-esp32 instantaneous power consumption': Sending state 489.59000 W with 2 decimals of accuracy
[17:54:03][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:03][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:03][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:03][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:04][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:04][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:04][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:04][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:04][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:04][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:04][D][sensor:094]: 'solax-meter-gateway-esp32 instantaneous power consumption': Sending state 487.17999 W with 2 decimals of accuracy
[17:54:04][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:04][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:05][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:05][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:05][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:05][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:05][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:05][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:05][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:06][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:06][D][sensor:094]: 'solax-meter-gateway-esp32 instantaneous power consumption': Sending state 493.38000 W with 2 decimals of accuracy
[17:54:06][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:06][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:06][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:06][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:06][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44
[17:54:06][D][uart_debug:114]: <<< 01:03:00:0B:00:01:F5:C8
[17:54:06][D][uart_debug:114]: >>> 01:03:02:00:00:B8:44

Similarities to SolarEdge SunSpec protocol ?

Anyone know is there any similarity with the Solax protocol over modbus to SunSpec used by other solar inverters including SolarEdge ?
Reason for asking is the possibility to fork this into a ESPhome-modbus-SolarEdge project.

Add flow control pin support

Hey guys,

thank for this modules. In my case I try to use it with a Solax X1 mini 1.5 V2.
And I only receive the text which is mentioned in the title.
May anyone has the same issue and can help me to fix it.

regards
frank

Feature Request: Override Switch for Export Control

Discussed in #60

Originally posted by Sven177 December 8, 2023
Having an Override Switch for the Meter Gateway, to toggle between either listening to an existing sensor´s value to determine the current power demand, or using a fixed value (like 500W) would be nice.

This would allow to "disable" the export control function on the Meter Gateway side whenever needed, while leaving the actual export control function of the Inverter (and according settings) still active and untouched.

(Hope this is the right way for a Feature Request - first time for me) 😉

Still problems with sporadic meter faults

Hi Sebastian,

the export control is basically working, and I am using 2x D1 Mini Boards for 2 separate inverters.
But sometimes, I get the meter fault error thrown by the inverter and I haven´t yet figured out why.
I found, that the source sensor for power consumption (Shelly 3EM) sometimes takes 10-15 seconds to update values regarding power consumption. To get around this, I added an heartbeat filter to the code, to send the source value to the power demand sensor every (tried) 3 or 5 seconds, even if the power consumtion sensor hasn´t been updated in between.

  name: solax-meter-gateway
  device_description: "Control the export of a Solax X1 mini via RS485"
  external_components_source: github://syssi/esphome-solax-x1-mini@main

external_components:
  - source: ${external_components_source}
    refresh: 0s

uart:
  - id: uart_0
    baud_rate: 9600
    tx_pin: GPIO12
    rx_pin: GPIO14

solax_meter_modbus:
  - id: modbus0
    uart_id: uart_0

solax_meter_gateway:
  solax_meter_modbus_id: modbus0
  address: 0x01
  # The state of this sensor (instantaneous power in watt) is used as source
  power_id: powermeter0
  power_sensor_inactivity_timeout: 25s
  update_interval: 1s

sensor:
  - platform: homeassistant
    id: powermeter0
    entity_id: sensor.power_consumption
    internal: true
    force_update: true
    filters:
      heartbeat: 5s

  - platform: solax_meter_gateway
    power_demand:
      name: "${name} power demand"

text_sensor:
  - platform: solax_meter_gateway
    operation_mode:
      name: "${name} operation mode"

But despite that change, sporadically the meter fault still shows up.
Any ideas what would cause this? Could it be related to using 2 Boards at 2 Inverters sharing the same code?

Out in the field currently (work related), will be back on Thursday to provide according logs or increase the Log Level

Add Solax X1 Mini G2 support

[15:42:31][VV][modbus_solax:218]: TX -> AA.55.01.00.00.0A.11.02.00.01.1D (11)
[15:42:31][VV][uart.arduino_esp8266:180]: Flushing...
[15:42:31][VV][modbus_solax:083]: RX <- 00.21.00.02.07.EF.00.00.00.1D.00 (11)
[15:42:31][W][modbus_solax:086]: Invalid header.
[15:42:32][VV][scheduler:185]: Running interval 'update' with interval=1000 last_execution=16039 (now=17046)
[15:42:32][VV][modbus_solax:218]: TX -> AA.55.01.00.00.0A.11.02.00.01.1D (11)
[15:42:32][VV][uart.arduino_esp8266:180]: Flushing...
[15:42:32][VV][modbus_solax:083]: RX <- AA.55.00.0A.01.00.11.82.32.00.21.00.02.07.EC.00.00.00.1D.00.00.00.18.09.55.13.80.02.2B.FF.FF.00.00.5D.AF.00.00.10.50.00.02.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.07.A4 (61)

[15:42:32][W][solax_x1:076]: Invalid response size: 50
[15:42:33][VV][scheduler:185]: Running interval 'update' with interval=1000 last_execution=17039 (now=18044)
[15:42:33][VV][modbus_solax:218]: TX -> AA.55.01.00.00.0A.11.02.00.01.1D (11)
[15:42:33][VV][uart.arduino_esp8266:180]: Flushing...
[15:42:33][VV][modbus_solax:083]: RX <- AA.55.00.0A.01.00.11.82.32.00.21.00.02.07.DB.00.00.00.1D.00.00.00.18.09.56.13.81.02.2C.FF.FF.00.00.5D.AF.00.00.10.50.00.02.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.07.96 (61)

can't connect to X1 Mini

I'm in a simiar position to the one another user was in here: #33

The output is the same, with this block repeated every few seconds:

[16:33:29][D][sensor:094]: 'solax-x1-mini temperature': Sending state nan °C with 0 decimals of accuracy
[16:33:29][D][sensor:094]: 'solax-x1-mini dc1 voltage': Sending state 0.00000 V with 1 decimals of accuracy
[16:33:29][D][sensor:094]: 'solax-x1-mini dc2 voltage': Sending state 0.00000 V with 1 decimals of accuracy
[16:33:29][D][sensor:094]: 'solax-x1-mini dc1 current': Sending state 0.00000 A with 1 decimals of accuracy
[16:33:29][D][sensor:094]: 'solax-x1-mini dc2 current': Sending state 0.00000 A with 1 decimals of accuracy
[16:33:29][D][sensor:094]: 'solax-x1-mini ac current': Sending state 0.00000 A with 1 decimals of accuracy
[16:33:29][D][sensor:094]: 'solax-x1-mini ac voltage': Sending state nan V with 1 decimals of accuracy
[16:33:29][D][sensor:094]: 'solax-x1-mini ac frequency': Sending state nan Hz with 2 decimals of accuracy
[16:33:29][D][sensor:094]: 'solax-x1-mini ac power': Sending state 0.00000 W with 0 decimals of accuracy
[16:33:29][D][solax_x1_mini:298]: The device is or was offline. Broadcasting discovery for address configuration...

I have checked the wiring on my RJ45 cable against the RS485 pinout in the X1 mini installation manual and everything's right. Multimeter says there's continuity on A+, B- and GND.

The light on the HW-219 flashes repeatedly so it does seem to be getting communication from at least one side. I've tried both GPIO1/3, which are my D1 mini 32's TX and RX pins, and GPIO16/17.

I was able to sign in to the advanced device menu through the Solax cloud with password 2014 and set the modbus support to "enable" and modbus address to "1".

I tried powering the HW-219 with 5v instead of 3.3 to see if a little extra power would help, but still got nothing.

Any ideas what to try next?

Looking for SDM230 protocol details

Maybe you have communication protocol Invertor <--> Meter

I am investigating:

Solax X1 mini:
That ask every second like a ping. That works.
send solax: b'\x01\x03\x00\x0e\x00\x01\xe5\xc9'
meter SDM230 not from Solax anw: b'\x01\x03\x02\x00\x00'

send solax: b'\x01\x03\x00\x0b\x00\x01\xf5\xc8'
meter SDM230 not from Solax anw: b'\x01\x03\x02\x00\x00'

But that probably Solax request Data:
send solax: b'\x01\x03\x00\x08\x00\x04\xc5\xcb'
meter SDM230 not from Solax anw: b'\x01\x03\x08\x00\x00\x00\x00\x00\x00\x00\x00'

Meter answer: 00 00 00 00 00 00 00 00
I do STM32 rs485 gateway, but need to know from Original Solax Meter what answer.

Maybe someone has that information? Thanks.

Add documentation how to use the `solax_meter_gateway`

The solax_meter_gateway can be used as SDM230-MID-SOLAX (SDM230 with solax firmware) drop-in replacement. The Solax inverter with export control: meter enabled setting will request the current power consumption periodically. The solax_meter_gateway responds to this request with a sensor measurement retrieved from another sensor/device.

How to enable the "export control: meter" mode:

Settings -> Pin: 6868 -> Export control -> Meter enable

See #32
See #20

Probably more Solax inverters are supported. This feature isn't limited to the Solax X1 series.

Solax X1 Mini with Limiter and SDM72 Smartmeter

Hello,
I looked at the Tread #20/32 but I don't understand what I need to adjust for my solution. I would like to control the Soalx inverter with the power meter. I'm using an SDM72 which is not from Solax but which counts 3 phases. Accordingly, the SDM72 also has consultative registers, as is the case with the SDM230 with the 30013 register. For the SDM72 it would be the register 30053 Total System Power. What does the digestion of the Modbus have to look like? AB from the Sloax parallel with Smartmeter and the esphome? The ESP Home only uses one UART. Does the ESPHOME convert any data between smartmeter ans solax inverter?

Many thanks in advance.

Greetings Dirk

Meter functionality

Hi There.
I stumbled upon this project, and I´m curious if there is some "external meter functionality" planned?

As you know Solax inverter support external power meters in order to be able to handle export control.
I have a larger PV set than allowed, thus I want to limit the power which gets exportet to the grid.

On the other hand I do not want to always limit the inverter output power because I want to use full PV power when some consumer in my House demands it.

As I have already a power meter installed (no modbus/not supported by Solax) and it´s values are available in my home network, it´d be great to have the possibility to feed these values to the Solax inverter.
Then I would be able to perfectly limit the exported power to the grid.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.