Fan box delayed switch off

Good afternoon All,

(Apologies in advance for my English, which is not very good).

I am new with Node-Red and by following several tutorials I am trying to gain some knowledge of how Node-Red works.

However, I am now stuck with what I think is a very simple issue.

Who can help me on my way?

First the situation sketch:
In the toilet I have a ventilation box that is on 24 hours a day.

  • I would like to turn it off between 23:00 and 07:00.
  • And furthermore only on if the toilet switch is on for longer than 1 minute.
  • Does the switch turn off after 1 minute? Then turn it off after 10 minutes.

I tried to make one and other in Node-Red but it does not function how I thought it would.
If the switch is on for more than 1 minute it works.
But if the switch is on again immediately after 1 minute then the fan box turns off before that.
What am I doing wrong?

With ESPHome, I use the following configuration:

esphome:
  name: ventilatiebox
  friendly_name: Ventilatiebox

switch:
  - platform: gpio
    name: "Ventilatiebox_light"
    pin: D4
    inverted: yes

binary_sensor:
  - platform: gpio
    pin:
      number: D3
      inverted: yes
      mode:
        input: true
        pullup: true
    name: "Toilet_Schakelaar"

And my Node-Red

Thank you in advance.
Andries.

Is there no one who recognizes this problem?

In short: If a switch is on for more than 1 minute, how can I run a fan for 10 minutes?(after switching off the switch)

Thank you in advance.
Andries.

Not a HA user as with most people on this forum.

Here is a simple example of waiting 1min before sending on, and then waiting 10 mins before sending off. You will need to work out how to integrate with HA nodes.

[{"id":"6f8e56acbc13b7d0","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":110,"y":3100,"wires":[["d5d799af1498169b"]]},{"id":"6fc09fc714e6810d","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":110,"y":3180,"wires":[["d5d799af1498169b"]]},{"id":"db4d2eb55ff4b2bd","type":"debug","z":"d1395164b4eec73e","name":"debug 2463","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":650,"y":3140,"wires":[]},{"id":"d5d799af1498169b","type":"trigger","z":"d1395164b4eec73e","name":"","op1":"","op2":"1","op1type":"nul","op2type":"num","duration":"1","extend":false,"overrideDelay":false,"units":"min","reset":"0","bytopic":"all","topic":"topic","outputs":1,"x":350,"y":3140,"wires":[["f354408d829c881e"]]},{"id":"f354408d829c881e","type":"trigger","z":"d1395164b4eec73e","name":"","op1":"on","op2":"off","op1type":"str","op2type":"str","duration":"10","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":470,"y":3080,"wires":[["db4d2eb55ff4b2bd"]]}]