How to toggle multiple entities and navigate in a mushroom-template-card?

I have a mushroom-template card and the icon color changes nicely. But i want to be able to toggle two intities when i hold it and navigate when i tab on it.

I have the following code which does not present an error (or log for that matter) but it does not toggle the lights and navagating is not working.

              - type: custom:mushroom-template-card
                primary: Woonkamer
                secondary: >
                  {{ states('sensor.livingroom_temperature') }}°c / {{
                  states('sensor.livingroom_humidity') }}%
                icon: hue:room-living
                entity:
                    - light.living_room
                    - light.corner_lights
                tap_action:
                  action: navigate
                  navigation_path: /mushroom-home/woonkamer
                hold_action:
                  action: toggle
                icon_color: |-
                  {% if is_state('light.living_room', 'on') %}
                    orange
                  {% endif %}

When i use service:

                  service: light.toggle
                  service_data:
                    entity_id:
                      - light.living_room
                      - light.corner_lights

the lights are toggling fine but navigating is not working.

Any idea why this is not working and how to fix that?

you can only use one entity.
add them into a group and use the group as the entity. Will then toggle the light group on and off

i tried one entity and that was woking and just modified my post because i can use a service call to toggle two lights. But i can not get this navigation working.

All of a sudden it just works… might have been a but or something because i did not change anything.

working code:

              - type: custom:mushroom-template-card
                primary: Woonkamer
                secondary: >
                  {{ states('sensor.livingroom_temperature') }}°c / {{
                  states('sensor.livingroom_humidity') }}%
                icon: hue:room-living
                entity: light.living_room
                tap_action:
                  action: navigate
                  navigation_path: /mushroom-home/woonkamer
                hold_action:
                  action: call-service
                  service: light.toggle
                  service_data:
                    entity_id:
                      - light.living_room
                      - light.corner_lights
                icon_color: |-
                  {% if is_state('light.living_room', 'on') %}
                    orange
                  {% else %}
                    grey
                  {% endif %}
                card_mod:
                  style: |
                    ha-card {
                      cursor: pointer;
                    }
                    .icon {
                      cursor: pointer;
                      pointer-events: auto;
                    }
                    .icon ha-icon {
                      pointer-events: auto;
                    }
                    .icon ha-icon:active {
                      animation: none;
                    }
                    .icon {
                      pointer-events: auto !important;
                    }
                    .icon ha-icon {
                      pointer-events: auto !important;
                    }
                    ha-card .card-header,
                    ha-card .card-content {
                      pointer-events: none;
                    }
                    ha-card .card-header,
                    ha-card .card-content .primary,
                    ha-card .card-content .secondary {
                      pointer-events: none;
                    }
                    ha-card .card-content .primary {
                      pointer-events: none;
                    }
                double_tap_action:
                  action: call-service
                  service: light.toggle
                  service_data:
                    entity_id:
                      - light.living_room
                      - light.corner_lights

When i tab it will navigate and when i hold or double tab it will toggle the lights.

image

1 Like