THIS POST IS OBSOLETE ASWELL - here the modbus is still processed inside the HA. NOT ESPhome which is much better idea. Look further down for more info
Hi, followup update.
At home assistant version core-2021.6.0 there was change in modbus integration’s configuration that forced new style of configuration. Now the modbus config is more unified together. Also the “hack” of using custom components is no longer needed.
(If you are wondering why I have “type:serial” - I have USB-serial converter plugged directly to rPi. And this serial converter is connected to wireless module at 433MHz. And there is another 433MHz module at the power supply.
New config for RD6006 is as follows:
modbus:
- name: hub1
delay: 2
type: serial
baudrate: 9600
timeout: 10
method: rtu
parity: N
port: /dev/ttyUSB0
stopbits: 1
bytesize: 8
close_comm_on_error: true
switches:
- name: RD6006_output
address: 18
slave: 1
command_on: 1
command_off: 0
verify:
sensors:
- name: RD6006_voltage_output
scan_interval: 120
slave: 1
address: 10
scale: 0.01
precision: 2
unit_of_measurement: V
- name: RD6006_current_output
scan_interval: 120
slave: 1
address: 11
scale: 0.001
precision: 3
unit_of_measurement: A
- name: RD6006_capacity
scan_interval: 120
slave: 1
address: 38
count: 2
scale: 0.001
precision: 3
unit_of_measurement: Ah
The only issue I have now is that the “switch” does not read back the actual status of the power supply. So when I use physical button on the power supply to turn off, the change won’t propagat to home assistant.
Another useful discovery I made is there is unofficial firmware for these power supplies! The main advantage is the buttons won’t lock while remotely communicating with the power supply + it has many more added features. More info and manual how to flash in this thread 
https://www.eevblog.com/forum/testgear/custom-firmware-reference-document-for-riden-rd60xx-power-supplies/
and this thread RuiDeng Riden RD6006 DC power supply - Page 25