@state_trigger("switch.esszimmer_szene_4") def esszimmer_gangtuer_herd(value=None): entity_id = [f"switch.herd_phase_{i}" for i in range(1, 4)] if value == "on": switch.turn_on(entity_id=entity_id) elif value == "off": switch.turn_off(entity_id=entity_id) @state_trigger("float(sensor.herd_phase_1_verbrauch) + float(sensor.herd_phase_2_verbrauch) + float(sensor.herd_phase_3_verbrauch) < 100", state_hold=30 * 60) def herd_auto_aus(): switch.esszimmer_szene_4.turn_off()