Delay light switch turning off exhaust fan for a set time

I'm using a Shelly plus 1 relay for this automation.
The goal is for the exhaust fan to continue to run after the switch is flipped to the off position.
The fan would continue to run but a countdown would start the would ultimately turn off the fan.

I've tried a lot of different things inside rule machine, but trying to use the trigger event "fan turns off" results in the fan just turning off and the actions being skipped or just running while the fan is off.

Attempts to have an action that turns the fan back on, delays, then turns the fan off again end up with a loop of the fan turning off and on over and over again.

I feel like I'm close to a solution in a few different ways but I can't get the logic correct. Most rules I've seen are using a motion sensor to tie to for the delay logic and I haven't been able to extrapolate that over.

I guess the other question is, is there any reason to not do this?

Thanks for your help!

Welcome to the community!

It's always easier to understand your situation if you post some pics. :slight_smile:
You might need to go to Hub owners - Hubitat , join the group and then you'll be able to post lots of them. :grin:

Any automation is a good automation... :wink:

With your Shelly in Detached Mode you should be able to do a simple On equals On and Off equals Delay 30 minutes and then Off. :thinking:

Have you any logs from when it's doing something it's not supposed to?

2 Likes

Thanks for the response and the welcome.
In detached mode my switch no longer triggers the Shelly. I'm using regular old dumb toggle switches.

Let me cleanup my rule and grab some logs tonight and I'll post pictures tomorrow.

Thanks again.

The logic here I'm trying to accomplish is, if the switches previous state was on, and it changed to off, delay turning the swtich off for 5 seconds.

I tried to keep it generic for testing. Right now the rule is skipped when I flip the switch on the wall, or using the hubitat app.
Thanks!



I guess I'm not understanding what you're trying to accomplish.

From your op this is what I thought you had:

Wall switch connected to Shelly.
Fan connected to Shelly.
Shelly controlled by Hubitat.

Put Shelly in Detached mode, have HE rule:
Switch On = Fan On
Switch Off = Delay xx minutes Fan Off

But, you have two switches? Or another circuit? Or...? :thinking:

You're understanding correctly. I think the disconnect is my ignorance of the Shelly in detached mode. When I tested the Shelly in detached mode the switch did nothing.

What would I key the rule off of to make the switch work in detached mode?

Excuse my ignorance... :slight_smile: I don't use these devices myself... or even any relays behind wall-switches for that matter....

One thing that may be worth clarifying is.... by detached mode, does that mean the physical switch / relay does not control the electricity provided to the physical device, e.g. the exhaust fan in this case, but is expected to be sending a "soft" command to the hub it is wirelessly connected to in order to respond however it likes, e.g. based on an RM rule, etc?

Digging into this a bit more today.
Depending on the driver (Device type under device information) I use inside hubitat, some of my device configuration options change.

If I use Shelly WiFi Switch, I get a button type switch, which can be set to detached. See Below.

image
Until this point I was setting the switch relay type to detached mode inside the Shelly app.
I've found a few more post about detached mode, but nothing on making the physical switch work in detached mode.
Still working through this. I'll update if I find anything else.

Edit: For further clarification I do not get a child device on the shelly plus 1 devices like I see mentioned in some forum post.

Hmm. I unfortunately don't have any Plus devices to play with but if you post the entirety of your device page someone (@Evilborg ) might be able to see if there are any issues.

It's not exactly what you're attempting, but sort of related...
I have this bookmarked for Shelly 1 Garage Door Setup Instructions.

1 Like

This is not possible using a physical or dumb switch. The only way to do this is via a zigbee or zwave switch/button that isn't directly connected to the shelly device.

1 Like

Thank you for saving me wasting any more time on this. I was just going through the Shelly device handler post looking for clues.
Appreciate all the work on the Shelly drivers you've done in the past and the continued support.

1 Like

Appreciate the help and the Garage door setup instructions link.

I use a motion/humidity sensor in the bathroom to do this even though I have a switch I never really use it but there encase it's needed. Your welcome....

So while working on another automation last night I made some progress on this.
Putting the Shelly into detached mode, and using the driver bundle located here.
https://bitbucket.org/ge4d/hubitat-code/src/main/

Using this driver on the Shelly device breaks out two child devices input 1 and switch 1.
Screenshot from 2023-11-03 15-08-37

My basic proof of concept rule works.

This allows the use of the physical switch as the trigger to turn off the fan after a delay. It needs more logic built around it but as a basic POC it works.

If you have any questions or problems related to this driver, don't hesitate to ask) :upside_down_face:

1 Like