Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tap_action: support KString in navigation_path #724

Open
flxtr opened this issue Apr 27, 2024 · 2 comments
Open

tap_action: support KString in navigation_path #724

flxtr opened this issue Apr 27, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@flxtr
Copy link

flxtr commented Apr 27, 2024

Is your feature request related to a problem? Please describe.

I use HA-Battery-Notes to add Battery related meta data to my devices. It adds a sensor.*_battery_plus for battery powered devices among other things. I'm already showing some of this meta data as secondary info in the battery_state_card, which works really nice, thanks.

Another feature of Battery notes: in the device config, I can see a tapable Entity in the Diagnosis panel, to set replacement date to now. That's why I want configure a tap_action that navigates me to the device config. I tried to configure navigation_path: /config/devices/device/{attributes.device_id}, but KString is't supported and therefore device_id won't be replaced.

Describe the solution you'd like
I'd like tap_action.navigation_path to support placeholders, so I can configure things like this:

tap_action:
  action: navigate
  navigation_path: /config/devices/device/{attributes.device_id}

Additional context
My config (incl. currently broken placehodler navigation):

type: custom:battery-state-card
secondary_info: >-
  {attributes.battery_type_and_quantity} 🔃
  {attributes.battery_last_replaced|reltime()|equals(null, nie)}
filter:
  include:
    - name: entity_id
      value: '*_battery_plus'
  exclude:
    - name: entity_id
      value: binary_sensor.*
sort:
  by: state
collapse: 8
bulk_rename:
  - from: ' Battery'
  - from: ' level'
colors:
  steps:
    - '#ff0000'
    - '#ffff00'
    - '#00ff00'
  gradient: true
tap_action:
  action: navigate
  navigation_path: /config/devices/device/{attributes.device_id}

Battery replaced tapable in device config:
Screenshot_20240427-131827~2

@flxtr flxtr added the enhancement New feature or request label Apr 27, 2024
@foberleitner
Copy link

Also came to know about Battery State Card via Battery Notes and was searching if a dynamic tap_action navigation_path (per entity rendered) is possible
-> would also be interested in this feature

@hmmbob
Copy link

hmmbob commented Dec 15, 2024

Ah, I came here to search for this exact same solution. Would be great if this could be implemented!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants