Hi,
i did a some testing and found quite promissing code, but still can’t fully cover what i would like to build.
My wish would be to “enable” / “disable” the switches “Trockner” & “Waschmaschine” depending by the state of Switch “Beide Schalter aktivieren”.
So if it is turn on i should be able to also toggle the switches Trockner and Waschmaschine. If it is turned off, the stae of Trocknet and Waschmaschine should not changed, but the switch should be not able to flip.
Can someone help me here please?
Many Thanks
Andi
My Sample codes shown in the Screenshot:
1.
square: false
columns: 1
type: grid
cards:
- type: horizontal-stack
cards:
- type: custom:mushroom-entity-card
entity: switch.bad_steckdose_trockner
name: Trockner
icon_color: light-blue
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none- type: custom:mushroom-entity-card
entity: switch.bad_steckdose_waschmaschine
name: Waschmaschine
icon_color: light-blue
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
type: entities
title: Schalter abschaltbar
show_header_toggle: false
entities:
- entity: input_boolean.bad_steckdosen_trockner_waschmaschine_aktivieren
name: Beide Schalter aktivieren- entity: switch.bad_steckdose_trockner
name: Trockner
card_mod:
style:
hui-generic-entity-row:
ha-entity-toggle:
$:
ha-switch:
$: |
.mdc-switch .mdc-switch__thumb input {
pointer-events: none;
}
.: |
ha-switch {
–switch-unchecked-button-color: var(–disabled-text-color);
–switch-checked-button-color: var(–disabled-text-color);
}- entity: switch.bad_steckdose_waschmaschine
name: Waschmaschine
card_mod:
style:
hui-generic-entity-row:
ha-entity-toggle:
$:
ha-switch:
$: |
.mdc-switch .mdc-switch__thumb input {
pointer-events: none;
}
.: |
ha-switch {
–switch-unchecked-button-color: var(–disabled-text-color);
–switch-checked-button-color: var(–disabled-text-color);
}
type: entities
entities:
- entity: switch.bad_steckdose_trockner
name: Trockner
secondary_info: none- entity: switch.bad_steckdose_waschmaschine
name: Waschmaschine
show_header_toggle: false
state_color: false
title: Schalter immer an