hn / ginlong-solis

Solis inverter ESP8266 data logger, S3 WiFi stick reverse engineering and ESPhome firmware
76 stars 13 forks source link

ESPHome missing sensors versus SolisCloud integration #28

Closed TheGroundZero closed 1 month ago

TheGroundZero commented 2 months ago

I'm (currently) not using many sensors that the inverter provides, but I noticed there is a difference between what I used to get from SolisCloud versus what ESPHome now reports.

SolisCloud / ESPHome SolisCloudESPHome

Notably, I appear to be missing the Solis AC Output Total Power which depicts my solar production, and Solis Battery Power which shows me power flowing to/from the battery. Unless that's what Total DC output power is supposed to report? It's reporting 0W while I would expect to still be drawing power from my battery as it's still 45% full. Active Power perhaps? Or does that include solar?

Also, somehow the Solis integration was reporting 2493kWh of Total Energy produced, while ESPHome now "only" reports 2486kWh? I did, shortly, have a different Solis inverter before it got replaced with my current, so maybe the first only produced 7kWh and the SolisCloud integration is reporting the sum of the 2 although it created 2 devices for the 2 inverters?

hn commented 2 months ago

Unless that's what Total DC output power is supposed to report? It's reporting 0W while I would expect to still be drawing power from my battery as it's still 45% full. Active Power perhaps? Or does that include solar?

Maybe the ModBus register map helps to understand the meaning of specific values -- or to add more registers. I do not own an ESINV type inverter.

I did, shortly, have a different Solis inverter before it got replaced with my current, so maybe the first only produced 7kWh and the SolisCloud integration is reporting the sum of the 2 although it created 2 devices for the 2 inverters?

Sounds reasonable.

TheGroundZero commented 2 months ago

Maybe the ModBus register map helps to understand the meaning of specific values -- or to add more registers. I do not own an ESINV type inverter.

OK, got it. Total DC output power is PV production. image

These look interesting for monitoring my battery: image image

This is the one I actually need image

sensor:
  - platform: modbus_controller
    modbus_controller_id: modbus_master
    name: Battery voltage
    device_class: voltage
    state_class: measurement
    unit_of_measurement: V
    register_type: read
    address: 33133
    value_type: U_WORD
    accuracy_decimals: 2
    filters:
      - multiply: 0.1
  - platform: modbus_controller
    modbus_controller_id: modbus_master
    name: Battery current
    device_class: current
    state_class: measurement
    unit_of_measurement: A
    register_type: read
    address: 33134
    value_type: S_WORD
    accuracy_decimals: 2
    filters:
      - multiply: 0.1
  # This one is only to debug, see binary_sensor below
  - platform: modbus_controller
    modbus_controller_id: modbus_master
    name: Battery current direction
    register_type: read
    address: 33135
    value_type: U_WORD
  - platform: modbus_controller
    modbus_controller_id: modbus_master
    name: Battery charge current limitation
    device_class: current
    state_class: measurement
    unit_of_measurement: A
    register_type: read
    address: 33143
    value_type: U_WORD
    accuracy_decimals: 2
    filters:
      - multiply: 0.1
  - platform: modbus_controller
    modbus_controller_id: modbus_master
    name: Battery discharge current limitation
    device_class: current
    state_class: measurement
    unit_of_measurement: A
    register_type: read
    address: 33144
    value_type: U_WORD
    accuracy_decimals: 2
    filters:
      - multiply: 0.1
  - platform: modbus_controller
    modbus_controller_id: modbus_master
    name: Battery power
    device_class: power
    state_class: measurement
    unit_of_measurement: W
    register_type: read
    address: 33149
    value_type: S_DWORD
    accuracy_decimals: 0

Now to turn the 33135 into a binary_sensor, but 0 and 1 need to be reversed.

binary_sensor:
  - platform: modbus_controller
    modbus_controller_id: modbus_master
    name: Battery current direction
    device_class: battery_charging
    register_type: read
    address: 33135
    # Some lambda or filter to turn 0 into on/true and 1 into off/false
    # battery_charging: on means charging, off means not charging
hn commented 2 months ago

The invert filter may help.

Please feel free to submit a reasonable set of additional sensors for inclusion into the ESINV yaml when you have completed your tests and you are convinced that the values are relevant to most users.

TheGroundZero commented 2 months ago

Some of these I disabled in the ESPHome code already (can be made available on-demand), others I've disabled myself because I don't actively monitor them.

Imo, all registers should be read out, many of which could be hidden by default, so that the user has the option to enable/disable the sensors they want.

image