有朋友在問,他想要把米家空調伴侶加入能源監控。由於,空調伴侶透過 syssi 的 plug-in 接入 HA 後,只有 load_power 這個屬性。
HA 需要的是 energy sensor,因此,需要轉換一下。下面是相關的 yaml
sensor:
- platform: integration
source: sensor.main_bedroom_climate_load_power
name: MainBedroom Climate Total Power Consumption
unit_prefix: k
round: 3
template:
- sensor:
- name: "Main BedRoom Climate Load Power"
unit_of_measurement: "W"
state: >
{{ state_attr('climate.main_bedroom_acpartner', 'load_power') }}
state_class: measurement
device_class: power
customize:
sensor.mainbedroom_climate_total_power_consumption:
device_class: energy
沒問題的話,就會有二個實體 Sensors
第二個實體就可以加入監控