效果预览
代码
- type: custom:layout-card #弹出卡片代码开始,添加嵌套卡片#
layout type: custom:horizontal-layout
layout:
width: 60 #宽度
max_cols: 10 #最大值
style: #调整卡片位置#
top: 52.2%
left: 92%
opacity: 0.7 #不透明度
cards: #添加需要弹出的卡片按钮#
- type: horizontal-stack
cards:
- type: custom:mushroom-template-card
primary: 天气 #按钮名称
secondary: ''
icon: mdi:cloud #卡片图标 获取图标地址 https://joe1900.github.io/MDI/ #
layout: vertical
fill_container:
icon_color: '#20B2AA'
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
title: 天气 #添加弹出页面标题#
content: #添加需要弹出的卡片代码,以下代码替换成你要添加的卡片代码#
type: grid
square: false
columns: 1
cards:
- type: entities
entities:
- entity: sensor.wo_de_jia_feng_su
name: 风速
- entity: sensor.wo_de_jia_gan_jue_wen_du
name: 感觉温度
- entity: sensor.wo_de_jia_neng_jian_du
name: 能见度
- entity: sensor.wo_de_jia_qi_ya
name: 气压
- entity: sensor.wo_de_jia_shi_du
name: 湿度
- entity: sensor.wo_de_jia_shu_gua_zhi_shu
name: 舒适指数
- entity: sensor.wo_de_jia_wen_du
name: 温度
- entity: sensor.wo_de_jia_yu_liang
name: 雨量
- entity: sensor.wo_de_jia_yun_liang
name: 云量
- entity: sensor.wo_de_jia_zi_wai_xian
name: 紫外线
title: 我的家
- type: weather-forecast
entity: weather.wo_de_jia
show_forecast: false
备注:注意代码缩进
补充 手机UI界面的弹出卡片代码
type: custom:mushroom-template-card
primary: 空气炸锅
secondary: ''
icon: mdi:cloud
layout: vertical
fill_container: null
icon_color: '#20B2AA'
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
title: .
content:
type: grid
square: false
columns: 1
cards:
- type: entities
entities:
- entity: button.careli_maf03a_ae49_start_cook
name: 开始烹饪
- select.careli_maf03a_ae49_target_time
- number.careli_maf03a_ae49_target_temperature
- select.careli_maf03a_ae49_target_temperature
- switch.careli_maf03a_ae49_air_fryer_status
- button.careli_maf03a_ae49_cancel_cooking
- entity: button.careli_maf03a_ae49_pause
name: 暂停
title: 米家空气炸锅d