can I trigger a shortcut with a homekit light switch?

I'd like my shortcut to trigger and run when a lightswitch in homekit is toggled on. The switch state change would trigger the shortcut.

iPad 2, iOS 9

Posted on Jan 6, 2023 4:59 PM

Reply

Similar questions

18 replies

Feb 10, 2023 1:32 PM in response to Michael Paine

I thought that a Personal Automation shortcut can be triggered by a Homekit event:

Create a new personal automation in Shortcuts on iPhone or iPad – Apple Support (AU)

but it turns out this is not the case 🙁


Only the Create Home Automation option gives access to Homekit events. This seems to be no different to creating the automation within the Home app so is of no use.

Feb 11, 2023 1:57 PM in response to kylieo

NFC tags are a way to trigger a shortcut by waving an iPhone near the tag. You can buy a packet of tags for a few dollars it stick them around the house. The activated Shortcut can trigger Homekit actions. My example (link above) was to toggle a power outlet - if on turn it off otherwise turn it on.

As I lamented above, these are personal shortcuts that need an iPhone to work. They cannot be triggered by a Homekit change of state.

Feb 9, 2023 2:04 PM in response to Michael Paine

Here is an explanation that I posted on a Tidbits.com discussion:

I think I have found a way using Shortcuts. I finally found how to control Homekit accessories with IF /OTHERWISE statements in Shortcuts. The trick is to add an action using the search field:




Choose Apps, scroll to the Home app and select the Accessory to be controlled.


This places the action (eg Set C7 Volvo [on] ) at the foot of the action list (below the END IF statement). You now need to drag it to the correct location in the list.

In my example I check if the C7 outlet (my EV charger) is on. If it is on then turn it off. Otherwise turn it on.



Cumbersome but it works. Holding my phone near the NFC tag toggles the outlet state.

Back to the timer issue… one of the Shortcut actions is “wait”. I should be able add this to the action list so that the outlet is turned on, wait for a specified time then turn it off.

Jan 7, 2023 9:15 AM in response to Michael Paine

my question may not have been clear - I don't need a shortcut to trigger an action in the Home app - I'm interested in doing the reverse so an action in the Home app to trigger a shortcut. I can't figure this out and wondering if it is even possible.

for example when I turn on a light switch not only would the light go on but a shortcut is also triggered and runs.

Feb 9, 2023 5:08 AM in response to Michael Paine

I have the same

exact question, and from referring at least a dozen online sources and two AI powered large language models 😃, I have not found a definitive answer to the simple question “Can I trigger personal Shortcuts with a physical switch, like a Hue switch, connected to Homekit - yes or no?”


Is this a type of question that official Apple support responds to, even though it has nothing to do with devices and/or warranty?

Feb 10, 2023 10:58 AM in response to Michael Paine

Thanks Michael. Do I understand right that the iffing needs to be written into the Shortcut itself?


For example, if I had a simple Shortcut to say “hello world” which I’d like to be triggered by a Homekit device state, the iffing about a Homekit device state would need to be added to that Shortcut, at the top?


Doesn’t that require the Shortcut app to be constantly aware and sensing the state of all Homekit devices?



Feb 11, 2023 3:35 AM in response to kylieo

So the outcome really appears to be, that HomeKit events can only trigger other HomeKit events. No other events or actions are available in the menus apart from scripting, even if you convert it to a shortcut.


Since HomeKit really appears to be this limited, I wonder if there are any other third-party options like IFTT to initiate personal shortcuts from a compatible physical device.


What comes to NFC, I cannot even grasp the concept, how that would work here in practice.

Feb 12, 2023 3:29 PM in response to Michael Paine

We could demonstrate the limitations of Homekit by this mock-up:


  1. build a spring-loaded mechanical arm powered by a Homekit power outlet
  2. stick an NFC tag to the end of the arm
  3. Place an iPhone at the end of the arm's travel so that it can be triggered by the NFC tag when the arm swings down
  4. create a shortcut that is activated by the NFC tag (shortcut could send an SMS message etc)
  5. create an automation in Home.app that activates the power outlet when another accessory changes state (light comes on/off, motion detected etc)
  6. test the system!


🤨

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

can I trigger a shortcut with a homekit light switch?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.