klogg
(Klogg)
March 28, 2018, 1:01pm
1
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
klogg
(Klogg)
March 29, 2018, 9:26am
3
Thanks on both counts.
I’ve edited my original post and will go and play with your examples.
klogg
(Klogg)
March 30, 2018, 1:05pm
4
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.
zzuyee
(zzuyee)
December 24, 2022, 2:23am
6
chairstacker:
group.set_visibility
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
klogg
(Klogg)
December 25, 2022, 8:52am
7
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