Can you hide an input?

Is it possible to hide one input based on the condition of another? For example I have a group:

irrigation_programme:
  name: Irrigation programme
  entities:
  - switch.irrigation_valve
  - input_boolean.irrigation
  - input_datetime.garden_watering_start_time
  - input_boolean.zone1
  - input_number.garden_zone1_duration
  - input_boolean.zone2
  - input_number.garden_zone2_duration

Can I hide “input_number.garden_zone1_duration” if “input_boolean.zone1” is set to ‘Off’

(Sorry my code formatting doesn’t show correctly, it is the first time I have embedded code and I don’t know how to do it)

To embed code mark either it with three left ticks ``` in front and after or mark the text and use the ‘</>’ from the formatting options above.

You can not hide individual items from the UI directly, but you can manage the visibility of groups that might contain only one item:

- alias: Media Player ccoffice visible true
  trigger:
    platform: template
    value_template: "{{ not is_state('media_player.ccoffice', 'off') }}"
  action:
    service: group.set_visibility
    entity_id: group.media_players_ccoffice
    data:
      visible: True
######################################################################
- alias: Media Player ccoffice visible false
  trigger:
    - platform: homeassistant
      event: start
    - platform: state
      entity_id: media_player.ccoffice
      to: 'off'
  action:
    service: group.set_visibility
    entity_id: group.media_players_ccoffice
    data:
      visible: False

Thanks on both counts.
I’ve edited my original post and will go and play with your examples.

If I have a group which contains just one item which is a group, is there a way to alter the visibility of that (parent) group? I have not found a way.

For example I am using the example code given above by @chairstacker to use an input_boolean to decides the visibility or not of the group ‘zone3’:

group:
  zone3:
    name: Zone 3
    entities:
    - group.settings_zone3

group:
  settings_zone_3:
    view: no
    control: hidden
    name: "Settings for zone 3"
    icon: mdi:settings
    entities:
    - input_boolean.water_zone3
    - input_number.garden_zone3_duration

It shouldn’t make a difference if it’s a group with individual items in it or a group containing a group.

I’m getting " The automation “unhide slider” (automation.unhide_slider ) has an action that calls an unknown service: group.set_visibility ."

- alias: unhide slider
  trigger:
    platform: template
    value_template: "{{ not is_state('switch.50207_3_socket_1', 'off') }}"
  action:
    service: group.set_visibility
    entity_id: group.rodi_timer
    data:
      visible: False

This thread is five years old.
A lot has changed since then.

Not least the entire UI.
This question relates to the old UI which is so old I can’t even remember how it works!

But, whatever it is you are trying to do, I would start looking somewhere else. Maybe start a new thread I’m sure you’ll get an answer.

1 Like

When I go to ‘my_url’:8123/developer-tools/service I can’t see the service group.set_visibility any more, so I agree with @klogg that this would be seriously outdated.
Maybe you can use a conditional card for that.

1 Like