Tap or hold_action to display an input_number

I’ve got a temperature reading displayed on one of my picture-elements cards and I’d like to be able to tap or long press it and then have it’s associated input_number slider pop-up. I know I could navigate to a different view and have the input_slider there, but is there a way to have it pop-up on the existing view?

Any thoughts to get me moving in the right direction would be much appreciated.

Thanks

1 Like

The easiest way to achieve this with current configurations would be to do the following:

  1. Create an input_select. The options would be related to what you want to have appear on the screen for the UI.
  2. Create conditional cards that appear based on the input_select’s state.
  3. Change your tap-actions to call a service that selects the correct input_select option.

input_select

input_select:
  interface:
    name: What is displayed in the UI
    options:
      - None
      - ObjectA
      - ObjectB
    initial: None

conditional card

- type: conditional
  conditions:
    - entity: input_select.interface
      state: "ObjectA"
  card:
    type: entities
    entities:
      - light.object_a

tap-action on, hold-action off

tap_action:
  action: call-service
  service: input_select.select_option
  service_data:
    entity_id: input_select.interface
    option: "ObjectA"
hold_action:
  action: call-service
  service: input_select.select_option
  service_data:
    entity_id: input_select.interface
    option: "None"
1 Like

Thanks petro, I thought conditional cards might be the way forward. That’s a great idea to set the state of the card from the tap_action, really helpful!

Now I’ve got a starting point I’ll search to see if there’s a way to stack a conditional card on-top of a picture element card.

Thanks very much