找回密码
 立即注册
搜索
查看: 1541|回复: 2

[求助] HA自带的条件卡片用button-card怎么写啊

[复制链接]

1

主题

26

回帖

232

积分

中级会员

积分
232
金钱
205
HASS币
0
发表于 2024-3-22 22:24:33 | 显示全部楼层 |阅读模式
悬赏20金钱未解决
本帖最后由 466491587 于 2024-3-22 22:46 编辑

大佬们,HA自带的条件按钮卡片,用button-card怎么写啊,自带的卡片在弹出卡片里面无法正常显示

type: conditional
conditions:
  - condition: state
    entity: light.lemesh_wy0c15_9302_light
    state: 'on'
card:
  show_name: true
  show_icon: true
  type: button
  tap_action:
    action: toggle
  entity: switch.xiaomi_86v1_b2cb_left_switch_service
  icon: mdi:track-light
  show_state: false
  name: 橱柜灯

回复

使用道具 举报

2

主题

26

回帖

213

积分

中级会员

积分
213
金钱
185
HASS币
0
QQ
发表于 2025-5-24 00:28:12 | 显示全部楼层
本帖最后由 s763279737 于 2025-5-24 00:29 编辑
type: conditional
conditions:
  - condition: state
    entity: light.lemesh_wy0c15_9302_light
    state: 'on'
card:
  type: custom:button-card
  entity: switch.xiaomi_86v1_b2cb_left_switch_service
  name: 橱柜灯
  icon: mdi:track-light
  show_name: true
  show_icon: true
  show_state: false
  tap_action:
    action: toggle

回复

使用道具 举报

3

主题

104

回帖

754

积分

高级会员

积分
754
金钱
647
HASS币
0
发表于 2025-5-27 17:42:23 | 显示全部楼层
本帖最后由 home_assistant 于 2025-5-27 17:48 编辑

楼主,你写的逻辑没有问题的,但是不弹出估计是button-card本身的BUG。
建议使用custom:state-switch
是在App上测试的?有些老版的游览器也可能会问题。你可以在Chorme网页端口上,尝试下你的这个逻辑?是不是开灯时有正常弹出。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )

GMT+8, 2025-6-26 15:16 , Processed in 0.476005 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表