DT20HBW Smart Battery Monitor Integration

Hello,

The DT20HBW is a Smart Battery Monitor by Atorch that also supports a relay switch add-on module. Currently, it can only be controlled through the Tuya mobile app, and it is not supported by official Tuya or LocalTuya integrations.

Therefore, I have developed a custom integration to enable support for the DT20HBW in Home Assistant, allowing for automation and other functionalities. This integration is implemented with TinyTuya, which enables local control without relying on the cloud.

My primary use for the DT20HBW is to control the LiFePO4 battery connected to my EcoFlow Delta 2 Max via its solar PV input. With this integration, I can set up automations such as automatically turning on the relay switch when the EcoFlow Delta 2 Max’s charge drops to a certain level, and turning off the relay switch when the LiFePO4 battery voltage drops to a certain level.

I would like to submit this integration to HACS and am currently exploring the next steps in the process.

Here is the repository link:

1 Like

Hello,

Many thanks for this, I am expecting mine to be delivered any day now and will put it to use in my motorhome, in a very similar way to yourself.

Is the measurement correct? Especially SOC

Working well for me. I had to manually put in the IP address of the meter itself in the config, don’t forget to lock that IP address on your router to the meter or it may change on the next reboot of the router.
Edit 1: and fixes the problem I had with local tuya integration reporting the voltage at 10x
Edit 2: the reporting interval and fast data refresh revert back to what appears to be 60 seconds. Has anyone found a sticky setting that enables faster data polling?

Can’t configure it.

Device ID is ok (MAC address)

Local key found acc. to this video https://www.youtube.com/watch?v=G00SLJsu-_I&t=397s

Host IP:

  • When I enter the local home network LAN-IP of the DT20HBW (showed by my router, 192.168.176.49) it shows this error after a while:
    “Failed setup, will retry: Error communicating with device: Invalid response from device: {‘Error’: ‘Network Error: Device Unreachable’, ‘Err’: ‘905’, ‘Payload’: None}”

  • The DT20HBW shows in the smart life app under device information a different IP (185.162.220.87). When I enter this IP, I get the same error.

What am I doing wrong?

This is the device data, received from Tuya:

  "result": [
    {
      "active_time": 1765105816,
      "bind_space_id": "47353507",
      "category": "cz",
      "create_time": 1764684639,
      "custom_name": "Garage Steiner Akku Monitor (DT20HBW)",
      "icon": "smart/icon/bay1598402984069otRu/7f40c2c9dbffffcc2fe9026f761946f6.jpg",
      "id": "bf47ff715aac913bf1pv92",    *=> used for Home Assistant as ID*
      "ip": "185.162.220.87",                  *=> used for Home Assistant as host ("185.162.220.87")*
      "is_online": true,
      "lat": "",
      "local_key": "~mL__s#Zpt+x2yUx",    *=> used for Home Assistant as local key*
      "lon": "",
      "model": "DT20HBW",
      "name": "炬为电能表(DT20HBW)",
      "product_id": "1xgihnuztyo12pqw",
      "product_name": "炬为电能表(DT20HBW)",
      "sub": false,
      "time_zone": "+01:00",
      "update_time": 1765105815,
      "uuid": "0248597e29caa35f"
    }
  ],
  "success": true,
  "t": 1765107541412,
  "tid": "536e03ecd36111f0907cf2f713bbc060"
}

P.S.: I changed all numbers here for this post for security reasons

Why does my device not show the LAN-IP / Wifi-IP? Is this the IP of the SmartLife Server?
And which IP shall use in Home Assistant?

Try the new version with alot of fixesd and using new tinytuya library. If you get an 914 error double check that your local key is correct as it can change!

It works! Great! Super Job…

And yes, I had to use the local IP of the Router Wifi.
I deleted and reconfigured the device and then it worked.
The device of course got a new ID, secret… .
The IP dresses by your local router of course must be fixed.
I did nor notice, that after reconfiguring nearly everything changes.

1 Like