我有一个非常简单的问题。

这是一个视图:

标题:测试路径:测试面板:false图标:'MDI:CAR'卡: - 类型:'custom:state -switch'实体:input_boolean.test_boolean默认值:“ off”过渡:无状态:on on type:type:type:oftities:type:实体:标题:1个实体: - 太阳。sun.sun -sun.sun- sun -sun-sun-类型:'自定义:状态切换'实体:input_boolean.test_boolean_2默认值:“ off”过渡:无状态:on on':on oon“:type:type:type:type:type:2实体:2个实体: - 太阳。-  sun.sun-类型:'自定义:state -switch'实体:input_boolean.test_boolean_3默认值:“ off”过渡:无状态:“ on”:type:type:type:type:type:3个实体: -  sun.sun-sun-sun-sun-sun.sun-sun-sun-Sun.Sun- Sun.Sun- Sun.Sun -Sun- Sun.Sun- Sun.Sun.Sun -Sun.Sun- Sun.Sun -Sun -Sun.Sun.Sun -Sun.Sun.Sun.Sun.Sun.Sun-Sun.Sun.Sun.Sun.Sun-Sun.Sun.Sun-Sun-类型:实体实体: - 实体:input_boolean.test_boolean-实体:input_bolean.test_boolean_2-实体:input_boolean.test_boolean_3

它有:

  • 三个实体卡(在州开关内);
  • 带有切换的实体卡。

这是一张图片:

是否可以不显示空格?

更新(27/10/21):
注册了一个问题:

感谢这张出色的卡!它运行良好,我想进一步探索它。
但是,我正在努力解决两个问题,您可以帮助我解决这些问题。

  1. 我想使用两个开关,例如选择一个地板,然后为我提供不同的房间选项,然后是第二个开关。例如。我想选择一楼并首先显示一个概述页面,然后我想选择客厅,向我展示该房间中的实体。知道我如何解决这个问题?

  2. 一旦我放置州开关,我的幻灯片就不再工作了。有人知道我如何使用两者?

提前致谢

你好,
感谢您的另一张好卡!
我想知道您是否可能会想到如何实施我尝试做的事情。
我的视图显示了灯按钮,但只有当前亮的灯。这个很容易。即使使用常规有条件卡。
但是,我希望在我的视图上时,我关闭了一个灯,该按钮仍将保留在视图上,直到我闭上视图并再次打开,然后它将消失,当我单击时,它将不正确在上面。
或者至少要在视野上保持一段时间……让我重新打开,以防万一我错误地将其关闭。

知道该卡如何做到这一点?

找到了与iOS Companion应用有关的可能的错误。

有一个input_select价值:

input_select:test_value:选项: - 一个 - 两个 - 三个

该卡应该为所有3个选择显示类似的实体卡:

- 类型:垂直堆栈卡片: - 类型:实体实体: - 实体:input_select.test_value名称:选择 - 类型:custom:state -switch entity:input_select.test_value defaule default:“一个”过渡:fliptription_time:flip transition_time:500个国家:500个国家:”一个“:类型:垂直堆栈卡片: - 类型:实体标题:一个实体: - 实体:input_boolean.test_boolean tap_action:无“二”:type:type:type:fertical -stack cards: - 类型: - 类型:实体标题: - 实体: - 实体: - 实体: -:input_boolean.test_boolean tap_action:无“三”:类型:垂直堆栈卡片: - 类型:实体标题:三个实体: -  enput_boolean.test_boolean.test_boolean tap_action:无

图片
它可以正常工作 - 但仅在PC上(Win10x64,Chrome)。

在iOS Companion应用程序上,它无法正常工作。
复选框只能为某个选择切换(我注意到“三”)。

带有垂直堆栈的代码正常工作:

- 类型:自定义:状态 - 开关ENTITY:input_select.test_value默认值:“一个”过渡:flip transition_time:500个状态:“一个”:“一个”:type:type:entities title:一个实体: -  enput_boolean.test _boolean.test_boolean tap_action::类型:实体标题:两个实体: - 实体:input_boolean.test_boolean tap_action:none“三”:类型:实体标题:三个实体: -  entity:input_boolean.test_boolean tap_action:none none

