- 积分
- 455
- 金钱
- 422
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
中级会员
- 积分
- 455
- 金钱
- 422
- HASS币
- 0
|
发表于 2021-4-2 10:32:29
|
显示全部楼层
utility_meter:
dailyenergy: #日常电量
source: sensor.pzem_004t_v3_energy #数据来自pzem_004t
cycle: daily
tariffs:
- peak
- offpeak
weeklyenergy: #周电量
source: sensor.pzem_004t_v3_energy
cycle: weekly
tariffs:
- peak
- offpeak
monthlyenergy: #月度电量
source: sensor.pzem_004t_v3_energy
cycle: monthly
tariffs:
- peak
- offpeak
yearlyenergy: #年度电量
source: sensor.pzem_004t_v3_energy
cycle: yearly
tariffs:
- peak
- offpeak
sensor:
- platform: template #昨日电量
sensors:
lastdailyenergy_peak:
friendly_name: "lastdailyenergy"
unique_id: sensor.lastdailyenergy_peak
unit_of_measurement: "KWH"
value_template: "{{state_attr('sensor.dailyenergy_peak','last_period')}}" #计算来自日常电量
icon_template: mdi:counter
- platform: template #上周电量
sensors:
lastweeklyenergy:
friendly_name: "lastweeklyenergy"
unique_id: sensor.lastweeklyenergy_peak
unit_of_measurement: "KWH"
value_template: "{{state_attr('sensor.weeklyenergy_peak','last_period')}}" #计算来自周电量
icon_template: mdi:counter
- platform: template #上月电量
sensors:
lastmonthlyenergy_peak:
friendly_name: "lastmonthlyenergy"
unique_id: sensor.lastmonthlyenergy_peak
unit_of_measurement: "KWH"
value_template: "{{state_attr('sensor.monthlyenergy_peak','last_period')}}" #计算来自月度电量
icon_template: mdi:counter
参考官方示例https://www.home-assistant.io/integrations/utility_meter
可以做到日周月季年的清零 |
评分
-
查看全部评分
|