GithubHelp home page GithubHelp logo

syssi / esphome-dps Goto Github PK

View Code? Open in Web Editor NEW
18.0 4.0 4.0 940 KB

ESPHome component to monitor and control the RDTech DPS series

License: Apache License 2.0

Shell 0.19% Python 44.48% C++ 55.33%
dps esphome esphome-component dps5020 uart hacktoberfest

esphome-dps's Introduction

esphome-dps

GitHub actions GitHub stars GitHub forks GitHub watchers "Buy Me A Coffee"

ESPHome component to monitor and control the RDTech Digital Control Power Supply (DPS) series via UART-TTL.

Lovelace entities card

Supported devices

  • DPS3005 Buck, 0-30V, 0-5A, 160W (current_resolution: HIGH)
  • DPS5005 Buck, 0-50V, 0-5A, 250W (current_resolution: HIGH)
  • DPS8005 Buck, 0-80V, 0-5.1A, 408W (current_resolution: HIGH)
  • DPS5015 Buck, 0-50V, 0-15A, 750W (current_resolution: LOW)
  • DPS5020 Buck, 0-50V, 0-20A, 1000W (current_resolution: LOW, tested by @romeox44)
  • DPH5005 Buck/Boost, 0-50V, 0-5A, 250W (current_resolution: HIGH), reported as model 5205

Requirements

Schematics


┌──────────┐                ┌─────────┐
│          │<----- RX ----->│         │
│ DPS5020  │<----- TX ----->│ ESP32/  │
│          │<----- GND ---->│ ESP8266 │<-- 3.3V
│          │                │         │<-- GND
└──────────┘                └─────────┘



│            o GND ── GND                │
│            o TXD ── GPIO5 (`rx_pin`)   │
│            o RXD ── GPIO4 (`tx_pin`)   │
│            o VCC                       │
└─[oooooooo]─────────────────[oooooooo]──┘


DPS3005 connector pinout

The connector is a 4 Pin GH Molex Pico 1.25mm. Do not connect the ESP to the VCC pin of the DPS in any case. This will destroy the voltage regulator of the device.

Installation

You can install this component with ESPHome external components feature like this:

external_components:
  - source: github://syssi/esphome-dps@main

or just use the esp32-example.yaml as proof of concept:

# Install esphome
pip3 install esphome

# Clone this external component
git clone https://github.com/syssi/esphome-dps.git
cd esphome-dps

# Create a secrets.yaml containing some setup specific secrets
cat > secrets.yaml <<EOF
wifi_ssid: MY_WIFI_SSID
wifi_password: MY_WIFI_PASSWORD

mqtt_host: MY_MQTT_HOST
mqtt_username: MY_MQTT_USERNAME
mqtt_password: MY_MQTT_PASSWORD
EOF

# Validate the configuration, create a binary, upload it, and start logs
# If you use a esp8266 run the esp8266-examle.yaml
esphome run esp32-example.yaml

Example response all sensors enabled

[D][sensor:124]: 'dps voltage setting': Sending state 36.00000 V with 2 decimals of accuracy
[D][number:012]: 'dps voltage setting': Sending state 36.000000
[D][sensor:124]: 'dps current setting': Sending state 10.00000 A with 2 decimals of accuracy
[D][number:012]: 'dps current setting': Sending state 10.000000
[D][sensor:124]: 'dps output voltage': Sending state 35.98000 V with 2 decimals of accuracy
[D][sensor:124]: 'dps output current': Sending state 2.37000 A with 2 decimals of accuracy
[D][sensor:124]: 'dps output power': Sending state 85.27000 W with 2 decimals of accuracy
[D][sensor:124]: 'dps input voltage': Sending state 42.31000 V with 2 decimals of accuracy
[D][binary_sensor:036]: 'dps key lock': Sending state OFF
[D][switch:037]: 'dps key lock': Sending state OFF
[D][text_sensor:067]: 'dps protection status': Sending state 'Normal'
[D][binary_sensor:036]: 'dps constant current mode': Sending state OFF
[D][binary_sensor:036]: 'dps output': Sending state ON
[D][switch:037]: 'dps output': Sending state ON
[D][sensor:124]: 'dps backlight brightness': Sending state 0.00000 % with 0 decimals of accuracy
[D][text_sensor:067]: 'dps device model': Sending state 'DPS5020'
[D][sensor:124]: 'dps firmware version': Sending state 17.00000  with 0 decimals of accuracy

