Last active
July 14, 2022 19:32
Star
You must be signed in to star a gist
home assistant blueprint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Abluftsteuerung | |
description: 'Der Lüfter wird/bleibt ausgeschaltet solange das Licht im Bad an ist. Wenn das Licht | |
ausgeschaltet wird oder die Luftfeuchte über dem definierten Schwellwert steigt, wird der Lüfter | |
eingeschaltet. Falls die Luftfeuchte dann unter dem definierten Wert liegt, wird der Lüfter nach 5 min | |
ausgeschaltet. Andernfalls erfolgt die Abschaltung nach Unterschreitung des Schwellwertes, spätestens | |
nach Ablauf des definierten Timeouts.' | |
domain: automation | |
input: | |
fan: | |
name: Lüfter | |
description: 'Lüfter, der gesteuert werden soll' | |
selector: | |
entity: | |
domain: switch | |
light-switch: | |
name: Lichtschalter | |
description: 'Lichtschalter, der die Lüftersteuerung beeinflussen soll' | |
selector: | |
entity: | |
domain: switch | |
humidity_sensor: | |
name: Luftfeuchtesensor | |
description: 'Sensor für den Schwellwert der Luftfeuchte' | |
selector: | |
entity: | |
domain: sensor | |
humidity_threshold: | |
name: Schwellwert Luftfeuchtigkeit | |
description: 'falls die Feuchtigkeit über dem Grenzwert liegt, läuft der Lüfter länger als 5 Minuten' | |
default: 60 | |
selector: | |
number: | |
min: 30 | |
max: 95 | |
step: 5 | |
unit_of_measurement: '%' | |
mode: slider | |
timeout: | |
name: Timeout | |
description: 'Timeout, nachdem der Lüfter spätestens ausschaltet' | |
default: 30 | |
selector: | |
number: | |
min: 10 | |
max: 60 | |
step: 5 | |
unit_of_measurement: 'Minuten' | |
mode: slider | |
trigger: | |
- platform: state | |
entity_id: !input 'light-switch' | |
- platform: numeric_state | |
entity_id: !input 'humidity_sensor' | |
above: !input 'humidity_threshold' | |
for: | |
hours: 0 | |
minutes: 1 | |
seconds: 0 | |
condition: [] | |
action: | |
- choose: | |
- conditions: | |
- condition: state | |
entity_id: !input 'light-switch' | |
state: 'on' | |
- condition: state | |
entity_id: !input 'fan' | |
state: 'on' | |
sequence: | |
- service: switch.turn_off | |
data: {} | |
target: | |
entity_id: !input 'fan' | |
- conditions: | |
- condition: state | |
entity_id: !input 'light-switch' | |
state: 'off' | |
- condition: numeric_state | |
entity_id: !input 'humidity_sensor' | |
above: !input 'humidity_threshold' | |
sequence: | |
- service: switch.turn_on | |
data: {} | |
target: | |
entity_id: !input 'fan' | |
- wait_for_trigger: | |
- platform: numeric_state | |
entity_id: !input 'humidity_sensor' | |
below: !input 'humidity_threshold' | |
for: | |
hours: 0 | |
minutes: 5 | |
seconds: 0 | |
continue_on_timeout: true | |
timeout: | |
minutes: !input 'timeout' | |
- service: switch.turn_off | |
data: {} | |
target: | |
entity_id: !input 'fan' | |
- conditions: | |
- condition: state | |
entity_id: !input 'light-switch' | |
state: 'off' | |
sequence: | |
- service: switch.turn_on | |
data: {} | |
target: | |
entity_id: !input 'fan' | |
- delay: | |
hours: 0 | |
minutes: 5 | |
seconds: 0 | |
milliseconds: 0 | |
- if: | |
- condition: numeric_state | |
entity_id: !input 'humidity_sensor' | |
below: !input 'humidity_threshold' | |
then: | |
- service: switch.turn_off | |
data: {} | |
target: | |
entity_id: !input 'fan' | |
else: | |
- wait_for_trigger: | |
- platform: numeric_state | |
entity_id: !input 'humidity_sensor' | |
for: | |
hours: 0 | |
minutes: 5 | |
seconds: 0 | |
below: !input 'humidity_threshold' | |
timeout: | |
minutes: !input 'timeout' | |
- service: switch.turn_off | |
data: {} | |
target: | |
entity_id: !input 'fan' | |
default: [] | |
mode: restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment