living_room_ac_power:
value_template: "{{ states('sensor.ke_ting_kong_diao_duan_lu_qi_phase_a_power')|float * 1000}}"
unit_of_measurement: "W"
device_class: power
friendly_name: Living Room AC Current Power
2.再通过HA的积分函数创建一个电量统计传感器。如:
sensor:
- platform: integration
source: sensor.living_room_ac_power
name: Living Room AC Energy Spent
unit_prefix: k
round: 2
method: left
之前通过这样的方式创建的2个空调电量统计实体都在能源面板能够成功添加并统计。(最近版本时总是提示“The following entities do not have the expected device class:”,我通过在步骤1添加device_class: power,步骤2有时就会正常出现device_class: energy。但不管它好像也不影响已经添加成功的电量统计。
但我最近通过这样的方式新加了一个插座的电量统计值后,却一直在能源面板上添加不到了(搜索不到),请教一下各位如何解决?谢谢
新的电量传感器已经在开发者工具中查询到数值,且有energy属性。如:
state_class: total
unit_of_measurement: kWh
device_class: energy
friendly_name: Dishwasher Energy Spent
source: sensor.dishwasher_power
谢谢回复!我生成的传感器好像这两个都有啊。如下(在开者者工具那里查询到的):
state_class: total
unit_of_measurement: kWh
device_class: energy
friendly_name: Dishwasher Energy Spent
source: sensor.dishwasher_power