本帖最后由 dscao 于 2020-8-15 23:54 编辑
带锁的需要用这个类型的才行:
type: 'custom:button-card'
cards:
- cards:
- cards:
- color: 'rgb(223, 150, 97)'
color_type: card
entity: sensor.dc1_power
name: 功率
show_icon: false
show_label: false
show_last_changed: false
show_name: true
show_state: true
show_units: true
state:
- color: 'rgb(255, 255, 255)'
operator: <
styles:
card:
- filter: opacity(80%)
icon:
- filter: grayscale(100%)
value: 0.1
styles:
card:
- height: 40px
type: 'custom:button-card'
- color: 'rgb(142, 189, 208)'
color_type: card
entity: sensor.dc1_current
name: 电流
show_icon: false
show_label: false
show_last_changed: false
show_name: true
show_state: true
show_units: true
state:
- color: 'rgb(255, 255, 255)'
operator: <
styles:
card:
- filter: opacity(80%)
icon:
- filter: grayscale(100%)
value: 0.1
styles:
card:
- height: 40px
type: 'custom:button-card'
- color: 'rgb(106, 180, 197)'
color_type: card
entity: sensor.dc1_voltage
name: 电压
show_icon: false
show_label: false
show_last_changed: false
show_name: true
show_state: true
show_units: true
state:
- color: 'rgb(255, 255, 255)'
operator: <
styles:
card:
- filter: opacity(80%)
icon:
- filter: grayscale(100%)
value: 220
styles:
card:
- height: 40px
type: 'custom:button-card'
type: vertical-stack
- color: 'rgb(146, 180, 97)'
color_type: card
entity: switch.dc1_1
entity_picture: /ha_sidebar-local/1.6.3/lovelace/air.jpg
icon: 'mdi:power'
lock:
enabled: true
name: 插孔1
show_entity_picture: false
show_icon: true
show_label: false
show_last_changed: false
show_name: true
show_state: false
show_units: true
state:
- styles:
card:
- filter: opacity(80%)
icon:
- filter: grayscale(100%)
value: 'off'
styles:
card:
- height: 135px
type: 'custom:button-card'
- color: 'rgb(100, 200, 140)'
color_type: card
entity: switch.dc1_2
entity_picture: /ha_sidebar-local/1.6.3/lovelace/air.jpg
icon: 'mdi:power'
lock: false
name: 插孔2
show_entity_picture: false
show_icon: true
show_label: false
show_last_changed: false
show_name: true
show_state: false
show_units: true
state:
- styles:
card:
- filter: opacity(80%)
icon:
- filter: grayscale(100%)
value: 'off'
styles:
card:
- height: 135px
type: 'custom:button-card'
- color: 'rgb(123, 200, 164)'
color_type: card
entity: switch.dc1_3
entity_picture: /ha_sidebar-local/1.6.3/lovelace/air.jpg
icon: 'mdi:power'
lock: false
name: 插孔3
show_entity_picture: false
show_icon: true
show_label: false
show_last_changed: false
show_name: true
show_state: false
show_units: true
state:
- styles:
card:
- filter: opacity(80%)
icon:
- filter: grayscale(100%)
value: 'off'
styles:
card:
- height: 135px
type: 'custom:button-card'
- cards:
- color: 'rgb(76, 195, 97)'
color_type: card
entity: sensor.dc1_today
icon: 'mdi:wifi'
name: 今日电量
show_icon: false
show_label: false
show_last_changed: false
show_name: true
show_state: true
show_units: true
state:
- operator: ''
styles:
card:
- filter: opacity(60%)
icon:
- filter: grayscale(100%)
value: -86
styles:
card:
- height: 40px
type: 'custom:button-card'
- color: 'rgb(76, 195, 97)'
color_type: card
entity: sensor.dc1_yesterday
icon: 'mdi:wifi'
name: 昨日电量
show_icon: false
show_label: false
show_last_changed: false
show_name: true
show_state: true
show_units: true
state:
- operator: ''
styles:
card:
- filter: opacity(60%)
icon:
- filter: grayscale(100%)
value: -86
styles:
card:
- height: 40px
type: 'custom:button-card'
- color: 'rgb(76, 195, 97)'
color_type: card
entity: sensor.dc1_total
icon: 'mdi:wifi'
name: 总电量
show_icon: false
show_label: false
show_last_changed: false
show_name: true
show_state: true
show_units: true
state:
- operator: ''
styles:
card:
- filter: opacity(60%)
icon:
- filter: grayscale(100%)
value: -86
styles:
card:
- height: 40px
type: 'custom:button-card'
type: vertical-stack
type: horizontal-stack
- color: 'rgb(241, 103, 69)'
color_type: card
entity: switch.dc1_total
entity_picture: /ha_sidebar-local/1.6.3/lovelace/air.jpg
lock:
enabled: true
name: 1号插排电源总控 | USB电源
show_entity_picture: false
show_icon: false
show_label: false
show_last_changed: false
show_name: true
show_state: false
show_units: true
state:
- styles:
card:
- filter: opacity(80%)
icon:
- filter: grayscale(100%)
value: 'off'
styles:
card:
- height: 40px
type: 'custom:button-card'
type: vertical-stack
|