本帖最后由 evantalk 于 2022-5-16 10:57 编辑
power consumed不就是电量吗?
sensor:
- platform: template
sensors:
ups_power_consumed:
friendly_name: "UPS消耗电能"
unit_of_measurement: Wh
device_class: energy
value_template: "{{ state_attr('switch.wall_plug_158d00041d1fd3', 'power_consumed')|int }}"
只有device_class: energy的实体,才能在接入能源面板 |