使用垂直堆栈对我来说很重要…

在GitHub上注册了一个问题:

更新:
我设法通过关闭过渡来绕过问题:
过渡:翻转- 需要评论此字符串。
然后卡开始按预期工作。

可能同样的问题:

嗨,我想知道是否有人知道我如何在没有卡周围的边界的情况下将这2张卡片组合在一起?谢谢。
图片

我们可以在tempate中使用用户或deviceid
用法是要显示何时发出警报,但仅适用于售货亭用户?

如何实现这一目标?

目前我有这个

- 类型:自定义:state-switch entity:> {%如果IS_STATE('Binary_sensor.kiosk_alarmstatus','on'on')%} allaMARNON {%alse {%else%} alarmoff {%endif%} states:armartoff:armartoff:armartoff:... ...

这张自定义卡就是这样做的:

1喜欢

出于好奇心:是否以某种方式定义”<5英寸的状态?(少于5)
即比州比州少?
甚至可能是文字”(不包含“文本”)

嗨,我想使用这样的模板使用状态开关卡…

类型:自定义:状态转换实体:“ {%如果IS_STATE('swith.night_mode','on')和现在()。状态:日:类型:Markdown内容:您今天要去哪里?晚上:类型:降价内容:睡觉!

…但是基于DeviceID(浏览器模型),但我不知道如何处理模板中的DeviceID。我尝试了几种选择,但没有工作……

entity: "{% if (deviceID = "xxxxxxxx") or (deviceID = "aaaaaaa") %} day {% else %} night {% endif %}" or entity: "{% if (sensor.deviceID = "xxxxxxxx”)或(sensor.deviceid =“ aaaaaaa”)%} day {%else%}夜{%endif%}”

有可能吗?
提前致谢。

我正在使用此卡在不同的多媒体遥控器(其中四个)之间切换。

我已经有一个问题已经有一段时间了,并决定今天解决这个问题。请注意,最后一行按钮的阴影似乎是如何切断的。

起初,我以为有一些分隔线或边界,但是几项检查什么也没透露。然后,我开始使用卡模型,边距和填充物,然后注意到实际上是其他3个遥控器(一组按钮)被覆盖和隐藏。分配时,我可以很清楚地看到这一点。100px到底部边缘或填充。无论我选择哪个输入,其他3组总是会导致同一问题。

屏幕截图中的按钮的顶行是设置选择器的原因(未包含在下面的配置中)。

我可以通过插入幻影行来解决这个问题。微弱的灰色线仍然显示出来,但至少阴影没有被切断。

在论坛或卡的问题跟踪器上,我找不到与此相关的内容。我还认为它与垂直堆栈卡有关,但也找不到任何东西。我通过在DOM树的各个地方编辑和添加样式来尝试各种事情。

我是唯一看过这个的人吗?我还有什么可以尝试的吗?

这是我的卡配置:

- 类型:自定义:State-Switch Entity:input_select.selected_remote状态:电视:类型:垂直堆栈卡片: - 类型:Horizo​​ntal-stack cards: -  type:type:custom:custom:button-card entity:script.samssung_tv_power size:45%样式:45%样式:ICON: - 颜色:rgb(255,0,0)show_name:false tap_action:操作:呼叫服务效果:script.turn_on service_data:entity_id:entity_id:script.samssung_tv_power-类型 - 类型 -  entity -button entity:script.sams.samssung_tv_hdmiishow_name:false tap_action:操作:呼叫 - 服务服务:脚本。entity_id:script.samsung_tv_picture_mode-类型:水平堆栈卡片: - 类型:custom:custom:button-card entity:script.samssung_tv_hdmi2 expact_ratio:3.2 show_name:show_name:false Icon:fresse Icon:mdi:mdi:apple tap_action:actair tap_action:action:action:call-service:call-service service:script.turn_on_on_ternew_on_terne_on_datadaadata,:entity_id:script.samsung_tv_hdmi2- typE:自定义:按钮卡实体:script.samssung_tv_hdmi1 expact_ratio:3.2 show_name:false Icon:mdi:set-top-box tap_action:action:call-service服务:call-service服务:script.turn_on service_data:entity_id:entity_id:script.sams.samssung_tv_hdmi#黑客,因为状态开关卡“流血”底部的下一个设置试图用卡模型改进这一点,这似乎无助于#插入幻影行仍然使它看起来像是一个微弱的分隔线#,但至少至少是最后一个按钮行的阴影未遮盖##此选择器重复此hack  - 类型:水平堆栈卡片: - 类型:自定义:button-card color_type:空白卡音频:类型:垂直堆栈卡片: - 类型:水平堆栈卡片: - 类型:自定义:按钮卡实体:script.hk_3380_power_on expact_ratio:3.2 show_name:false样式:false样式: - 颜色:color:rgb(255,0,0,0)tap_action:call-service:call-service:call-service haptic:light:light:light:轻:服务:script.turn_on service_data:entity_id:script.hk_3380_power_on-power_on-类型:自定义:button -card entity:script.hk_3380_power_off aspect_ratio: 3.2 show_name: false tap_action: action: call-service haptic: light service: script.turn_on service_data: entity_id: script.hk_3380_power_off - type: horizo​​ntal-stack cards: - type: custom:button-card entity: script.hk_3380_vid1show_name:错误大小:45%样式:网格: - 位置:相对custom_fields: -  source: - 位置:绝对 - 左:80% - 顶部:60% - 高度:20px-宽度:20px custom_fields:source> source> [[[return return> [[[return return] `` ]]] tap_action: action: call-service haptic: light service: script.turn_on service_data: entity_id: script.hk_3380_vid1 - type: custom:button-card entity: script.hk_3380_vid2 show_name: false size: 45% tap_action: action: call-service haptic: light service: script.turn_on service_data: entity_id: script.hk_3380_vid2 styles: grid: - position: relative custom_fields: source: - position: absolute - left: 80% - top: 60% - height: 20px - width: 20px custom_fields: source: > [[[ return `` ]]] - type: entity-button entity: script.hk_3380_dimmer show_name: false size: 45% tap_action: action: call-service service: script.turn_on service_data: entity_id: script.hk_3380_dimmer - type: horizontal-stack cards: - type: custom:button-card entity: script.hk_3380_vol_down show_name: false tap_action: action: call-service haptic: light service: script.turn_on service_data: entity_id: script.hk_3380_vol_down hold_action: repeat: 200 action: call-service haptic: selection service: script.turn_on service_data: entity_id: script.hk_3380_vol_down double_tap_action: action: call-service haptic: medium service: script.turn_on service_data: entity_id: script.hk_3380_vol_down_minus_5 - type: custom:button-card entity: script.hk_3380_vol_up show_name: false tap_action: action: call-service haptic: light service: script.turn_on service_data: entity_id: script.hk_3380_vol_up hold_action: repeat: 200 action: call-service haptic: selection service: script.turn_on service_data: entity_id: script.hk_3380_vol_up double_tap_action: action: call-service haptic: medium service: script.turn_on service_data: entity_id: script.hk_3380_vol_up_plus_5 - type: custom:button-card entity: script.hk_3380_mute show_name: false styles: icon: - color: rgb(255, 0, 0) tap_action: action: call-service haptic: light service: script.turn_on service_data: entity_id: script.hk_3380_mute # this is a hack - type: horizontal-stack cards: - type: custom:button-card color_type: blank-card "Apple TV": type: vertical-stack cards: - type: horizontal-stack cards: - type: custom:button-card entity: script.apple_tv_menu aspect_ratio: 3.2 show_name: false tap_action: action: call-service haptic: light service: script.turn_on service_data: entity_id: script.apple_tv_menu - type: custom:button-card entity: script.apple_tv_home aspect_ratio: 3.2 show_name: false tap_action: action: call-service haptic: light service: script.turn_on service_data: entity_id: script.apple_tv_home double_tap_action: action: call-service haptic: light service: script.turn_on service_data: entity_id: script.apple_tv_home_double_press hold_action: action: call-service haptic: medium service: remote.send_command service_data: entity_id: remote.living_room command: home_hold - type: horizontal-stack cards: - type: custom:button-card color_type: blank-card - type: entity-button entity: script.apple_tv_up show_name: false tap_action: action: call-service service: script.turn_on service_data: entity_id: script.apple_tv_up - type: custom:button-card color_type: blank-card - type: horizontal-stack cards: - type: entity-button entity: script.apple_tv_left show_name: false tap_action: action: call-service service: script.turn_on service_data: entity_id: script.apple_tv_left - type: entity-button entity: script.apple_tv_ok show_name: false tap_action: action: call-service service: script.turn_on service_data: entity_id: script.apple_tv_ok - type: entity-button entity: script.apple_tv_right show_name: false tap_action: action: call-service service: script.turn_on service_data: entity_id: script.apple_tv_right - type: horizontal-stack cards: - type: custom:button-card color_type: blank-card - type: entity-button entity: script.apple_tv_down show_name: false tap_action: action: call-service service: script.turn_on service_data: entity_id: script.apple_tv_down - type: custom:button-card color_type: blank-card - type: horizontal-stack cards: - type: entity-button entity: script.apple_tv_skip_backward show_name: false tap_action: action: call-service service: script.turn_on service_data: entity_id: script.apple_tv_skip_backward - type: entity-button entity: script.apple_tv_play_pause show_name: false tap_action: action: call-service service: script.turn_on service_data: entity_id: script.apple_tv_play_pause - type: entity-button entity: script.apple_tv_skip_forward show_name: false tap_action: action: call-service service: script.turn_on service_data: entity_id: script.apple_tv_skip_forward # this is a hack - type: horizontal-stack cards: - type: custom:button-card color_type: blank-card

谢谢@ildar_gabdullin- 实际上,我在经历记录的问题时遇到了这个问题,但不知道它是相关的。我已经订阅了这个问题,并将等待修复。

嗨,没有回答我的问题……我的帖子不清楚还是愚蠢?thx ton任何帮助。最好。

嘿,

我有一张带有一些Broadlink IR控制按钮的卡,只有在用户回家的情况下,我想显示此卡。因此,例如,我有两个用户:汤姆和克里斯。

如果汤姆在家而克里斯不在:→表演卡到汤姆,请从克里斯隐藏卡
如果汤姆(Tom)不在,克里斯(Chris)在家:→从汤姆(Tom
两者都不在:→两者的隐藏卡
两者都是家→表演卡

因此,这不仅取决于登录的当前用户,还取决于用户状态(家庭 /外出)。

我不知道该怎么做。有谁可以帮助我吗。

谢谢!

此卡可以在图片元素内使用吗?目前,我正在使用有条件的卡,但它会不时会出现0.0的错误。我需要一个替换选项。

  • 类型:图片元素
    图像:/local/photos/lovelace_photos/2k_3dhome/hoz_view/2k_base_bw_0.5.png
    元素:
    #####################
    #####警报武装房屋
    - 类型:自定义:状态开关
    实体:alarm_control_panel.ring_alarm
    状态:
    Armed_home:
    元素:
    - 类型:图像
    图像:/local/photos/lovelace_photos/2k_3dhome/hoz_view/2k_alarm_border.png
    风格:

    左:50%顶部:50.25%宽度:100%Armed_away:元素: - 类型:图像:/local/photos/lovelace_photos/2k_3dhome/hoz_view/2k_alarm_border.porder.png.png样式:左
1喜欢

大家好,
我有一个定制按钮卡这显示了我平板电脑的电池百分比。当我打开Entrokiosk在他们甚至我的计算机上,纽扣卡失踪了。当我转到另一个HA页面并回到所需的页面时,它会出现并留在那里。看起来自定义状态开关无法弄清楚哪个用户第一次我们在浏览器中打开HA。- 或者我做错了什么。请查看下面的代码,并告诉我在哪里错了。
实际上,起初我尝试了设备编号并有相同的行为。然后,我为每个平板电脑创建了一个用户,但相同。

- 类型:自定义:状态转换实体:用户默认值:fireHD状态:fireHD:firehd:type:custom:button-card entity:sensor.firehd_battery_level show_icon:true show_name:true show_name:true color:green name:| |[[[return entity.state +'%';]] state: - 运算符:模板值:|[[[return Entity.State <20]]]样式:图标: - 颜色:黄色M10:类型:自定义:button -card entity:sensor.m10_battery_level show_icon:true show_name:true show_name:true color:green Name:| |[[[return entity.state +'%';]] state: - 运算符:模板值:|[[[return entity.state <20]]]样式:图标: - 颜色:黄色

我对Hash状态转换有一个问题,在内部自定义时不起作用:网格延伸。我可以通过手动打字来使它起作用#状态在URL中,但只有我首先使用未分配为默认的状态。这是我的代码:

类型:自定义:网格路径:家庭布局:#default网格间隙:var( -  custom-layout-card-padding)grid-template-columns:重复(4,1fr)0 Grid-Template-Rows:0重复(2,fit-content(100%))网格 - 板序列:|“侧边栏……。”“侧栏实体实体实体。”“ sidebar_buttons页脚页脚。”MediaQuery:#phone“(最大宽度:800px)”:网格差距:calc(var( -  custom-layout-card-padding) * 1.7)网格 - 板块列表:0重复(2,1fr)0网格-template行:0重复(4,fit-content(100%))网格 - 板截面:|“…………”“。侧栏侧边栏。”“。实体实体。”“。页脚。” ". sidebar_buttons sidebar_buttons ." cards: - !include sidebar.yaml - type: custom:state-switch entity: hash default: rooms view_layout: grid-area: entities states: rooms: type: vertical-stack cards: - a bunch of stuff devices: type: vertical-stack cards: - more stuff media: type: vertical-stack cards: - more stuff - !include footer.yaml

进一步解释该问题:
在Lovelace中选择仪表板或输入仪表板URL到浏览器中时,在状态切换区域中没有加载。添加时#房间在URL上,再次没有加载。添加时#设备在URL上,设备状态将加载。然后,我可以选择为#房间#媒体这些实体将加载。我还通过更改默认值:状态进行了测试,该状态证实默认值也不会加载,即使最初手动将#放在URL中。我不确定我的代码是否有问题或状态切换卡的问题。

你好!是否有一种简单的方法可以根据当前选择的状态突出显示实体按钮?我在这里找不到答案。在Readme中,动画准确地显示了我希望它是如何成为的(所选状态的蓝色背景),但是在文本(用于哈希)中,每个按钮都有某种虚拟灯开关实体……doesn’t work. These are then just normal buttons. Should we create a numeric input and somehow check for the value and then highlight the appropriate entity-button? It’s doable, not sure if that’s the prettiest solution. Thanks.

我已经在此帖子之后创建了来自多个开关的无线电按钮:

…因此,按下一个按钮(必须是自定义的类型:按钮卡),相应的开关已打开,所有其余的按钮都关闭。TAP动作应该是这样的:

Tap_Action:操作:navigate navigation_path:'#some_state'multi_calls:|[[[HASS.CALLSERVICE(“ switch”,“ turn_on”,{entity_id:“ switch.some_switch”});]]]]

我认为这仍然不是最好的解决方案。无法动态设置从例如。当前input_select选项。也许至少有一种方法可以在负载上运行脚本,该脚本将在加载按钮卡后立即切换所选默认状态的开关。

即使那样,这仍然不是一个完美的解决方案。例如,如果其他人同时使用HA在状态之间切换,则即使不按下任何按钮,也会突出显示视图中的不同按钮。

是否可以将彼此嵌套的多个状态开关实体?目前,我要获得第二组状态开关,均显示开机卡和关闭状态卡(每个UI编辑2张卡)。