Changed automations to pyscript

This commit is contained in:
Martin Bauer
2021-10-05 11:22:27 +00:00
parent a0e498edeb
commit ab2ab9f9d7
27 changed files with 496 additions and 2592 deletions

14
pyscript/herd.py Normal file
View File

@@ -0,0 +1,14 @@
@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()