type: vertical-stack
cards:
- type: custom:state-switch
entity: template
template: >-
{% if is_state('media_player.keting_xiaomi_tv', 'off') %} weather {% else
%} tv {% endif %}
states:
tv:
type: picture-entity
entity: camera.xiaomi_tv_capture
name: mdi:television
show_state: false
show_name: false
camera_image: camera.xiaomi_tv_capture
weather:
type: vertical-stack
cards:
- type: grid
cards:
- type: custom:button-card
entity: sensor.processor_temperature
name: ' '
icon: mdi:raspberry-pi
size: 50%
aspect_ratio: 1/1
styles:
card:
- height: 121px
- padding: 10%
- font-size: 10px
- text-shadow: 0px 0px 5px black
- text-transform: capitalize
grid:
- grid-template-areas: '"i temp" "n n" "cpu cpu" "ram ram" "disk disk"'
- grid-template-columns: 1fr 1fr
- grid-template-rows: 1fr min-content min-content min-content min-content
name:
- font-weight: bold
- font-size: 12px
- color: white
- align-self: middle
- justify-self: start
- padding-bottom: 3px
img_cell:
- justify-content: start
- align-items: start
- margin: none
- margin-top: '-15%'
- margin-left: '-12%'
icon:
- color: |
[[[
if (entity.state < 50) return 'lime';
if (entity.state >= 50 && entity.state < 70) return 'orange';
else return 'red';
]]]
- margin-top: '-17%'
custom_fields:
temp:
- font-size: 16px
- align-self: start
- justify-self: end
- margin-top: 0%
cpu:
- font-size: 13px
- padding-bottom: 3px
- margin-left: '-2%'
- align-self: middle
- justify-self: start
- '--text-color-sensor': >-
[[[ if (states["sensor.processor_use_percent"].state >
80) return "red"; ]]]
ram:
- font-size: 13px
- padding-bottom: 3px
- align-self: middle
- margin-left: '-2%'
- justify-self: start
- '--text-color-sensor': >-
[[[ if (states["sensor.memory_free"].state < 1024)
return "red"; ]]]
disk:
- font-size: 13px
- margin-bottom: '-4%'
- margin-left: '-1%'
- align-self: middle
- justify-self: start
- '--text-color-sensor': >-
[[[ if (states["sensor.disk_free_config"].state < 10)
return "red"; ]]]
custom_fields:
temp: |
[[[
return `<ha-icon
icon="mdi:thermometer"
style="width: 20px; height: 20px; color: yellow;">
</ha-icon><span>${entity.state}</span>`
]]]
cpu: |
[[[
return `<ha-icon
icon="mdi:cpu-32-bit"
style="width: 19px; height: 19px; color: deepskyblue;">
</ha-icon><span> <span style="color: var(--text-color-sensor);">${states['sensor.processor_use_percent'].state} %</span></span>`
]]]
ram: |
[[[
return `<ha-icon
icon="mdi:memory"
style="width: 19px; height: 19px; color: deepskyblue;">
</ha-icon><span> <span style="color: var(--text-color-sensor);">${(states['sensor.memory_free'].state/1024).toFixed(2) } GB</span></span>`
]]]
disk: |
[[[
return `<ha-icon
icon="mdi:content-save"
style="width: 16px; height: 16px; color: deepskyblue;">
</ha-icon><span> <span style="color: var(--text-color-sensor);">${states['sensor.disk_free_config'].state} GB</span></span>`
]]]
- type: vertical-stack
cards:
- type: custom:button-card
entity: sensor.time
show_state: true
show_name: false
show_icon: false
styles:
card:
- font-size: 35px
- height: 56.5px
state:
- font-weight: null
- type: custom:button-card
entity: sensor.date
show_state: true
show_name: false
show_icon: false
styles:
card:
- font-size: 18px
- height: 56.5px
state:
- font-weight: bold
- type: vertical-stack
cards:
- type: custom:button-card
icon: mdi:home-assistant
styles:
card:
- height: 56.5px
icon:
- color: '#4DBFF3'
tap_action:
action: url
url_path: https://www.home-assistant.io/docs/
- type: custom:button-card
icon: mdi:google
styles:
card:
- height: 56.5px
icon:
- color: '#4285F4'
tap_action:
action: url
url_path: https://google.com
columns: 3
square: true
- type: weather-forecast
entity: weather.home
secondary_info_attribute: humidity
name: ' 上海'
- type: entities
entities:
- entity: sensor.jiang_shui_gai_lu
- entity: sensor.feng_li
- entity: sensor.feng_xiang
- entity: sensor.kong_qi_zhi_liang
- type: vertical-stack
cards:
- type: custom:mini-media-player
entity: media_player.keting_xiaomi_tv
state_label: ture
source: full
hide:
volume: false
source: false
power_state: false
icon_state: false
icon: true
tts:
platform: edge_tts
entity_id: media_player.airplay_f434f03785ad
shortcuts:
columns: 3
column_height: 100
hide_when_off: true
buttons:
- icon: mdi:home
type: service
id: shell_command.tv_home
- icon: mdi:arrow-up
type: service
id: shell_command.tv_up
- icon: mdi:menu
type: service
id: shell_command.tv_menu
- icon: mdi:arrow-left
type: service
id: shell_command.tv_left
- icon: mdi:image-filter-center-focus
type: service
id: shell_command.tv_enter
- icon: mdi:arrow-right
type: service
id: shell_command.tv_right
- icon: mdi:cog
type: service
id: shell_command.tv_settings
- icon: mdi:arrow-down
type: service
id: shell_command.tv_down
- icon: mdi:keyboard-return
type: service
id: shell_command.tv_back
group: false
volume_stateless: false
name: MITV
复制代码