I’m cobbling a card to control an extractor fan.
I have 3 automations that I want to enable/disable in this card.
Each automation has their own control variables I want to be changeable in this card, too.
It’s easy to make one card with all that stuff, but it looks huge and puzzling, especially if all automations are off:
I wonder if there is a way to hide say, those input_numbers if a corresponding automation is disabled.
When everything is disabled, it should be like this:
So far I achieved the goal following this advice, but it’s very awkward as I had to create 9 conditional cards, and it’s difficult to maintain!
Is there a better way of doing what I’m after?
The code is as follow:
cards:
- card:
entities:
- entity: switch.bathroom_extractor_fan
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_threshold
name: auto ON by humidity value
- entity: input_number.climate_shower_threshold_humidity_value
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_gradient
name: auto ON by humidity gradient
- entity: input_number.climate_shower_humidity_gradient_threshold
- entity: >-
automation.climate_turn_bathroom_extractor_fan_off_based_on_target_humidity
name: auto OFF by humidity value
- entity: input_number.climate_shower_target_humidity_value
- entity: input_number.climate_shower_target_humidity_value_correction
- entity: >-
automation.climate_turn_bathroom_extractor_fan_back_on_if_turned_off_before_target_humidity_reached
name: prevent manual off if target not met
show_header_toggle: false
title: Ventilation
type: entities
conditions:
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_threshold
state: 'on'
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_gradient
state: 'on'
- entity: >-
automation.climate_turn_bathroom_extractor_fan_off_based_on_target_humidity
state: 'on'
type: conditional
- card:
entities:
- entity: switch.bathroom_extractor_fan
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_threshold
name: auto ON by humidity value
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_gradient
name: auto ON by humidity gradient
- entity: input_number.climate_shower_humidity_gradient_threshold
- entity: >-
automation.climate_turn_bathroom_extractor_fan_off_based_on_target_humidity
name: auto OFF by humidity value
- entity: input_number.climate_shower_target_humidity_value
- entity: input_number.climate_shower_target_humidity_value_correction
- entity: >-
automation.climate_turn_bathroom_extractor_fan_back_on_if_turned_off_before_target_humidity_reached
name: prevent manual off if target not met
show_header_toggle: false
title: Ventilation
type: entities
conditions:
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_threshold
state: 'off'
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_gradient
state: 'on'
- entity: >-
automation.climate_turn_bathroom_extractor_fan_off_based_on_target_humidity
state: 'on'
type: conditional
- card:
entities:
- entity: switch.bathroom_extractor_fan
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_threshold
name: auto ON by humidity value
- entity: input_number.climate_shower_threshold_humidity_value
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_gradient
name: auto ON by humidity gradient
- entity: input_number.climate_shower_humidity_gradient_threshold
- entity: >-
automation.climate_turn_bathroom_extractor_fan_off_based_on_target_humidity
name: auto OFF by humidity value
show_header_toggle: false
title: Ventilation
type: entities
conditions:
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_threshold
state: 'on'
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_gradient
state: 'on'
- entity: >-
automation.climate_turn_bathroom_extractor_fan_off_based_on_target_humidity
state: 'off'
type: conditional
- card:
entities:
- entity: switch.bathroom_extractor_fan
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_threshold
name: auto ON by humidity value
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_gradient
name: auto ON by humidity gradient
- entity: input_number.climate_shower_humidity_gradient_threshold
- entity: >-
automation.climate_turn_bathroom_extractor_fan_off_based_on_target_humidity
name: auto OFF by humidity value
show_header_toggle: false
title: Ventilation
type: entities
conditions:
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_threshold
state: 'off'
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_gradient
state: 'on'
- entity: >-
automation.climate_turn_bathroom_extractor_fan_off_based_on_target_humidity
state: 'off'
type: conditional
- card:
entities:
- entity: switch.bathroom_extractor_fan
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_threshold
name: auto ON by humidity value
- entity: input_number.climate_shower_threshold_humidity_value
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_gradient
name: auto ON by humidity gradient
- entity: >-
automation.climate_turn_bathroom_extractor_fan_off_based_on_target_humidity
name: auto OFF by humidity value
- entity: input_number.climate_shower_default_target_humidity_value
name: if less than
- entity: >-
automation.climate_turn_bathroom_extractor_fan_back_on_if_turned_off_before_target_humidity_reached
name: prevent manual off it target not met
show_header_toggle: false
title: Ventilation
type: entities
conditions:
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_threshold
state: 'on'
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_gradient
state: 'off'
- entity: >-
automation.climate_turn_bathroom_extractor_fan_off_based_on_target_humidity
state: 'on'
type: conditional
- card:
entities:
- entity: switch.bathroom_extractor_fan
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_threshold
name: auto ON by humidity value
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_gradient
name: auto ON by humidity gradient
- entity: >-
automation.climate_turn_bathroom_extractor_fan_off_based_on_target_humidity
name: auto OFF by humidity value
- entity: input_number.climate_shower_default_target_humidity_value
name: if less than
- entity: >-
automation.climate_turn_bathroom_extractor_fan_back_on_if_turned_off_before_target_humidity_reached
name: prevent manual off it target not met
show_header_toggle: false
title: Ventilation
type: entities
conditions:
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_threshold
state: 'off'
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_gradient
state: 'off'
- entity: >-
automation.climate_turn_bathroom_extractor_fan_off_based_on_target_humidity
state: 'on'
type: conditional
- card:
entities:
- entity: switch.bathroom_extractor_fan
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_threshold
name: auto ON by humidity value
- entity: input_number.climate_shower_threshold_humidity_value
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_gradient
name: auto ON by humidity gradient
- entity: >-
automation.climate_turn_bathroom_extractor_fan_off_based_on_target_humidity
name: auto OFF by humidity value
show_header_toggle: false
title: Ventilation
type: entities
conditions:
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_threshold
state: 'on'
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_gradient
state: 'off'
- entity: >-
automation.climate_turn_bathroom_extractor_fan_off_based_on_target_humidity
state: 'off'
type: conditional
- card:
entities:
- entity: switch.bathroom_extractor_fan
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_threshold
name: auto ON by humidity value
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_gradient
name: auto ON by humidity gradient
- entity: >-
automation.climate_turn_bathroom_extractor_fan_off_based_on_target_humidity
name: auto OFF by humidity value
show_header_toggle: false
title: Ventilation
type: entities
conditions:
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_threshold
state: 'off'
- entity: >-
automation.climate_turn_bathroom_extractor_fan_on_based_on_humdity_gradient
state: 'off'
- entity: >-
automation.climate_turn_bathroom_extractor_fan_off_based_on_target_humidity
state: 'off'
type: conditional
type: vertical-stack