Xxxxi 发表于 2023-10-11 10:02:31

本帖最后由 Xxxxi 于 2023-10-11 10:07 编辑

楼主,根据你的代码我简单修改了一下。现在有一个问题:
我先创建了灯组:

然后做了如下的弹出卡片:

代码如下:
type: vertical-stack
cards:
- type: custom:bubble-card
    card_type: pop-up
    name: 餐厅
    icon: mdi:microsoft-office
    entity: group.canting_lights
    hash: '#canting'
- type: grid
    square: false
    columns: 2
    cards:
      - type: custom:mushroom-entity-card
      primary_info: state
      secondary_info: name
      name: 温度
      fill_container: false
      icon_color: green
      layout: horizontal
      entity: sensor.3429ef0b1eae_envtemperature
      card_mod:
          style: |
            ha-card:active {
                transform: scale(0.975);
                transition: 0s;
            }
            ha-card {
            box-shadow: none;
            background: rgba(var(--rgb-primary-text-color), 0.06);
            }
      - type: custom:mushroom-entity-card
      primary_info: state
      secondary_info: name
      name: 湿度
      icon_color: blue
      entity: sensor.3429ef0b1eae_envhumidity
      card_mod:
          style: |
            ha-card:active {
                transform: scale(0.975);
                transition: 0s;
            }
            ha-card {
            box-shadow: none;
            background: rgba(var(--rgb-primary-text-color), 0.06);
            }
- type: custom:bubble-card
    card_type: separator
    name: 灯光
    icon: mdi:lightbulb
- type: custom:mushroom-entity-card
    entity: switch.d4f0eaeab24b_switch
    name: 餐厅主灯
    tap_action:
      action: toggle
- type: custom:mushroom-entity-card
    entity: switch.d4f0eaeab81d_switch
    name: 餐厅筒灯
    tap_action:
      action: toggle
- type: custom:mushroom-entity-card
    entity: switch.d4f0eaeab27d_switch
    name: 餐厅吊灯
    tap_action:
      action: toggle
- type: custom:bubble-card
    card_type: separator
    icon: mdi:fridge
    name: 冰箱
- square: false
    type: grid
    columns: 2
    cards:
      - type: custom:mushroom-template-card
      primary: >-
          冷藏室

          {% if states('binary_sensor.3429ef0b1eae_refrigeratordoorstatus')==
          'on' %}

          已开启

          {% elif states('binary_sensor.3429ef0b1eae_refrigeratordoorstatus')
          == 'off' %}

          已关闭

          {% endif%}
      secondary: 当前温度:{{states('sensor.3429ef0b1eae_refrigeratortemperaturec')}}°C
      icon: mdi:fridge-top
      icon_color: blue
      layout: horizontal
      - type: custom:mushroom-template-card
      primary: >-
          冷冻室

          {% if states('binary_sensor.3429ef0b1eae_freezerdoorstatus')== 'on'
          %}

          已开启

          {% elif states('binary_sensor.3429ef0b1eae_freezerdoorstatus')==
          'off' %}

          已关闭

          {% endif%}
      secondary: 当前温度:{{states('sensor.3429ef0b1eae_freezertemperaturec')}}°C
      icon: mdi:fridge-bottom
      icon_color: blue
      layout: horizontal
现在的情况是,我的餐厅一共有三个灯。
如果我开启一盏灯的情况 ,然后点击顶部的开关按钮

就会将开启的灯关闭,但是同时会将其余两盏未开启的灯打开。

这是什么原因呢?请问你也是这种情况吗?


同时为了验证灯组的设置是否有问题,我单独创建了卡片去试验:

这种情况下,开启一盏,或者两盏灯,去关闭灯组开关,只会把所有灯都关闭,不会打开其余未开启的灯。

希望楼主可以解惑。感谢。

Sparta 发表于 2023-10-11 11:33:34

本帖最后由 Sparta 于 2023-10-11 11:48 编辑

Xxxxi 发表于 2023-10-11 10:02
楼主,根据你的代码我简单修改了一下。现在有一个问题:
我先创建了灯组:


设置-设备与服务-辅助元素-群组-添加灯组,把所有餐厅灯实体添加进去,在Pop-up卡片添加你创建的辅助灯组实体应该就行了,直接在代码把group.canting_lights换成新创建的灯组实体也行

Xxxxi 发表于 2023-10-11 12:03:45

Sparta 发表于 2023-10-11 11:33
设置-设备与服务-辅助元素-群组-添加灯组,把所有餐厅灯实体添加进去,在Pop-up卡片添加你创建的辅助灯组 ...

我知道这个方法,这种方法选择灯组的话只能选择light类型,例如一个房间有light和switch两种类型的灯就没有办法在辅助元素中添加组。所以我直接在配置文件中添加了组。
还有其他方法可以把两种类型的添加为一个组吗?从而解决我现在遇到的问题。

Xxxxi 发表于 2023-10-11 14:31:21

补充一下我现在的具体情况:

rm6220534 发表于 2023-10-12 11:11:39

楼主,房间卡可以分享一下吗?谢谢了

hehe5487 发表于 2023-10-12 21:38:36

大佬问一下、HACS已经安装好了 但是仪表盘 添加不到这个卡片怎么回事

hehe5487 发表于 2023-10-12 22:23:28

本帖最后由 hehe5487 于 2023-10-12 22:41 编辑

可以了 我卸载掉 重新安装 就好了!

Sparta 发表于 2023-10-12 22:46:59

Xxxxi 发表于 2023-10-11 14:31
补充一下我现在的具体情况:

设置-设备与服务-辅助元素更-改开关的设备类型,把开关改为light这样就都可以加入灯组了

Xxxxi 发表于 2023-10-13 16:32:15

Sparta 发表于 2023-10-12 22:46
设置-设备与服务-辅助元素更-改开关的设备类型,把开关改为light这样就都可以加入灯组了 ...

看到了,感谢。

eigload 发表于 2024-1-18 10:09:26

大神,求配置
页: 1 2 [3] 4
查看完整版本: XDM推荐一张新出的弹出卡片,简洁大方