Help creating a scene

Hello,
I have a dehumidifier plugged into a controlled outlet.
I created a scene that, every 2 hours, sets the outlet to On, waits 1 hour and sets the outlet to Off.
This is so the device runs 1 hour out of every 2.

I have a window sensor.
I want, when the window is opened, for the outlet to switch to Off and for it to switch to On as soon as the window is closed again, or restore the previous state, whichever.
I wanted to stop or pause the scene that controls the outlet but this feature doesn’t exist.

Do you have any idea about the feasibility of what I want, or should I submit a feature request?

In addition to the already created On/Off scene

I created a scene that
If the window opens
turn off the outlet

And another
If the window closes
start the On/Off scene

However I think the On/Off scene keeps running and will restart the dehumidifier on its next cycle, which I do not want.

Right now, I don’t know what to do.

Hi @gaetanb76

I’m looking into putting everything into a single scene but I have an issue with reusing the previous state of your plug.

So I suggest a solution based on what you’ve already done.
I shouldn’t have made any mistakes.

Scene On/Off







Window state scene





Heads-up about the scenes — if it seems complicated, that’s my brain wanting it that way :rofl:
Be careful about the level where you put your actions, especially for the Sinon of the Scene On/Off.
Another point: you’ll need to check whether 0 and 1 represent the window open state (0 = open or closed?) and adjust accordingly (I assumed 0 = closed in my scenario).
There’s a way to put everything into a single scene but be careful — it can be brain-twisting!

And here’s a video of what that should look like (virtual devices in my example):

And the nice thing is if you don’t have access to Gladys to start your dehumidifier, you open and close your window and it’s running :wink:

EDIT: after retesting, if the window is open AND you force the plug ON, the plug stays ON (until the next hour). That’s a point to fix unless you’ll never perform that action manually.

3 Likes

Hello @

It’s an example I took with a virtual device and you need to check yours to know which value to retrieve when it’s closed.
In my case, my open/close sensors use contact detection so if there is contact (true, =1) then they are closed, and if there is no contact (false, =0) then it’s open.

And indeed, every hour we retrieve the state of the plug and we « invert » its state.
And if the window is open then we force the plug to switch off.

1 Like