Button to operate a relay

I want a button that will operate a child relay for a specific time. I want to interrupt power to a device to make it reboot. So the relay could operate for 5 seconds or so. Is there an example of doing this somewhere?

Something like this?

[Note] You should always power down electronic devices for at least 30 seconds. There are exceptions, where some devices only need 10 seconds, but in general 30 seconds is enough time for the capacitors in the circuit to discharge. Certain devices need longer times, up to 2 minutes.

I do not recommend you do this to the Hubitat hub. I'm assuming that's not what you're thinking since you're wanting to run this automation from the hub. But just as a point of advice to you don't brick your hub, always do a soft reboot.

Yeah that looks like it would do the trick. I have a 12 camera in the yard that sometimes needs needs a reboot. I thought doing it this way would be the way to go. Thanks for the example. I think I need to retire so I can spend more time learning what this Hub can do LOL

1 Like

You can get creative and also do this remotely via Hubitat dashboard. Use a virtual button as well as a physical button in the trigger. If you define two triggers, they will both do the same thing. Then add the virtual button to a Hubitat Dashbord and you'll be able to reset it from anywhere.

You could also use IFTTT, and have something like IFTTT button press to trigger a virtual switch. In the virtual switch driver, you set it to turn off after 1 second, so it acts like a momentary switch. This is needed because IFTTT doesn't support buttons.

Another way you could do it is when a text message is received in IFTTT, that would trigger a virtual switch (again set as momentary in the virtual switch device details) and that would activate the rule machine trigger. I like this idea less though to be honest. It's not as secure.

So many ways.....

Is that a virtual button in your original example for the trigger?

1 Like

Yes.

Here's how to turn a Virtual switch into a momentary virtual switch. It's helpful everywhere, but especially so when you want to use it with IFTTT, Alex routines, or Google Assistant Routines, where you just want a switch to trigger a rule, you don't want the switch to stay on. Since buttons are not supported in IFTTT, Alexa or Google, that's what you have to do instead.

1 Like

I just learned something new today (again)!
What a community!

1 Like

Great! Thanks!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.