WTH can't I define a tap or hold actions to show another entity in the UI?

Yesterday I had another case when I’d like to be able to define a hold or tap action for the Entities card to show a different entity instead of the one I tap on.
A simple use case:

  • I defined an automation that depends on the new schedule helper
  • I want to be able to quickly jump to this helper entity settings to redefine periods, but the only way is to put it in dashboard, which I don’t want

Currently the Entities card allows to define custom tap & hold actions, but they only show the properties of the entities I tap. I’d like to be able to show another entity properties instead.

+1 :+1:
Right now I’m using Browser Mod for that.
You can choose to show different entities when tap_action, double_tap_action, hold_action

Example:

When tap_action on this entity, the more info of power entity will be shown

And when double_tap_action, more info of the energy entity will be shown

type: custom:template-entity-row
entity: light.shelly_plus_1pm_swiatlo_podjazd_switch_0
name: Podjazd
double_tap_action:
  action: fire-dom-event
  browser_mod:
    service: browser_mod.more_info
    data:
      entity: sensor.shelly_plus_1pm_swiatlo_podjazd_switch_0_energy
hold_action:
  action: more-info
tap_action:
  action: fire-dom-event
  browser_mod:
    service: browser_mod.more_info
    data:
      entity: sensor.shelly_plus_1pm_swiatlo_podjazd_switch_0_power
icon: mdi:light-flood-down
color: >-
  {% if states("sensor.shelly_plus_1pm_swiatlo_podjazd_switch_0_power") | float
  > 2.6 %}
    gold
  {% else %}
    black
  {% endif %}
toggle: true
secondary: >-
  {{states("sensor.shelly_plus_1pm_swiatlo_podjazd_switch_0_power")}} W |
  {{states("sensor.shelly_plus_1pm_swiatlo_podjazd_switch_0_energy")}} kWh

2 Likes

Thanks for the tip, homey😉 I’m generally trying to avoid custom cards or components as they are risky (stability) and not resistant to changes in HA. Sometimes they are not updated on time or at all after some major breaking change is introduced in HA and this way they become incompatible, often leaving no alternative solution in HA itself.

I’d love to see this being a built-in feature in HA, and that’s what this WTH is about.

Perhaps the custom code can be a basis to build this into HA “standard” delivery👍

1 Like

Sure, I’d love this feature in HA as well, but for now this is my workaround :slight_smile:

1 Like

Bumping the topic hoping for others to vote. It’s really a must have for me🙂

1 Like

Siema Gentlemen,
I’m looking for a similar solution and this was literally the only post that matches the idea of what I would like to achieve I could find. So, I built my 3d floor plan and have it already displayed on a picture element card. Now I’m creating icons for different smart home itmes. I have light switches that are switch entities and yeelight rgb bulbs which are light entities. I don’t want to have two icons one for turning on the light and the other one so i could change the color. I would like to have one bulb/lamp icon which when tapped once toggles on the switch entity and when held shows light entity info from the bulb to change to color.

I’ve been trying to play around with the browser mod and i can’t get it to work. Can I ask for your advices please? That would be really helpful. Thank you in advance.

I took this example, but nothing happen when I click on it. I am trying to apply this to a custom mushroom entity card:

  - type: custom:mushroom-entity-card
    name: something
    layout: vertical
    entity: sensor.abc_test
    tap_action:
      action: fire-dom-event
      browser_mod:
        service: browser_mod.more_info
        data:
          entity: binary_sensor.0x00124b00292e0217_contact

Ok I guess the problem is that for a binary sensor I need to open its history, not more_info!