A YAML script for Home Assistant that will allow you to add additional sensors for the Energy Dashboard
Configuration YAML
This is a YAML I put together for the Energy Consumption of a Athom Smart Plug: AU Plug for ESPHome
esphome.yaml
sensor: - platform: integration source: sensor.athom_smart_plug_v2_ec0fa2_power name: garage_fan_wh unit_time: h method: left round: 2 utility_meter: garage_fan_wh_daily: source: sensor.garage_fan_wh cycle: daily homeassistant: customize: sensor.garage_fan_wh: friendly_name: "Garage Fan Consumption Energy" unit_of_measurement: Wh device_class: energy sensor.garage_fan_wh_daily: friendly_name: "Garage Fan Consumption Energy (Daily)" unit_of_measurement: Wh device_class: energy group: esphome: name: ESP Home entities: - sensor.garage_fan_wh - sensor.garage_fan_wh_daily
Dashboard YAML
type: vertical-stack cards: - type: markdown content: <h1>Garage Fan</h1> - type: horizontal-stack cards: - show_name: true show_icon: true type: button entity: switch.athom_smart_plug_v2_ec0fa2_switch show_state: true icon: mdi:fan icon_height: 80px name: Garage Fan - show_name: false show_icon: true show_state: true type: glance entities: - entity: binary_sensor.athom_smart_plug_v2_ec0fa2_status - entity: sensor.athom_smart_plug_v2_ec0fa2_power title: Plug Status
Energy Dashboard
The following sensor can be added to the Energy Dashboard as an Individual Device
- Friendly Name: "Garage Fan Consumption Energy (Daily)"
- Display Name: "Garage Fan"