utility_meter: ##仪表统计
pzem03_daily_energy: #pzem03日电量
source: sensor.pzem03_energy
cycle: daily
pzem03_monthly_energy: #pzem03月电量
source: sensor.pzem03_energy
cycle: monthly
pzem03_yearly_energy: #pzem03年电量
source: sensor.pzem03_energy
cycle: yearly
template: ##模板转换
- sensor:
- name: pzem03_yesterday_energy #昨日电量
unit_of_measurement: kWh
device_class: energy
state: "{{(state_attr('sensor.pzem03_daily_energy','last_period') | float)| round(3)}}"
- name: pzem03_Last_month_energy #上月电量
unit_of_measurement: kWh
device_class: energy
state: "{{(state_attr('sensor.pzem03_monthly_energy','last_period') | float)| round(3)}}"
- name: pzem03_last_year_energy #去年电量
unit_of_measurement: kWh
device_class: energy
state: "{{(state_attr('sensor.pzem03_yearly_energy','last_period') | float)| round(3)}}"
|