Known issues

None.

Debugging

If this component doesn't work out of the box for your device please update your configuration to enable the debug output of the UART component and increase the log level to the see outgoing and incoming serial traffic:

logger:
  level: DEBUG

uart:
  id: uart_0
  baud_rate: 9600
  tx_pin: ${tx_pin}
  rx_pin: ${rx_pin}
  debug:
    direction: BOTH

References

esphome-dps's People

Contributors

antfurn avatar syssi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

esphome-dps's Issues

DPS3005 no response

image

I have connected a ESP32 (NodeMCU-32 V1.3) to a DPS3005. Mine came without a connector, but i just soldered some cables to it.

I double-checked all connections, tried to switch RX and TX, tried different Pins but still, it does not work...

Add start and stop voltage setting

Monitor the input/battery voltage and go into a Standby mode if the stop voltage is reached. Go back to the Normal mode if the battery gets charged and the start voltage is reached again.

Add XY6020 support

https://github.com/kbs3056/XY6015L_pyGUI
#19 (comment)

Baud rate: 115200

[18:30:22][I][dps:063]: Status frame received
[18:30:22][D][text_sensor:064]: 'dps device model': Sending state 'DPS21'
[18:30:22][D][sensor:094]: 'dps voltage setting': Sending state 25.00000 V with 2 decimals of accuracy
[18:30:22][D][number:012]: 'dps voltage setting': Sending state 25.000000
[18:30:22][D][sensor:094]: 'dps current setting': Sending state 0.20900 A with 3 decimals of accuracy
[18:30:22][D][number:012]: 'dps current setting': Sending state 0.209000
[18:30:22][D][sensor:094]: 'dps output voltage': Sending state 25.00000 V with 2 decimals of accuracy
[18:30:22][D][sensor:094]: 'dps output current': Sending state 0.00100 A with 3 decimals of accuracy
[18:30:22][D][sensor:094]: 'dps output power': Sending state 0.02000 W with 2 decimals of accuracy
[18:30:22][D][sensor:094]: 'dps input voltage': Sending state 48.26000 V with 2 decimals of accuracy
[18:30:22][D][text_sensor:064]: 'dps protection status': Sending state 'Normal'
[18:30:22][D][sensor:094]: 'dps backlight brightness': Sending state 20.00000 % with 0 decimals of accuracy
[18:30:22][D][sensor:094]: 'dps firmware version': Sending state 1.50000 with 1 decimals of accuracy
[18:30:22][W][component:214]: Component modbus took a long time for an operation (0.14 s).
[18:30:22][W][component:215]: Components should block for at most 20-30ms.
[18:30:22][D][uart_debug:158]: <<< "\x01\x03\x1A\t\xC4\x00\xD1\t\xC4\x00\x01\x00\x02\x12\xDA\x00\f\x00\x00\x00\xFA\x00\x00\x00\x01\x00\x15\x00\x0F\x91}"

Not working:

  • Output switch
  • Firmware version

Different contents of the status frames:

XY6020: https://github.com/kbs3056/XY6015L_pyGUI/blob/master/source_files/dps_modbus.py#L135-L147
DPS5005: https://github.com/lambcutlet/DPS5005_pyGUI/blob/master/source_files/dps_modbus.py#L135C1-L145

Different registers:

XY6020: https://github.com/kbs3056/XY6015L_pyGUI/blob/master/source_files/dps_modbus.py#L67C1-L104
DPS5005: https://github.com/lambcutlet/DPS5005_pyGUI/blob/master/source_files/dps_modbus.py#L67-L133

@creepystefan

Alternative Firmware Profimax 4.3

Hello,
I have installed the DPS firmware versin 4.3 from Profimax (very good firmware for this device). So I testet it with this esphome software. After changing the uart speed to 115200 I was able to communicate with my power supply.
Unfortunately I am only able to read the values, but I can't write anything.
There is a ESP01 installed. When I use my own Arduino firmware everything works fine. So the wiring is correct.

Do someone have any advice?
Tanks in advance.
Bernd

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.