Run a Hubitat Rule from Home(Kit)

The Situation I am well on my way to finishing my switchover from Alexa to HomeKit. Though a lot of trial, error, beard-tugging and thinking, I have things working fairly well except for one mystery not in the scope of this question. I find the programming in HomeKit incomprehensible; were it not for that, I have some rules I would set up.

So, what I tried doing was this: write my Rules in Hubitat's Rule Machine. I tested them, and they work fine. Let's work with two of these Rules as an example.

The Rule called Night-Time Shutdown that is triggered by one of two things: 1) time is 23:45. 2) a Virtual Switch is thrown and it does the same thing. I may want to sack out early, so, run the Rule early. This virtual switch is just used to launch the Rule, so it shuts off after one second.

Another Rule, called Night-Time Shutdown BR Lamps is designed to turn on my bedroom floor lamps. Let me offer come context. I decide to sack out early, so run the Shutdown rule, but also want the bedroom lamps to come on to guide me. This, too, is a virtual switch, with a 1-second "on" time.

In short, I am using these virtual switches like the buttons used to trip a contactor.

I brought my two Night-Time Shutdown virtual switches over into HomeKit. They show up just fine, and work fine if I tap either one in the HomeKit app on my my iPhone or iPad.

What I want to do I want to set up a way to combine the two rules into a Scene so what I say something like, "Hey Siri, night time shutdown" or something like that, Siri/HomeKit will toggle these two virtual switches; first the bedroom lights Rule, followed by the Shutdown rule.

The Problem If I go into "Add Scene", none of the virtual switches I have created show as available for scene-making. If I go into "Add Automation", they show up just fine, but, I see no way of using a voice command to run that automation.

A Further Problem There is a separate program called Shortcuts". I looked at it, and it may as well be something in 17th century German. I have no idea what it is or what it will do, yet, those who know what they are doing say, "Oh! Use a shortcut!" Grr..

Your thoughts? Thanks in advance.

The Friendly Grizzly

It is really simple to accomplish as an iOS Shortcut. I just created one that can be initiated via Siri (which is the default trigger based on the Shortcut name).

I added three actions

Turn off a switch
Wait 5s
Turn on a switch

1 Like

Check out this app - I use it to do things very similar to what you are trying to do. ‎Controller for HomeKit on the App Store

@fgrizzly iOS Shortcuts are definitely the way to go. I have shortcuts similar to @ogiewon's that trigger virtual switches to open and shut my garage door.

1 Like

I managed to find a way to run my Hubitat Rules! In HomeKit, I pick Scene, and select Custom. This will reveal my virtual switches that in turn run my Rules.

I found some of what look like decent Shortcut tutorials on YouTube, and will dive in and experiment.

2 Likes

To Ogoiewon: I will be experimenting with Shortcuts; probably will start tomorrow (Saturday).

What I want to do that I know will require a Shortcut: I have a day-starting Rule that fires up the lights in the house in a sequence that - like my night time shutdown - gives the place that lived in look.

Here is what I want to add: in my Alexa setup I had it configure to greet me with "Good morning", but I don't REQUIRE that. It went on to give me the date, the time, the local weather, and then read my calendar entries. Something like "Good morning! It's August 26th, 2022. The time is 5:47am. Expect cloudy skies with thunderstorms, ending tonight. There are three events in your calendar. At 8:00 am, barber appointment..." and so on.

If I can figure this out, I will be all set.

1 Like

In HomeKit, hold on your switch to modify its settings. Change to “Display as Light”, instead of “Switch”. Once you do that you will be able to add your Hubitat Virtual Switches to HomeKit Scenes.


1 Like

Wow. That straightens out a lot for future things I wish to try. Thanks very much!

1 Like