- Log in to post comments
ESPhome configuration
substitutions: # Change this model to fit your particular one. # You can find it in Home Assistant as the device diagnostic "Model Name". model: "dpm8624" device_name: "dpm8624-controller" device_friendly_name: "dpm8624-modbus" device_description: "Power Supply" # # Model specific settings (Don't change these!) # XY6014_voltage_maximum: "60" # XY6014_voltage_accuracy: "2" # XY6014_voltage_multiplier: "0.01" # XY6014_current_maximum: "14" # XY6014_current_accuracy: "3" # XY6014_current_multiplier: "0.01" # globals: # - id: vin_undervoltage_theshold # type: float # restore_value: no # initial_value: '17' esphome: name: $device_name friendly_name: $device_friendly_name esp8266: board: d1_mini # Enable logging logger: level: INFO # Disable logging via UART, since we're using this for modbus communication baud_rate: 0 # Enable status LED status_led: pin: number: GPIO2 inverted: true web_server: port: 80 local: true log: false # Enable Home Assistant API api: # encryption: # key: !secret home_assistant_key reboot_timeout: 0s ota: - platform: esphome #password: !secret ota_password # Configure WiFi wifi: networks: - ssid: !secret wifi_ssid password: !secret wifi_password # Enable fallback hotspot (captive portal) in case wifi connection fails ap: ssid: "XY6014 Fallback Hotspot" password: "" uart: id: mod_bus tx_pin: GPIO1 rx_pin: GPIO3 baud_rate: 9600 # data_bits: 8 stop_bits: 1 parity: none modbus: id: modbus1 uart_id: mod_bus modbus_controller: - id: dpm8624 address: 0x01 modbus_id: modbus1 command_throttle: 500ms update_interval: 5s time: - platform: homeassistant id: ha_time # Sensors (readings) sensor: - platform: modbus_controller modbus_controller_id: dpm8624 name: "DPM Output Voltage" id: dpm_output_voltage register_type: holding address: 0x1001 unit_of_measurement: "V" accuracy_decimals: 2 filters: - multiply: 0.01 - platform: modbus_controller modbus_controller_id: dpm8624 name: "DPM Output Current" id: dpm_output_current register_type: holding address: 0x1002 unit_of_measurement: "A" accuracy_decimals: 3 filters: - multiply: 0.001 - platform: modbus_controller modbus_controller_id: dpm8624 name: "DPM Temperature" register_type: holding address: 0x1003 unit_of_measurement: "°C" accuracy_decimals: 0 - platform: template name: "DPM Power" id: dpm_power unit_of_measurement: "W" device_class: power state_class: measurement accuracy_decimals: 1 lambda: |- return id(dpm_output_voltage).state * id(dpm_output_current).state; - platform: total_daily_energy name: "Charge Today" power_id: dpm_power unit_of_measurement: "Wh" device_class: energy state_class: total_increasing accuracy_decimals: 0 restore: false # Controls (setpoints) number: - platform: modbus_controller modbus_controller_id: dpm8624 name: "DPM Set Voltage" address: 0x0000 register_type: holding min_value: 0 max_value: 60 step: 0.01 unit_of_measurement: "V" mode: box lambda: |- return x / 100.0; write_lambda: |- return (int)(x * 100.0); - platform: modbus_controller modbus_controller_id: dpm8624 name: "DPM Set Current" address: 0x0001 register_type: holding min_value: 0 max_value: 24 step: 0.001 unit_of_measurement: "A" mode: box lambda: |- return x / 1000.0; write_lambda: |- return (int)(x * 1000.0); switch: - platform: modbus_controller modbus_controller_id: dpm8624 name: "DPM Output" address: 0x0002 register_type: holding
Flashesphome run dpm8624-modbus.yaml --device /dev/ttyUSB0