type: grid
cards:
- type: entities
state_color: true
show_header_toggle: false
entities:
- entity: sensor.dayelectricity
type: custom:multiple-entity-row
secondary_info: last-changed
name: 昨日用电
entities:
- attribute: f
name: 峰
- attribute: g
name: 谷
- entity: sensor.dayelectricityprice
type: custom:multiple-entity-row
entities:
- attribute: daypricef
name: 峰
- attribute: daypriceg
name: 谷
name: 昨日用电
- entity: sensor.monthelectricity
type: custom:multiple-entity-row
name: 月度用电
entities:
- attribute: f
name: 峰
- attribute: g
name: 谷
- entity: sensor.monthelectricityprice
type: custom:multiple-entity-row
name: 月度用电
entities:
- attribute: monthpricef
name: 峰
- attribute: monthpriceg
name: 谷
- entity: sensor.yearelectricity
name: 年度用电
- type: custom:bar-card
width: 45%
height: 2em
decimal: 0
unit_of_measurement: '%'
positions:
icon: outside
indicator: 'off'
name: outside
severity:
- color: Green
from: 0
to: 25
- color: Orange
from: 26
to: 50
- color: Red
from: 51
to: 100
entity_row: true
entities:
- entity: sensor.electricity_first
- entity: sensor.electricity_second
- type: custom:bar-card
width: 45%
height: 2em
decimal: 0
unit_of_measurement: 度
positions:
icon: outside
indicator: 'off'
name: outside
severity:
- color: '#303435'
from: 11
to: 100
- color: '#6d2525'
from: 0
to: 10
entity_row: true
entities:
- entity: sensor.electricity_thired
columns: 1
square: false
type: custom:apexcharts-card
graph_span: 30d
locale: zh-cn
all_series_config:
stroke_width: 2
opacity: 0.8
type: line
header:
show: true
title: 用电情况
show_states: true
colorize_states: true
series:
- entity: sensor.historyelectricity
name: 峰用电
data_generator: |
return entity.attributes.history.map((peak, index) => {
return [peak.DATETIME, peak.ZXYGZ2];
});
- entity: sensor.historyelectricity
name: 谷用电
data_generator: |
return entity.attributes.history.map((peak, index) => {
return [peak.DATETIME, peak.ZXYGZ4];
});
- entity: sensor.historyelectricity
name: 全天用电
data_generator: |
return entity.attributes.history.map((peak, index) => {
return [peak.DATETIME, peak.ZXYGZ];
});
|