状态栏
type: custom:stack-in-card
cards:
- type: custom:layout-card
layout_type: masonry
layout: {}
cards:
- type: horizontal-stack
cards:
- type: custom:mushroom-template-card
icon: |
{% if is_state(entity, 'online') %}
mdi:wifi
{% elif is_state(entity, 'driving') %}
mdi:steering
{% elif is_state(entity, 'asleep') %}
mdi:sleep
{% elif is_state(entity, 'charging') %}
mdi:battery-charging
{% else %}
mdi:help-rhombus
{% endif %}
icon_color: |
{{ 'green' if is_state(entity, 'online') else 'grey' }}
primary: 当前
secondary: |
{% if is_state(entity, 'online') %}
在线
{% elif is_state(entity, 'asleep') %}
睡眠
{% elif is_state(entity, 'charging') %}
充电
{% elif is_state(entity, 'driving') %}
行驶中
{% else %}
未知
{% endif %}
entity: sensor.zhuang_tai
fill_container: false
multiline_secondary: false
layout: vertical
card_mod:
style: |
mushroom-card {
background-size: 42px 42px;
}
ha-card {
width: 68px;
border-radius: 30px;
margin-left: auto;
margin-right: auto;
}
tap_action:
action: more-info
- type: custom:mushroom-template-card
icon: mdi:shield-home
icon_color: |
{{ 'green' if is_state(entity, 'true') else 'grey' }}
primary: 哨兵
secondary: '{{ ''开'' if is_state(entity, ''true'') else ''关'' }} '
entity: sensor.shao_bing_mo_shi
fill_container: false
multiline_secondary: false
layout: vertical
card_mod:
style: |
mushroom-card {
background-size: 42px 42px;
}
ha-card {
width: 68px;
border-radius: 30px;
margin-left: auto;
margin-right: auto;
}
tap_action:
action: more-info
- type: custom:mushroom-template-card
icon: mdi:lock
icon_color: |
{{ 'blue' if is_state(entity, 'true') else 'grey' }}
primary: 车锁
secondary: '{{ ''已锁'' if is_state(entity, ''true'') else ''未锁'' }} '
entity: sensor.zhi_shi_che_liang_shi_fou_yi_suo_zhi
fill_container: false
multiline_secondary: false
layout: vertical
card_mod:
style: |
mushroom-card {
background-size: 42px 42px;
}
ha-card {
width: 68px;
border-radius: 30px;
margin-left: auto;
margin-right: auto;
}
tap_action:
action: more-info
- type: custom:mushroom-template-card
icon: >
{% set battery_level =
states('sensor.dian_chi_dian_liang_bai_fen_bi') | int %}
{% if battery_level < 20 %}
mdi:battery-20
{% elif battery_level >= 80 %}
mdi:battery
{% else %}
mdi:battery-80
{% endif %}
icon_color: >
{% set battery_level =
states('sensor.dian_chi_dian_liang_bai_fen_bi') | int %}
{% if battery_level < 20 %}
red
{% elif battery_level >= 80 %}
brown
{% else %}
green
{% endif %}
primary: 电量
secondary: |
{{ states('sensor.dian_chi_dian_liang_bai_fen_bi') }}%
entity: sensor.dian_chi_dian_liang_bai_fen_bi
fill_container: false
multiline_secondary: false
layout: vertical
card_mod:
style: |
mushroom-card {
background-size: 42px 42px;
}
ha-card {
width: 68px;
border-radius: 30px;
margin-left: auto;
margin-right: auto;
}
tap_action:
action: more-info
- type: custom:mushroom-template-card
icon: mdi:ev-station
icon_color: |
{{ 'green' if is_state(entity, 'true') else 'grey' }}
primary: 充电器
secondary: '{{ ''已插入'' if is_state(entity, ''true'') else ''未插入'' }} '
entity: sensor.ru_guo_che_liang_dang_qian_yi_cha_ru_chong_dian_qi
fill_container: false
multiline_secondary: false
layout: vertical
card_mod:
style: |
mushroom-card {
background-size: 42px 42px;
}
ha-card {
width: 68px;
border-radius: 30px;
margin-left: auto;
margin-right: auto;
}
tap_action:
action: more-info
card_mod:
style: |
ha-card {
padding: 2px;
background: rgba(var(--rgb-primary-text-color), 0.01);
}
|