Huawei Power Meter DTSU-666-H Modbus

Hello,

does somebody already add the Power Meter from Huawei with a Modbus TCP to RTU Converter?
I need the configuration specially the modbus register how can I add the Power Meter directly to the HA?

My problem is that I need two Power Meters in my configuration because I have two flats in one house.
But I can only connect one Power Meter to the inverter.

Thank`s a lot

Hello Martin,

as there is no answer yet I can at least partially answer that for you.
I am currently reading a DTSU666-H 250A with current transformers (I think there is no difference communication wise to the model without tranformers) via a modbus RTU to TCP converter.
I may add though, that I switched from home assistant to another home automation some time ago.
But as I am using a generic modbus tcp slave where I defined the registers myself I am confident HomeAssistant will work just as well for you.

Having two power meters in the bus will be no problem, as you can simply daisy-chain the meters and connect the bus to the modbus RTU/TCP converter.
Please keep in mind that you will need to setup the members on the bus correctly. For at least one of the meters you have to adjust the modbus address. Thats a quite simple process and well documented in the Quick guide you can download from the huawei website (DTSU666-H 100 A and 250 A Smart Power Sensor User Manual - Huawei). Please be also aware that you will need a seperate Modbus TCP slave for each member on the bus and set the same member-ID as you set on the meters.

Concerning the registers for me the ones I found in the CHINT quick operation manual worked. At least the ones I wanted: reactive power (total and all Phases) as well as total exported and total imported energy. I have attached some screenshots, as I found the document more or less just by accident and it really helped. Got it from https://www.vicoexport.com/wp-content/uploads/2021/06/Manual-Chint-DTSU666-D-Vico-Export-Solar-Energy.pdf



Hi
I’m made custom integration to Chint(Huawei) DTSU-666-h, that can work with serial or tcp:

I’m have’t tested with serial connection, but i’m using modbus tcp converter.
I’m currently working readme, if have any question please tell me

If you have any problem with component, please report issue, and i will try to fix.

1 Like

Hi Lajos,

Could you make a version for DDSU666 if it’s not too much work?, Is the mono-phase version of chint. I don´t have many skills for programming…or give me basic instructions to try…many thanks.

Regards.

Hi, this is my code with EspHome. I hope it helps you. Let me know if it’s right for you.

esphome:
  name: "chint-meter"
  friendly_name: Esp32

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
  level: verbose
  baud_rate: 0

#web_server:
  #port: 80

# Enable Home Assistant API
api:
  encryption:
    key: "xxxx"

ota:
  password: "xxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
 
  #manual_ip:
    #static_ip: 192.168.1.234
    #gateway: 192.168.1.254
    #subnet: 255.255.255.0
    #dns1: 192.168.1.254
    #dns2: 8.8.4.4

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp32 Fallback Hotspot"
    password: "xxxx"

captive_portal:
###
uart:
  id: mod_bus
  tx_pin: 03
  rx_pin: 01
  baud_rate: 9600
  stop_bits: 1

modbus:
  flow_control_pin: 5
  id: modbus1

modbus_controller:
    address: 0x001
    modbus_id: modbus1
    update_interval: 1s
    setup_priority: -10

sensor:
 - platform: modbus_controller
   id: chint_voltage
   name: "Chint Tensione"
   address: 0x2000
   unit_of_measurement: "V" ## for any other unit the value is returned in minutes
   register_type: holding
   value_type: FP32
   accuracy_decimals: 2
   filters:
     - multiply: 1

 - platform: modbus_controller
   id: chint_current
   name: "Chint Corrente"
   address: 0x2002
   unit_of_measurement: "A" ## for any other unit the value is returned in minutes
   register_type: read
   value_type: FP32
   accuracy_decimals: 2
   filters:
     - multiply: 1

 - platform: modbus_controller
   id: chint_power
   name: "Chint Potenza istantanea"
   address: 0x2004
   unit_of_measurement: "W" ## for any other unit the value is returned in minutes
   state_class: "measurement"
   register_type: read
   value_type: FP32
   accuracy_decimals: 2
   filters:
     - multiply: 1000

 - platform: modbus_controller
   id: chint_frequency
   name: "Chint Frequenza Rete"
   address: 0x200E
   unit_of_measurement: "Hz" ## for any other unit the value is returned in minutes
   register_type: read
   value_type: FP32
   accuracy_decimals: 2
   filters:
     - multiply: 1

 - platform: modbus_controller
   id: chint_energy_sold
   name: "Chint Energia ceduta"
   address: 0x4000
   unit_of_measurement: "KWh" ## for any other unit the value is returned in minutes
   state_class: total_increasing
   device_class: "energy"
   register_type: read
   value_type: FP32
   accuracy_decimals: 2
   filters:
     - multiply: 1
 
 - platform: modbus_controller
   id: chint_energy_purchased
   name: "Chint Energia acquistata"
   address: 0x400A
   unit_of_measurement: "KWh" ## for any other unit the value is returned in minutes
   state_class: total_increasing
   device_class: "energy"
   register_type: read
   value_type: FP32
   accuracy_decimals: 2
   filters:
     - multiply: 1   

 - platform: modbus_controller
   id: chint_reactive_power
   name: "Chint Potenza reattiva"
   address: 0x2004
   unit_of_measurement: "Var" ## for any other unit the value is returned in minutes
   register_type: read
   value_type: FP32
   accuracy_decimals: 2
   filters:
     - multiply: 1000
3 Likes

Hi Lajos,
I have installed your software and I thank you! When I try to configure it, setting the network interface, entering the IP address of the network/rs485 converter, port 502 and address 1 it gives me “unknown”. I have a CHINT DTSU666-CT for the solax.
How can I proceed step by step to find out where the error lies?
thank you

Take a look at my answer in below link and adapt to your particular setup:

Also, the default address for the CHINT is 11, not 1.

Thanks cesarvog,
I added the lines in configuration.yaml, but it still gives ‘unknown’.
Mine is a CHINT666-CT for SOLAX inverters and has as default address 1 and not 11

1 Like

My converter is a waveshare RS485 TO EHT, I configured it as ‘TCP Server’ and protocol ‘Modbus TCP to RTU’.

I managed! I didn’t restart home assistant, I only did quick restarts. thank you cesarvog very much!

1 Like

Would anyone have had any luck trying to use this with a Huawei DTSU-666H that is connected to a Huawei Smart Logger 3000A (COM3 Address 11) via RS485, so the SmartLogger that makes it available via Modbus TCP.

I’ve tried the above suggestions and continue to get it the ‘unknown’ or simply fails when trying to add it into HA.

I’ve tried with Modbus TCP addressing set to ‘Communication Address’ and also ‘Logical Address’ on the Smart Logger, and then tried connecting via its IP, Port 502 and Com Address 11 (default) and Logical Address 14 (as per above).

Tried logical just in case the integration (or pymodbus) is attempting defaulting to only checking COM1 and hence would be trying to connect to COM 1 Address 11 (on the Smart Logger my inverters are daisy chained off COM 1), whilst the DTSU-666H is attached via COM3 Address 11.

Logical diagram of the setup is as per:

C = Inverters
F = DTSU-666H
Q = Smart Logger 3000A (modbus rtu to tcp server)

Hey Lajos,

i have a SUN200 10KTL with DTSU666-H and as ModBus Gateway a Waveshare RS485 to ETHERNET (PoE). I dont get the Add On run.

I can reach my Waveshare over http, and connect over VirCon to Port 502…

Any Idea what i can do? Or what i do wrong?

SOLVED. Dont Know what changed! But it now works :slight_smile:

Dear all,
I have a addtional DTSU666-H (three phase smart power sensor). The sensor is connected to Waveshare RS485 to ETHERNETgateway. Can someone please explain step by step the installation.

I do not understand how I have to configure the IP address and the slave address of the sensor?

hi, i have tinkered already for few hours, and would like to ask for the help.
i have setup all setting in waveshare with DTSU-666 and then trying to connect it in home assistant and it shows error Unknown. I see in vircom, that connection for few seconds has been established but then error. What can be a problem?

If you are using an energy counter like me DTSU-666, the address 0x401e is correct. I have changed the configuration to the one below, and I am seeing results in the application.

line 430

            # documentation say address is 0x401e but this register contain invalid data, maybe only -H version?
            total = await client.read_holding_registers(
                address=0x401e, count=20, slave=unit_id # TA WARTOŚĆ DO ZMIANY
            )

This was really helpful for me, I was struggling before. Thank you!

I tried using the integration, but I have a single phase DDSU666 so sadly it wasn’t compatible.

I have a CT clamp version, but the current isn’t reading correctly, the seller tells me I need to set the Irat register (0008H) to match the winding of my clamp, I’ve tried the following without success, can anyone tell me where I’m going wrong?

service: modbus.write_register
data_template:
hub: ChintDDSU666
unit: 12
address: 8
value: 2500

Thanks

I go to the bottom of it, I should have used slave instead of unit :slight_smile: :

service: modbus.write_register
data_template:
hub: ChintDDSU666
slave: 12
address: 8
value:
- 2500

I have managed to add Chint-666 meter, but total positive energy and total negative energy shows 0. what could be a problem?

Has anyone had any luck resetting the total energy counter via modbus? I’m struggling to even read any of the values in the “Keyboard parameters” section of the manual (e.g. baud rate), let alone write them.

For Baud Rate I tried this for what the manual says is a signed int but I’m not getting any meaningful responses:

image

  - platform: modbus_controller
    name: "${devicename} Baud Rate"
    id: baud_rate
    modbus_controller_id: meter_atrea    
    address: 0x002E
    register_type: "holding"
    unit_of_measurement: baud
    icon: mdi:meter-electric
    value_type: S_WORD
|13:46:05|[D]|[modbus_controller.sensor:025]|Sensor new state: 1.00|
|13:46:05|[D]|[sensor:094]|'Baud Rate': Sending state 1.00000 baud with 0 decimals of accuracy|

The same goes for trying to reset the counter either via a switch or button, both give me the same error:

image

button:
  - platform: template
    name: "${devicename} Reset Atrea Energy Meter"
    entity_category: diagnostic
    icon: "mdi:meter-electric"
    on_press:
      then:
        - lambda: |-
            modbus_controller::ModbusController *controller = id(meter_atrea);
            modbus_controller::ModbusCommandItem resetfilter = modbus_controller::ModbusCommandItem::create_write_single_command(controller, 2, 1);
            controller->queue_command(resetfilter);

switch:
  - platform: modbus_controller
    modbus_controller_id: meter_atrea
    name: ${devicename} Reset Atrea Energy Meter
    entity_category: diagnostic
    icon: "mdi:meter-electric"
    register_type: holding
    address: 0x0002
    bitmask: 1

When I try to write “1” to the register:

[13:42:04][D][button:010]: 'Reset Atrea Energy Meter' Pressed.
[13:42:05][D][modbus:119]: Modbus error function code: 0x86 exception: 1
[13:42:05][E][modbus_controller:091]: Modbus error function code: 0x6 exception: 1 
[13:42:05][E][modbus_controller:100]: Modbus error - last command: function code=0x6  register address = 0x2  registers count=1 payload size=2

Rest of the values I can read perfectly fine from the read registers…

I have a wired connection from my dtsu666 (rs485) to my inverter. Now I want to read and use this Live, without any cloud.
Can I connect 1 rs485toWiFi (EW11a) to my meter and read both, my meter (address 001 changeable) and inverter (address 254 not changeable).

But now, following this thread, I understand that I need 2 x EW11 for reading 2 devices and can I connect both to my meter keeping the wire to the inverter. poor wifi outside with dropouts.