type: vertical-stack
cards:
- type: horizontal-stack
cards:
- hours_to_show: 24
graph: none
type: sensor
detail: 1
entity: sensor.lastdate_power
name: 最近用电
- hours_to_show: 24
graph: none
type: sensor
detail: 1
entity: sensor.curmonth_power
name: 本月用电
- hours_to_show: 24
graph: none
type: sensor
detail: 1
entity: sensor.curmonth_fee
name: 本月电费
- type: horizontal-stack
cards:
- hours_to_show: 24
graph: none
type: sensor
detail: 1
entity: sensor.lastmonth_power
name: 上月用电
- hours_to_show: 24
graph: none
type: sensor
detail: 1
entity: sensor.lastmonth_fee
name: 上月电费
- type: horizontal-stack
cards:
- hours_to_show: 24
graph: none
type: sensor
detail: 1
entity: sensor.year_power
name: 今年用电
- hours_to_show: 24
graph: none
type: sensor
detail: 1
entity: sensor.year_fee
name: 今年电费
- type: horizontal-stack
cards:
- hours_to_show: 24
graph: none
type: sensor
detail: 1
entity: sensor.lastyear_power
name: 去年用电
- hours_to_show: 24
graph: none
type: sensor
detail: 1
entity: sensor.lastyear_fee
name: 去年电费
- type: custom:apexcharts-card
header:
show: true
title: 当月用电趋势图
graph_span: 35d
span:
start: month
offset: '-30d'
series:
- entity: sensor.everyday_power2
data_generator: |
return entity.attributes.date.map((item, index) => {
return [new Date(item).getTime(), entity.attributes.power[index]];
});
extend_to: false
float_precision: 2
name: 每日电量(kWh)
- type: custom:apexcharts-card
header:
show: true
title: 今年往月用电趋势图
graph_span: 1y
span:
start: year
series:
- entity: sensor.everymonth_power
data_generator: |
return entity.attributes.yearmonth.map((item, index) => {
return [new Date(item).getTime(), entity.attributes.power[index]];
});
extend_to: false
float_precision: 2
name: 每月电量(kWh)
- entity: sensor.everymonth_power
data_generator: |
return entity.attributes.yearmonth.map((item, index) => {
return [new Date(item).getTime(), entity.attributes.fee[index]];
});
extend_to: false
float_precision: 2
name: 每月电费(元)
- type: custom:apexcharts-card
header:
show: true
title: 去年往月用电趋势图
graph_span: 1y
span:
start: year
offset: '-1y'
series:
- entity: sensor.lastyeareverymonth_power
data_generator: |
return entity.attributes.yearmonth.map((item, index) => {
return [new Date(item).getTime(), entity.attributes.power[index]];
});
extend_to: false
float_precision: 2
name: 去年每月电量(kWh)
- entity: sensor.lastyeareverymonth_power
data_generator: |
return entity.attributes.yearmonth.map((item, index) => {
return [new Date(item).getTime(), entity.attributes.fee[index]];
});
extend_to: false
float_precision: 2
name: 去年每月电费(元)