Hanchu Inverter Integrations

I did a quick network capture using dev tools and navigating to the above chart on the iESS platform.

For the battery it looks like you’ll need to use:

https://iess3.hanchuess.com/gateway/platform/bmsInfo/queryBatteryDataDivisions

Looking at the raw response data, it would appear the battery temp is value_json.data.tPack

Keep in mind each chart likely has its own payload.

Hope this helps point you in the right direction.

2 Likes

Hi, thanks for the reply :+1:

I’ve got the values, but don’t have a clue what to do with them in the configuration.yaml. This is way over my head :exploding_head:

The reason for wanting these temps is so that I can setup alerts. I’ve had this battery system installed since October 2025, and now have Pack 2 in error with high temp warning as seen below. I’m in contact with the installer etc, But I want to keep any eye on this as I don’t like these figures for Pack B.

Can you help further with the yaml code to get these imported? I don’t have a clue about any of this stuff & translating it into those temps😔

No worries if you can’t, I’m thankful for your help anyway.

sensor:
      - name: Solar Production Energy
        unique_id: solar_production_energy
        value_template: "{{ (value_json.data | selectattr('date', 'equalto', now().timestamp() | timestamp_custom('%Y-%m-%d')) | first).pvDge | default(states.sensor.solar_production_energy.state) }}"
        device_class: "energy"
        unit_of_measurement: "kWh"
        state_class: "total_increasing"

 sensor:
      - name: Solar Production
        unique_id: solar_production
        value_template: "{{ value_json.data.pvTtPwr | default(0) }}"
        device_class: "power"
        unit_of_measurement: "W"
        state_class: "measurement"

sensor:
  - platform: integration
    name: Solar Production Integral
    unique_id: solar_production_integral
    source: sensor.solar_production

Temps in Celsius (°C)

Battery Pack A

“tEnv”: “18.5”, - Environment Temp
“tPack”: “13.5”, - Battery Pack Temp
“tMos”: “13.9”, - PCBA Temp
“tBat1”: “13.9”, - Pack A Cell 1
“tBat2”: “13.3”, - Pack A Cell 2
“tBat3”: “13.6”, - Pack A Cell 3
“tBat4”: “13.4” - Pack A Cell 4

Battery Pack B

“tEnv”: “18.5”, - Environment Temp
“tPack”: “38.2”, - Battery Pack Temp
“tMos”: “13.9”, - PCBA Temp
“tBat1”: “12.9”, - Pack A Cell 1
“tBat2”: “13.0”, - Pack A Cell 2
“tBat3”: “114.0”, - Pack A Cell 3
“tBat4”: “13.1” - Pack A Cell 4

I’ve had a go at getting the data by adapting the original code - don’t laugh if I’m completely wrong as it’s all foreign to me. Looking through the Dev Tools I found the temps appeared in 2 places, and it’s own payload as below…

- resource: https://iess3.hanchuess.com/gateway/platform/bmsInfo/queryBatteryDataDivisions
    method: POST
    headers:
      access-token: >
        {{ states("sensor.hanchu_auth_token") }}
      Content-Type: "text/plain"
    payload: "T8tuwnq----------Mescbq0="
    scan_interval: 120
    sensor:
      - name: Battery A Temp
        unique_id: batterya_packtemp
        value_template: "{{ value_json.data.tPack }}"
        device_class: "temperature"
        unit_of_measurement: "°C"
        state_class: "measurement"
  - resource: https://iess3.hanchuess.com/gateway/platform/bmsInfo/powerMinuteChart
    method: POST
    headers:
      access-token: >
        {{ states("sensor.hanchu_auth_token") }}
      Content-Type: "text/plain"
    payload: "ZjDEfIXCzFiLXdmDq9s-------PBoFCVQ="
    scan_interval: 120
    sensor:
      - name: A Battery Temp
        unique_id: battery_apacktemp
        value_template: "{{ value_json.data.tPack }}"
        device_class: "temperature"
        unit_of_measurement: "°C"
        state_class: "measurement"

The sensors appear in HA, but have no data/values. Checking in the HA log files I see this

Logger: homeassistant.helpers.template
Source: helpers/template/__init__.py:1757
First occurred: 11:10:05 (24 occurrences)
Last logged: 11:12:06

Template variable error: 'dict object' has no attribute 'data' when rendering '{{ ((value_json.data.batP|default(0)|int - value_json.data.batP|default(0)|int|abs) / 2)|abs }}'
Template variable error: 'dict object' has no attribute 'data' when rendering '{{ (value_json.data.batP|default(0)|int|abs + value_json.data.batP|default(0)|int) / 2 }}'
Template variable error: 'dict object' has no attribute 'data' when rendering '{{ (value_json.data.batP|default(0)|int) * (-1) }}'
Template variable error: 'dict object' has no attribute 'data' when rendering '{{ (value_json.data.batSoc|default(0)|float * 100)|int }}'
Template variable error: 'dict object' has no attribute 'data' when rendering '{{ value_json.data.tPack }}'

Any ideas or am I just out of luck and these temperatures can’t be ‘had’ for the use?

UPDATE…
Found issue. The payload for historyStaticsChart has been updated for month change. The REST needs to be updated with new payload.

I updated the rest (having your original) last month & its been working great. However at midnight all the information for the below have returned unknown:
home_usage_energy (loadEe)
grid_import_energy (gridTdEe)
grid_export_energy (gridTdFe)
battery_discharge_energy (batTdDschg)
battery_charge_energy (batTdChg)

I have attached a copy of the log. Any ideas?