HomeKit Automation Tips

Getting more out of your smart home devices

Workaround for the HomeKit shortcut bug in iOS 15 / tvOs 15

UPDATE: It appears that the bug has been fixed with iOS 15.1 / tvOS 15.1 / HomePod Software Version 15.1.

There is a workaround for the HomeKit shortcut bug in iOS 15 / tvOS 15. The problem occurs in shortcuts using for instance brightness percentages values (of lights) or brightness lux values (from sensors) in conditionals (if statements).

The workaround is getting the value using Get the state of Home, and then turning that value into a normal number using Get Numbers from Input. The resulting number can then be accessed either as a Magic Variable in the if statement, or you can make a variable from the number which can then be accessed in the if statement.

This is annoying, and time consuming for anyone with a lot of HomeKit automations using shortcuts, but at least it’s a way around the bug. Let’s hope Apple fixes the bug as soon as possible.

II’ve written a more comprehensive post where I share three examples of the workaround.

38 thoughts on “Workaround for the HomeKit shortcut bug in iOS 15 / tvOs 15”

  1. Hi Stefan,

    Thanks for the tip, however there’s also the Contact Sensor State for Window/Door sensors that is not working anymore after the tvOS 15 update.
    For that one I tried the Get the state of Home then Get text from Input, and finally the text in a conditional (should be Open/Closed), but it’s not working 🙁 Of course working fine when running the shortcut manually. Any idea for this one?

    Really annoying indeed.

    Thanks!

    1. Hi Alexis,
      Sad to hear about your problems. Which Window/Door sensor do you have? I just ordered a Eve Door & Window sensor, so that I can do some experiments with it. I’ll let you know when I get it and had some time to test.

        1. Hi again Alexis,
          I got the Eve Door & Window sensor today and started testing. I added a test shortcut to a Hue Dimmer Switch button. I hused the same Get state of Home, Get text from Input and then tried adding the text through a Magic Variable to the if statement. If I use is or contains as the conditional and then Open, it works for me. Could you test it?

          Eve Door & Window workaround

          1. Hi Stefan,
            Unfortunately that’s exactly what I tried and it’s not working 🙁
            The sensor reports correctly « Open » from the Home app, but still not working in the shortcut when triggered by the automation and not manually.

            1. That’s really weird. Did you test with “contains” as well? And you wrote it with a capital O, exactly as the sensor does?

                1. That is really annoying. I wish I had a Aqara sensor and hub so that I could do some different tests.

  2. Same here, but with buttons. I have several Hue light buttons around the house, some original Hue and some Friends of Hue. After I’ve updated the last AppleTV unit, the FoH buttons do not trigger rules in Homekit anymore. I’ve rebooted the Hue hub a few times and then it worked for a short time on one button, but all the rest of them don’t work anymore.

    Basically, triggers from the Hue hub are ignored in Homekit tvOS15. The other way around, Homekit triggering stuff in Hue still works.

    Fortunately I still have iOS14 on iPad’s in the house, so I can divert for now by disabling the hub function of all AppleTV’s.

      1. The problem surfaced right after I updated the last AppleTV to tvOS15 yesterday. That last one is usually HomeKit “master” in the network.

        Most Hue buttons only trigger (single push) a scene without any conditions or homekit shortcuts attached. Scenes that contain Hue lights, Eve Energy sockets (lights) and virtual switches (for HomeBridge timers). Some buttons are programmed in Homekit and Hue simultaneously. Except on those scenes that need to use Homekit Adaptive Lighting. In those scenes Hue lights are set via Homekit. In those scenes I also found that iOS14.x can’t handle more than 6 Hue lights in one scene; with more than 6 Hue lights parameters can randomly be ignored. When that happens I have to push the button more than once to fully activate the scene.

        I have one scene with HomeKit shortcut script, but that one is triggered by time (repeats every 5 minutes). The script reads a Hue outdoor light sensor and uses the value for multiple IF THEN commands to set different scenes (lights, shades) indoor during day-time. I still have to test if that still works.

        1. I don’t have any Friends of Hue buttons at home, so I can’t test it, but I wonder if Hue needs to make an software update for the Hue Bridge.

          Overall I hear a lot about different problems with HomeKit after the update, so I really hope Apple will fix it quickly.

        2. Btw, the shortcut that reads the Hue outdoor light sensor will probably need to be rewritten using the fix in this post.

          1. I got it working again. Edited all the rules that contained a FoH button trigger. I used the Eve app to remove the button trigger, save it and add the button again. This way I didn’t have to rewrite the whole rule, including conditions, scenes and/or shortcuts.
            I must note that I edited the rules on my iPhone which still has iOS14.8 on it.

            Maybe it is a coincidence, but the time between the push on the button and the actual switching on/off seems faster now. Switching on isn’t instant, but at this moment it is faster compared to when all devices were on iOS14.x/tvOS14.x – we’ll see over time.

  3. Hi Stefan, thank you for this workaround. All my rooms are now working again 🙂 One question: Did you notice longer delay when triggering shortcuts with hue switches? I think it takes maybe one second longer to do any action (on/off script, even just turning off all lights). This one second longer delay feels like eternity. In home app the action is instant. Thanks.

    1. Yeah, the delay is really noticeable. Every time I walk into a room that uses the motion sensor to turn on the lights, my first thought is that it’s not working… and then the lights turn on. Let’s hope this will be fixed as well.

  4. Thanks for your post. Nine rooms repaired using your workaround! Now I am wondering if it best to leave the fix in or revert when Apple sort out their s…

    Great blog, and keep the tips coming.

    1. Hi Mike,
      I’m happy this worked for you. This workaround shouldn’t really have any adverse effect on the shortcut, so even when or if Apple gets this fixed, I don’t think it’s necessary to revert back. If they do get it working the old way, I might do a comparison and see if there’s any time difference when running them.

  5. Norberto Torres

    Interesting reading. In my case, my 3 HomePods Minis, the ATV and iPad (not used as a hub) are on iOS 15. Only my iPhone 12 Pro in still on iOS 14.

    However, I don’t experiment any issues with Homekit. Maybe because the iPhone is on iOS 14? I’ve been tempted to upgrade but after all the issues around the shortcuts and automations not working properly I am waiting for a more stable iOS version.

  6. This seems to be fixed in iOS 15.1 RC. I have all HomePods and Apple TV’s on the 15.1 RC and was able to remove the get statements and get numbers statements. So my automations simply just have the “if” conditionals and it’s working perfectly. I have automations where at certain times of the day if the shades are equal to or above a certain value, they will close to a set value. I had to use the workaround before but now with 15.1 it works perfectly without the workaround.

    However I’m trying to get a different automation working based on whether the grave door is opened or closed and I can’t get it to work at all. Not even with the workaround or the Get text values.

    1. Good hearing that most of the problems are solved in 15.1 RC. How about the stability of the Home app on iOS? It’s been really buggy for many.

  7. Thanks for posting this. this newly introduced “undocumented feature” has been driving me mad. i’ve had to resort to using Homekit controller, which of course now means some of my automations reside in that app and not the home app.

    you’re blog and website is really hepful!!! thanks

  8. I noticed that the ”Statistics“ function (specifically the ability to sum a list of numbers) is missing when I’m trying to create a shortcut within HomeKit automations. Is this right? Is there an alternative way to replicate the summing functionality?

    1. You are correct that the Statistics function is not available in HomeKit Shortcuts. There’s quite a few functions that you can use in regular shortcuts that are omitted from the HomeKit Shortcuts.

      What you can do is to
      1) Create a variable and set it to 0
      2) Use the function Repeat with each item in List
      2.1 ) Calculate Repeate Item + The variable you created
      2.2 ) Set the variable to the Calculation Result

      It’s not as elegant as using the Statistics function, but it works 🙂

      1. Sorry, I’m very much a beginner when it comes to HomeKit Shortcuts… 🙂 Would you mind posting a screenshot to show us how the Repeat function would work in this case

        1. Yes, of course. I made notes on the side of the screenshot, so that’s a little bit easier to follow. Let me know if you need any more help 🙂

          Calculating sum of list

            1. In the repeat with each item in list loop, after you calculate the sum you need to update the variable to the result of the calculation. It’s the Set variable SumOfNums to Calcuation Result before End Repeat in my example.

              1. Thanks a lot! That worked like a charm.

                I really hope you produce more content. These Shortcut automations are very helpful, as HomeKit itself is limited – and for me at least, I don’t want to get into the hassle of HomeAssisant and more customized options

                1. Great to hear Ian!
                  I have a quite few ideas in the pipeline, just need to to find some time to write them up 🙂 If you have something specific you’re thinking about, you can always do a suggestion for a post.

                  Again, thanks for your comments and questions. I love to help if I only can.

  9. Do you know if it’s possible to duplicate HomeKit automations with shortcuts embedded in them? The native Home app doesn’t support duplicating automations and others such as Home+ supports duplication but doesn’t seem to include the shortcuts in new duplicated action.

    1. No, I don’t think that is possible. I needed to do this, as I’m running a shortcut that checks every temperature sensor and then logs that on a local web server. My solution was to used a scheduled dummy switch running in Hoobs (Homebridge), with an HomeKit automation (with the shortcut) that runs every time the switch is triggered.

  10. Hi there (first time post 😉)

    Now that iOS 15.2 is out, are your Homekit automations (using shortcuts) still significantly slower?
    In my case, I have switches that use shortcuts to turn lights on and off, that are still annoyingly slow (~2s).
    This seem related to the selected active home hub. I have two Apple TVs 4k, one running on tvOS 14.3 and one now on tvOS 15.2 – as soon as the tvOS 14.3 is active, everything is perfectly fine (delay < 0.5s). I've also tried this with two iPad Pro's (one on iOS 15.2 and one on iOS 14.3) and it exactly the same.

    Thanks a lot!

    1. Hi Marcus,

      I installed 15.2 on my main AppleTV yesterday (4K gen 2), and don’t think I see much difference in how fast the shortcuts are triggered. I haven’t had huge problems with it before, but I do notice sometimes that some take a bit long to trigger. Still room for improvement. Perhaps the best thing for you is to keep one on 14.3 and try to keep it the active one.

Leave a Reply to Marcus Cancel Reply

Your email address will not be published.