Has anyone used Dingtian 8ch Ethernet Relay?

The yaml is just a very high level description of what the board will do, but it’s not a real programming language. In the custom component there is the logic that allows the hardware components of this specific device to work. In esphome there are a lot of “hidden” components, which are built-in, they can be simply declared in the yaml, and they are used “under the hood” by the esphome compiler. For example, simply typing web_server creates the web server with all the ui. you can imagine that a lot more is needed in order to create a webserver. That code is simply put by the compiler without you even knowing. There is no built-in component for the hardware that’s included in this board and the logic that is required to drive it, so an external one is needed.

No it’s not. I can use all the 16 the inputs and the 16 outputs of my board.

I recently got the board DT-R008 V3.6.13, which is v2 series. It has slightly different wiring that allows using the spi offload.
My changes can be found in GitHub - prudy/dtr0xx_io at dtr008v2io

1 Like

I’m having trouble flashing ESPHome onto the DT-R004. I ordered a development board, and there’s a small DEV written on the box, so I assume the bootloader isn’t locked. Attached is a picture of the wiring. The 12V isn’t connected, and the jumper on the USB adapter is set to 3.3V; otherwise, everything is exactly as shown in the picture. The light blue line is connected from NRST to DTR, as you described. I press the switch when plugging in the USB adapter. The terminal displays garbled output, but something happens. When flashing with web.esphome.io, the screen stays on “Connecting,” but nothing else happens. What am I doing wrong? Does anyone have any ideas?

I am currently trying to add in a DTWONDER 4-Channel module over the Mosquitto MQTT Broker. The latest firmware has a HA-Discovery button in the Relay settings page. So I pressed that and clicked Add MQTT Device in HA MQTT and it magically appeared with all inputs and outputs.

But after configuring I discovered I had plugged it into the wrong IP network. I could not find any IP settings, so I deleted the module, plugged it in the right network and pressed the HA Discovery button in the module config and Add MQTT Device in HA. HA shows “Configuring ID xxIDxxx” then goes offline, disconnects for a minute or two and then comes back again with the module missing.
The only way to at least discover the module a bit again is to modify the MAC address of the module. But it never discovered the relay and input structure again like it did on the first run.
Any ideas on that?

Has anybody tried to use this device to control further RS485 Modbus devices (relay boards) using the TCP to RS845 “transparent transmission”? It seems like a nice way to had more relays easily and cheap if needed?

Maybe reset the device?

I thought I could do that on mine, but I found out that you have to very carefully select the exact type when ordering. Mine has the CAN and RS485 driver chips removed. Funny enough, all passive parts for these busses are placed, so only a 485 driver chip needs to be added. I’ll order additional relay board over the next few month and try to extend them over rs485. No idea how that is then shown in MQTT.

I have just done exactly like you said, messaged them on AliExpress and they replied in less than a minute confirming that they will send a development relay board with “gpio test firmware”

Many thanks for the tip, so that I can avoid lenghy desoldering for no good reason…

Bye, Luca

FAST INSTALL FOR CURRENT FIRMWARES (as of November 2025)
I just wanted to sum up some of the info given here; installation in HA is super easy for the Dingtian DTWONDER relay modules, and the manual is super old and discribes the process wrongly. There is absolutely no need to do anything ESP32Home-wise. The module works out of the box in 5 minutes.

My firmware: V3.1.5461A, Hardware V3.6J

The setup procedure is this:

  • Make sure you have MQTT installed in HA. In the AddOn-Section of HA (you see Mosquito there, but also MQTT in the Integration section) you need to have at least one login defined for MQTT, meaning, you know a login name and password for devices to use to login into the HA MQTT service.
  • Login to your DTWonder Relay module, go to Relay Connect Section
  • I disabled all other protocols and services except MQTT by setting “Protocol” to “none” everywhere except MQTT
  • In MQTT section on Relay I checked: x Head Slash, x Retain. Area: “”, MFR “dingtian”, QOS: 1 Alives: 120s. Enter the BROKER ADRESS, which is the address of your Home Assistant with your MQTT AddOn. Port is usally standard 1883. Enter Broker Username and Passwort from the login you have created in the AddOn-Section of HA under Mosquito
  • SAVE changes in DTWONDER
  • (I also removed the connection between input and relays, under “Input Link Relay” set to NO)
  • Click the HA Discover Button in DTWONDER Relay right in the MQTT section
  • Without clicking anything, the Relay module with all relays plus inputs should appear automatically in HA Integrations under MQTT
  • Works like a charm!

Enjoy!

Update - I figured it out. Somehow i managed to have the same ETH MAC address for both cards configured on the units themselves. I changed one of them and now its instantaneous on/off etc.

I agree the docs are clearly old as i did the same hing with the HA Discover button and it popped up in Mosquito. I was actually blown away as i assumed i was in for a night of yaml. I added 2 8 relay cards and they both show up. There seems to be a lot of delay from when i switch a relay on to off or off to on. Not all the time but to a point where the switch i turned on in HA goes back to off then 10 seconds later goes back to on. Is anyone else seeing these delays at all as i’m hoping its not becuae i have 2 exact boards configured within HA. I’ll play around with it but may try to somehow add a 2nd user in mosquito to try and separate the credentials between the 2 cards to see if it makes a difference.

Coming here with a question: my plan is to use one of these boards to control my lights. I want to connect utp cables from the switches directly to the board in order to have control over the lights even whe HA server is down. And of course, use HA for automations. Do you guys know whether this can be achieved? And do you happen to know whether ESP on the board can handle things like long presses or multiclicks without referring back to HA?

1 Like

Hey Aaron,

If I was you, order the firmware free version. You can use Esphome to set this up.

I have these with the dingtian firmware and they have a long press function but I don’t know how it works.

Maybe you can email Stephen (manager of dingtian) he really helps you out if you have questions.

I have 8 boards and they all work great for lights and shutters.

1 Like

Understood. That is what I just did. But Dingtian support advised me that the test FW is really just for test purposes, it doesn’t manage any more sofisticated functions. Which is understandble but now I am just worried whether I (read as in Claude and me) will be able to actually create a necessary FW for all this to work without any actual knowledge of coding.

You can flash ESPhome them (the firmware free version) and ESPhome has a lot of options.
I use the Dingtian firmware daily and it works great. I use it for shutters and lights. I use HA to send the mqtt signals.