Use IFTTT to have ring doorbell motion turn on a smart switch between certain hours with a timer


#1

I cannot seem to figure this out.

Here is what I am talking about incase confused. I already have IFTTT connected and I have the IF ring doorbell detects motion then turn on smart lights switch and I have a filter code writen saying to only turn it on between 8pm and 6am otherwise dont turn on. Now I want the hub to add a timer for the lights to be on for 1 or 2 minutes and then turn the switch off. How would I go about doing this?


#2

First of all, where do you have this "filter code" that is preventing it from happening during certain hours of the day?

I would not have IFTTT trigger the smartlights directly. Instead I would use the IFTTT maker webhooks service to trigger a cloud endpoint from RM. That way, you could be in control of when it happens and what actions are taken and when. That would also allow you the ability to turn the light off after a minute.


#3

I have the Ring Pro doorbell and do something similar to this but I have it turn my front porch on at night when it's dark. I am not using IFTTT however. Here's how I set mine up. You will need to create a virtual switch.

My Rule...

Add the virtual switch to the Amazon Echo Skill App.

Then in the Alexa App on your phone, under routines, add a new routine.

Here is my routine in the Alexa App.


#4

Instead of using Alexa, he's using IFTTT. 6 of one, half dozen of the other.


#5

Just giving options :slight_smile:


#6

Is this part already working? If so, leave it all alone. Now, create a new rule. As the condition choose the switch of the light that turned on. Under actions for true, add an action to delay for 2 minutes and toggle the switch that it will cancel on truth change. Then add an action to turn the light off under switch controls.

If this doesn't make sense, let me know and I (or somebody else) will explain it in more detail.


#7

thanks for the response and I may give your way a try.

I am new to this and not certain how to create a virtual switch. I have searched through hubitat and cannot seem to find where to create it. Do I have to install an app to be able to make one kind of like rule machine?


#8

I am using ifttt because my front door light is controlled by a smart light switch which isnt supported by hubitat yet. Thats why I was trying to get hubitat to view this when the even happens and then tell it to some how shut off after so many minutes


#9

Click on Devices in the main menu. At the top of the device list you will see a button for add virtual device.


#10

Steps to add a virtual switch:

  • On the left nav (it will be under the hamburger [three-bar-menu] on mobile) click on devices e.g. http://[your-hub-ip]/device/list
  • At the very top of the list there is a button "Add Virtual Device". Click.
  • For the values you can chose whatever you want as long as for type you choose "Virtual Switch". Click "Save Device"

A short explanation of what each value is:

  • "Device Name" - This field is meant to hold the device's name.
  • "Device Label" - This field is meant to hold the device's label. The way I differentiate this from "Device Name" is that if I was setting up a Hue Bulb for example device name would contain "Hue Bulb" but "Device Label" would contain a name that makes sense for where it is such as "Master Bedroom Lamp". "Device Label" is what you see everywhere in HE for configuration and in integrations.
  • "Zigbee Id" - If it is a zigbee device it would have the unique identifier for the device. With a virtual switch leave it blank.
  • "Device Network Id" - The unique identifier to identify this device in hubitat. Z-Wave devices put their node id here. LAN devices often have their IP (in hex) or their MAC address here (all caps no separators). For LAN devices that is how HE identifies which device to send responses/requests to. For virtual devices it doesn't matter what you put. I typically put "VS000" where "VS" stands for what it is e.g. virtual switch and the rest is an incrementing number.
  • "Type" is the type of device it uses i.e. which driver it uses.

This is probably all documented somewhere if somebody wants to find it and provide an official link.

Virtual switches by themselves do nothing. You can turn them on and off and nothing happens. They are either controlled externally by IFTTT for example or you control them with RM or do actions with RM when they are controlled. Once you set one up it should start to make sense.


#11

will try this way if I cannot get other to work

How can I select my smart switch when it is a smart life switch and hubitat doesnt support it? I can add it in google home and alexa and ifttt but not hubitat so how would I go about having hubitat control the switch when it isnt listed at all?


#12

I was able to add and create the switch in alexa app and also on hubitat. I can do most of the stuff in your pictures except select the switch that turns the outside lights on and off. I can see it in alexa app and google home app and ifttt but not hubitat. They are smart life switches so how do I go about being able to have hubitat control them and then add them to the conditions?

Is this possible to do or should I buy a new smart switch that works with hubitat?


#13

Here’s a good article I found on the SmartThings forum that would benefit you to read. Just substitute SmartThings for Hubitat. The virtual switch is going to be the switch for those devices.


#14

At this point you would select the virtual switch in HE. Then on the IFTTT side you would need a rule to control your Smart Life switch.

You will always be using IFTTT to sync the HE virtual switch to the Smart Life switch if that makes sense.

I don't know much about Smart Life (or Magic Home) devices but if they are compatible with the Magic Home app they could have an integration already. @adamkempenich, are the Smart Life devices the same as the Magic Home devices? When I google it I see them mentioned together all the time.


#15

SmartLife switches use a different protocol, unfortunately.

But... I’ve been working with a friend, and we’ve gotten a lot of work done for local-control and reverse engineering them. I pushed that project aside, but I’m pretty sure I can get it working locally. I know for a fact it can be done, because I have several smart outlets under control by HE currently :slight_smile:

Someone else has a public Tuya/SmartLife cloud driver in the meantime, though. See CWWilson’s thread for more on that:


#16

thanks adam and I looked through it and read it but wasnt really sure which part to use for the driver lol but will continue to research it


#17

thanks for the reply codahq, on the ifttt side the one i made says if ring motion is detected then turn on smart life switch between hours of 8pm and 6am. The only issue is how do I make it go back to hubitat and do the timer and then have it shut the switch off after the time is expired? I can also have alexa turn the smart life switch on as well but not sure how to get hubitat to have a timer shut the switch off since it doesnt see the switch


#18

The simplest way from where you are is to have a virtual switch in Hubitat shared to IFTTT. Change your IFTTT recipe to turn on the Smart Life switch AND the Hubitat switch. Can IFTTT recipes have two actions yet? If they can't you need to make another action.

Then in HE you can have a Rule Machine rule that says... when that virtual switch is turned on (the one that the IFTTT will also turn on when it turns on your Smart Life switch because that switch status will sync back to Hubitat) do a thing. Your thing can be ignore based on the time of day, turn on other switches, or wait a period of time and then turn off, etc.

If you turn that switch off it will sync back to IFTTT. Then you have another IFTTT recipe that says if that HE virtual switch turns off then turn off the Smart Life switch.

In this scenario the virtual switch in Hubitat is then just a representation of the Smart Life switch.


#19

thanks inetjnky, I think I created the 4 rules correctly in ifttt and now when writing to commands in hubitat I can start it by saying if ring motion is detected for the actions I cannot find an option to goto ifttt and run my thing I made?


#20

I made the virtual switch like he did in the above pictures and I have ifttt in devices and have the virtual switch clicked on it.

Now when I write the if and thats I cannot find anywhere in there for the action part in rule machine where I can have it goto ifttt to turn them on. How do I do this step when I cannot find it for the action part?