====== Pimp my Riden RD-6018W ====== {{url>https://odysee.com/$/embed/@Apollo-NG:2/pimp-my-riden-1:1?r=9GPazzWhkRN7uXjT7tbgNuzpoZAF4G6Z noscroll noborder}} This Episode will focus solely on hacking around in the Riden RD-6018W. Per default, the W version comes with a wireless interface and Ridens android app. Since that is less than useful the idea came up to see if we could flash our own firmware onto it. Luckily Riden uses a COTS ESP12 module. Unluckily the module isn't simply flashed by plugging it into USB like we are used on the ESP32 nodemcu (and the likes) modules. The next task was to analyze and reverse engineer the module and its PCB implementation and hack a little USB-Serial adapter and breadboard magic, to flash a specific esphome firmware that talks modbus to the RD-6018 and exposes the control interfaces and log data to home-assistant. After that was successfully done, control is now available in Home-Assistant and long term log-data is stored in Prometheus and available in Grafana. Last but not least USB connection and working with the open-source toolkit RidenGUI also turned out to be no problem at all. All in all, this was a very successful session to get the most out of the Riden RD-6018 and the same should apply to the RD-6006 and RD-6012 models. === Hardware === * [[https://www.amazon.de/-/en/Constant-Voltage-RD6018-W-Keyboard-Software/dp/B09BCM377R/|Riden RD-6018W]] === Software === * [[https://doug-gilbert.github.io/rd60xx-unisoft/rd60xx-unisoft.html|Unisoft TLDR]] * [[https://www.eevblog.com/forum/testgear/ruideng-riden-rd6006-dc-power-supply/|EEVBlog Forum Thread: RD-6000 Series]] * [[https://www.eevblog.com/forum/testgear/custom-firmware-reference-document-for-riden-rd60xx-power-supplies/|EEVBlog Forum Thread: Custom Firmware Reference]] * [[https://github.com/ShayBox/RidenGUI|RidenGUI]] * [[https://esphome.io/|ESPHOME]] === Update === As requested, here is the esphome config for it: ################################################################################ # RD-6018W ESP-12F Configuration ############################################# # V1.0 chrono (Apollo-NG) 2022-11-13 substitutions: name: 'rd-6018' friendly_name: 'RD-6018' ################################################################################ # GENERAL #################################################################### esphome: name: ${name} platform: ESP8266 board: esp01_1m wifi: ssid: !secret wifi_ssid password: !secret wifi_psk domain: ".iot.apollo.lan" fast_connect: on logger: baud_rate: 0 # Enable Home Assistant API and set reboot timeout api: reboot_timeout: 60s # Enable OTA updates ota: # Time sync needed for total_daily_energy calcs time: - platform: homeassistant id: homeassistant_time timezone: "UTC" ################################################################################ # BUS Config ################################################################# uart: tx_pin: 1 rx_pin: 3 baud_rate: 1000000 debug: modbus_controller: address: 0x01 update_interval: 10s ################################################################################ # SENSORS #################################################################### text_sensor: - platform: version name: "${name} - Version" icon: mdi:cube-outline sensor: - platform: uptime name: "${name} - Uptime" update_interval: 60s icon: mdi:clock-outline - platform: wifi_signal name: "${name} - Wifi Signal" update_interval: 10s icon: mdi:wifi - platform: modbus_controller name: '${friendly_name} Internal Temperature' register_type: holding address: 4 register_count: 2 bitmask: 0xFFFF value_type: U_DWORD unit_of_measurement: °C state_class: measurement device_class: temperature lambda: | return data[item->offset + 1] == 0 ? x : -x; - platform: modbus_controller name: '${friendly_name} External Temperature' register_type: holding address: 34 register_count: 2 bitmask: 0xFFFF value_type: U_DWORD unit_of_measurement: °C state_class: measurement device_class: temperature lambda: | return data[item->offset + 1] == 0 ? x : -x; - platform: modbus_controller name: '${friendly_name} Output Voltage' register_type: holding address: 10 value_type: U_WORD unit_of_measurement: V state_class: measurement device_class: voltage accuracy_decimals: 2 filters: - multiply: 0.01 - platform: modbus_controller name: '${friendly_name} Output Current' register_type: holding address: 11 value_type: U_WORD unit_of_measurement: A state_class: measurement device_class: current accuracy_decimals: 2 filters: - multiply: 0.01 - platform: modbus_controller name: '${friendly_name} Output Energy' register_type: holding address: 12 value_type: U_WORD unit_of_measurement: Ah state_class: measurement device_class: energy accuracy_decimals: 2 filters: - multiply: 0.001 - platform: modbus_controller name: '${friendly_name} Output Power' address: 13 register_type: holding value_type: U_WORD unit_of_measurement: W state_class: measurement device_class: power accuracy_decimals: 2 filters: - multiply: 0.01 - platform: modbus_controller name: '${friendly_name} Input Voltage' register_type: holding address: 14 value_type: U_WORD unit_of_measurement: V state_class: measurement device_class: voltage accuracy_decimals: 2 filters: - multiply: 0.01 - platform: modbus_controller name: '${friendly_name} Energy' internal: true register_type: holding address: 40 value_type: U_DWORD unit_of_measurement: Wh state_class: measurement device_class: energy accuracy_decimals: 3 filters: - multiply: 0.001 switch: - platform: modbus_controller name: '${friendly_name} Keypad Lock' address: 15 register_type: holding bitmask: 1 - platform: modbus_controller name: '${friendly_name} Power' address: 18 register_type: holding bitmask: 1 number: - platform: modbus_controller name: '${friendly_name} Voltage Setting' address: 8 value_type: U_WORD min_value: 0.01 max_value: 60.0 step: 0.01 lambda: return x / 100.0f; multiply: 100 - platform: modbus_controller name: '${friendly_name} Current Setting' address: 9 value_type: U_WORD min_value: 0.01 max_value: 18.0 step: 0.01 lambda: return x / 100.0f; multiply: 100 - platform: modbus_controller name: '${friendly_name} Voltage Protection' entity_category: config address: 82 value_type: U_WORD min_value: 0.01 max_value: 60.0 step: 0.01 lambda: return x / 100.0f; multiply: 100 - platform: modbus_controller name: '${friendly_name} Current Protection' entity_category: config address: 83 value_type: U_WORD min_value: 0.01 max_value: 18.0 step: 0.01 lambda: return x / 100.0f; multiply: 100 binary_sensor: - platform: modbus_controller name: '${friendly_name} Battery Mode' address: 32 register_type: holding bitmask: 1 If you want to see more, please [[https://odysee.com/$/invite/@Apollo-NG:2|join Odysee]] and [[https://odysee.com/@Apollo-NG:2|follow our channel]] there. {{tag>Riden RD-6018 livestream}} {{keywords>Apollo-NG apollo next generation hackerspace hacker space development makerspace fablab diy community open-resource open resource mobile hackbus Riden RD-6018 livestream}} ~~DISCUSSION~~