I am trying to get an automation for our bathroom working. The scene ist the following:
I measure the humidity in the bathroom. When somebody turns on the light, the fan turns on.
The fan should turn off after 5 minutes when the light is turned off, but only when the humidity is under 65%. The automation should wait more than the 5 minutes if the humidity is still over 65%.
Ive tried some things in the automation GUI, but I wasn’t successful yet.
Here’s how my automation in yaml looks like right now., maybe someone can help me. I’m new to HA and don’t know the Syntax so good yet, sorry.
Channel 1 is the light, channel 2 is the Fan.
alias: Badezimmer Lüfter ausschalten description: '' trigger: - platform: device type: turned_off device_id: 2c629dead3dc5f73597d92a6fbe700cc entity_id: switch.lampe_und_lufter_badezimmer_channel_1 domain: switch for: hours: 0 minutes: 5 seconds: 0 milliseconds: 0 condition:  action: - type: turn_off device_id: 2c629dead3dc5f73597d92a6fbe700cc entity_id: switch.lampe_und_lufter_badezimmer_channel_2 domain: switch mode: restart