substitutions: name: atorch-dc-meter external_components_source: github://syssi/esphome-atorch-dl24@main project_version: 2.5.0 device_description: "Monitor and control a Atorch meter via bluetooth" esphome: name: ${name} friendly_name: ${name} comment: ${device_description} project: name: "syssi.esphome-atorch-dl24" version: ${project_version} esp32: board: wemos_d1_mini32 framework: type: esp-idf external_components: - source: ${external_components_source} refresh: 0s wifi: ssid: !secret wifi_ssid password: !secret wifi_password min_auth_mode: WPA2 ota: platform: esphome on_begin: then: - switch.turn_off: ble_client_switch0 - logger.log: "BLE connection suspended for OTA update" logger: level: DEBUG # If you use Home Assistant please remove this `mqtt` section and uncomment the `api` component! # The native API has many advantages over MQTT: https://esphome.io/components/api.html#advantages-over-mqtt mqtt: broker: !secret mqtt_host username: !secret mqtt_username password: !secret mqtt_password id: mqtt_client # api: esp32_ble_tracker: scan_parameters: active: false ble_client: - mac_address: !secret dl24_mac_address id: client0 atorch_dl24: - id: atorch0 ble_client_id: client0 check_crc: true # The meter publishes a status report per second via BLE notification. If you don't like this update interval # you can use this setting to throttle the sensor updates by skipping some status reports. throttle: 0s binary_sensor: - platform: atorch_dl24 atorch_dl24_id: atorch0 running: name: "running" # If you use `mqtt` you can control a button if you publish the message "PRESS". The topic depends on # the name of your ESPHome node and the name of the button entity: # # mosquitto_pub -t 'atorch-dc-meter/button/atorch-dc-meter_reset_energy/command' -m 'PRESS' # mosquitto_pub -t 'atorch-dc-meter/button/atorch-dc-meter_reset_capacity/command' -m 'PRESS' # mosquitto_pub -t 'atorch-dc-meter/button/atorch-dc-meter_reset_runtime/command' -m 'PRESS' # mosquitto_pub -t 'atorch-dc-meter/button/atorch-dc-meter_reset_all/command' -m 'PRESS' # ... button: - platform: atorch_dl24 atorch_dl24_id: atorch0 reset_energy: name: "reset energy" reset_capacity: name: "reset capacity" reset_runtime: name: "reset runtime" reset_all: name: "reset all" usb_plus: name: "plus" usb_minus: name: "minus" setup: name: "setup" enter: name: "enter" sensor: - platform: atorch_dl24 atorch_dl24_id: atorch0 voltage: name: "voltage" current: name: "current" power: name: "power" capacity: name: "capacity" energy: name: "energy" temperature: name: "temperature" dim_backlight: name: "dim backlight" runtime: name: "runtime" switch: - platform: ble_client ble_client_id: client0 name: "enable bluetooth connection" id: ble_client_switch0 text_sensor: - platform: atorch_dl24 atorch_dl24_id: atorch0 runtime_formatted: name: "runtime formatted"