Problems with automations using the Weather function in iOS 16

As Iā€™m sure a lot of you have already noticed, there are problems with using the Weather function in HomeKit automations (shortcuts). They work fine if youā€™re test run them in the Home app, but not when triggered normally. Letā€™s hope these are fixed in the next update.

37 thoughts on “Problems with automations using the Weather function in iOS 16”

  1. Im happy I found this post, even if it was a little late.

    I have some complex automations that control the shades and take into account sunset/sunrise, current shade position, contact switches (dont close shades if the window is open) AND the weather.

    After spending many hours trying to “fix” this, I finally removed all my automations just in case one of them was “broken” and affecting the others. I created and tested all the automations one by one and found that every “new” automation worked fine, only the ones that contained a shortcut and that shortcut used the weather function didn’t work.

    1. I only had problems with a few automations, plus the ones using the weather function. I think itā€™s really frustrating that Apple so often breaks HomeKit automations when they do the yearly software updates. HomeKit is already old enough to be a lot more mature and stable.

      1. Thanks for the post about deleting and recreating the shortcut to fix sunrise/sunset issue. I probably wouldnā€™t have tried deleting and still been upset they arenā€™t working.

        Things are working as expected!

        1. Glad to hear! It’s a lot of work deleting and recreating a lot of automations. It’s not so fun, especially if you’re not sure it’s going to fix the problem.

  2. In ios 16 I created a shortcut that uses if before sunrise, if after sunset else x. Works just fine from my iPad via shortcut or siri. On my iPhone is defaults to the last else and doesnā€™t check sunrise or sunset. I deleted the shortcut, then recreated on the iPhone with the same results. Very frustrating and hopefully fixed soon!

      1. Sadly, the issue still persists post upgrade to 16.1 at least for my automation/shortcut. My home automation/shortcut first turns off the alarm when someone arrives home, that always worked. Then if itā€™s after sunset, turn on the lights at home. The latter doesnā€™t work.

        1. I just installed iOS 16.1 on my phone and also updated the hubs (AppleTV and HomePod Mini). That alone did not fix the issue, but I then tried to delete and recreate the automations, and that worked. So, the update fixes the problem, but you probably need to delete and redo the shortcuts. Not perfect, but at least it’s possible to get it working.

          1. Thanks – I followed suite, deleted and recreated it, just waiting for sunset and that I leave home to test it : )

            I have a somewhat unrelated question. If two people (one home owner, the other resident) arrive together in a car to an un-occupied home, does either of ā€œAnyone arrivesā€ or ā€œFirst person arrivesā€ matter for any automation ? Both people are selected.

            Thank you.

            1. Thatā€™s actually a very good question. Iā€™ve set up a local webserver running on a Raspberry Pi which I use to log certain data from HomeKit. One of the datapoints is when I or my wife is leaving or returning home. I notice that using geofencing in HomeKit isnā€™t perfect. It seems like the threshold for when we are home is about 50 meters from our homeā€¦ the interesting part is when checking the log, even though we arrive together, there might be anything from 10 seconds to a minute difference in the log times for the two of us. This makes me think that it probably is considered two different events. For whoever is first detected returning home will trigger ā€œFirst person arrivesā€, and then ā€œAnyone arrivesā€ for when the second person is detected returning. I could set up a test to check this, but Iā€™m pretty sure that is what usually happens.

              Thanks for a great question! šŸ™‚

              1. Thanks for a great answer šŸ™‚ Iā€™ve always suspected something odd! I know with Homebridge we could capture any logs for its devices/setup but would be curious to learn how to do that for HomeKit . (If you can share)

                I still fail to understand the difference between those two options with a simple automation such as turn on lights . Even with a delay in detecting both people arriving together, ā€œanyone arrivesā€ or ā€œfirst person arrivesā€ with both people selected for either options will result in the same action: someone arrived.

                The observation from your logs will become important if thereā€™s people specific actions/triggersā€¦ where I have more questions to follow if you are up for them : )

                1. The difference between the two is that if you return home when nobody is home ā€œFirst person arrivesā€ should trigger. If you arrive home when the other resident is already at home, ā€œAnyone arrivesā€ should trigger.

                  The way we had it set up earlier was that when the first person arrives, the entrance hallway lights turned on as well as some mood lighting in the living area. When the next person arrived home, only the entrance hallway lights turned on. Now Iā€™ve set it up a little bit more advanced with dummy switches arming motion sensors, and motion sensors turning on lights and timers, etc šŸ˜Š

                  As to how Iā€™m logging some events:
                  Iā€™m running a local apache/php/mySQL server, but you could also use a webhost for this if you already have one. I created a database (mySQL) where I store the logs. With PHP I created a webpage that takes GET parameters, and then stores them with a timestamp in the database. Using HomeKit automation shortcuts, I then just get the contents of an url, which in turn runs the webpage which logs the data.

                  So, if I go to the url https://localwebserver.local/log/?l=1 in the shortcut, my script on the webpage takes the parameter ā€œlā€ with the value 1 and logs that in the database together with a timestamp. Itā€™s very simple, but you need some webdev knowledge. Iā€™m using the same method to log a lot of weather and temperature data.

                  I set up a little test log just to check if it will run both ā€œfirstā€ and ā€œanyoneā€ arrives when the two residents arrive home, and Iā€™ll check it in a few hours and let you know the result.

  3. Thank you for the details. Ok hereā€™s a twist and appreciate any tips : )

    Automation 1(A1): Turn on garage lights and entrance lights when I arrive, turn off after 5mns
    A2: Turn on entrance lights when other person arrives (for the case when they arrive alone). Turn off after 10mns.
    A3: Turn off alarm, turn on home lights (excludes entrance) when we arrive

    I never got that above combo to work reliably, sometimes the entrance lights would turn on then off when we arrive or when the other person arrives alone. Iā€™ve deleted and re-created those after full upgrade to 16.1 and will re-test.

    I wonder if HomeKit scenes or automations are ā€œadditiveā€, i.e. they wouldnā€™t turn off anything that is already set or does the ā€œturn offā€ interfere somehow. Or itā€™s just HomeKitā€¦

    1. Do you happen to have Homebridge / Hoobs running at home? I also had some problems with timers in HomeKit, so I started using dummy switches in Hoobs where I could set the off switch timer. I then coupled the dummy switch turning off to turning off the lights that I want.

      Turning off alarms might be problematic, as I think HomeKit usually doesn’t want to do that within automations. There are ways around that though, but I believe people use dummy switches for that.

      Using the “Anyone arrive”, and then pressing the little “i” to choose which person has worked well for personalized automations (also logging).

    2. Ok, so I set a test where I created one automation for when “anyone arrives” and another for when “first person arrives”, and both automations was supposed to trigger for both residents. I’m a bit surprised by the result. The log shows both “first person arrives” and “anybody arrives” triggered at the same time, and then another “anybody arrives” about 30 seconds later.

      So whatever you put in an automation for “first person arrives” will run together with what you have in “anybody arrives”. I didn’t know that. I’m really happy you asked this question! šŸ˜Š

      1. Glad you discovered something new : ) yes I use HB/rpi4 and dummy switch to control alarm system (no problems this way).

        1. Then I would also use dummy switches as timers to turn lights off. If you turn the dummy switch on with the lights, set the dummy switch time to turn off to whatever you need, and then create an automation for when the dummy switch turns off, which turns off the lights. Also, make the dummy switch resettable, that way it will restart the timer if it’s turned on a second time (if two people arrive within a some minutes of each other).

  4. Using what you found above, I tried the following:

    A1: Turn on garage and entrance lights when I arrive, turn off after 5mns
    A2: Turn on entrance lights when other person arrives, turn off after 10mns.
    A3: Turn off alarm, turn on home lights (excludes entrance) when the first person arrives (both home occupants arrived together)

    A3 worked, A2 triggered but the entrance lights turned off right away, A1 garage lights never triggered. For fun Iā€™ll remove the timers from A1 & A2 and use different brightness and try tomorrow.

    1. And you’re using “Anyone arrives” with you or the other person checked for A1 and A2? Is it possible that A1 did trigger, but it triggered too early, so that the 5 minutes had already lapsed when you got to the garage? What if you try A1 with turning off after 15 minutes?

      1. Thanks for the tips. Yes, I have selected the specific person for A1 & A2 using ā€œanyone arrivesā€. Just to be clear, for A1 using ā€œanyone arrivesā€, Iā€™ve selected only myself. For A2, using ā€œAAā€ Iā€™ve selected the other person.

        Given the set geofence distance of 100m, driving to my home should take less than 1mn : ) but Iā€™ll try your suggestion and increase to 15mns.

        Thereā€™s nothing to explain why A2 turns on and then off when we get home. I can also disable A1 as another test. Iā€™ve been having trouble with these automations since few years I think.

        1. Hmm, I do have to admit that the anyone leaves and anyone arrives doesn’t trigger with 100% success for me either. It’s quite good, but fails every now and then.

          1. OMg, I finally figured it out. In the welcome home automation it uses a scene, I had left the entrance lights in it but off! So when we both arrive, the entrance lights are turned on by the welcome lights automation for my wife, then turned off by the other one/scene!

            I canā€™t believe I never thought to check the scenes until today as I was creating a party scene!!! In any case thanks for entertaining my questions and providing suggestions and tips šŸ™‚

            1. I’m happy you found it! And thanks for letting me know. Let me know if there’s any other home automation you’re having trouble with.

  5. Hi,

    First of all: Thanks for all the awesome guides and tips – I’ve used them a lot!

    After moving to a new house, I set up all my automations. However, Shortcuts no longer works on my Hue sensors (it works on my Hue remotes). Creating the code and running it triggers it normally, but when I try to test it with an actual motion, it won’t work. Do you have any idea what could be the cause? I have the latest firmware on all my devices.

    Thank you in advance!

    Best,
    Emil

    1. Hi Emil, and thank you for your comment/question!

      I would start by checking the Hue sensors in HomeKit. If you go into the Home app, go the room where one of them is, and then check the status of the motion sensor in the row where you get temperature, how many lights are on, sensors, etc. You might need to scroll to the side a bit to see the sensor. Try moving in front of the sensor and see if the status changes in the Home app. This way you can see if HomeKit has a good connection to them.

      Motion sensor in the Home app

      Another thing to check is in the Hue app under Settings, Accessories. Are the motion sensors turned on, and does it say ā€œNot configured in this appā€ underneath them? I know it might cause problems if you have them configured both in the Hue app and the Home app.

      Iā€™m sure youā€™ve gone through the normal dance of taking power away from your router, all of your HomeKit hubs (AppleTVs, HomePods) and your bridges (Hue, TrĆ„dfri, etc), and then adding them slowly back (giving them time to boot up)ā€¦ first your router, then your HomeKit hubs and lastly your bridges.

      If all seems fine so far, I would then create an automation triggered by the motion sensor, but only turn on a lampā€¦ not use the shortcut part yet. Does that work?

      If you get back with the results of these tests, Iā€™m sure we can figure it out together šŸ˜Š

      1. Thank your for your reply.

        The weird thing is, “normal” (without using Shortcuts) automations work just fine – actually also with the Hue amp turning them off (it seems more robust – it did back in the day at least šŸ˜Š).

        The sensors also respond normally in the Home app but when I try converting it to a Shortcut, there is no response. Motion IS detected, but the code is not running as expected (except when running it manually from the code editor).

        Maybe moving to a new house with new automations, and some things reset but the Apple tv has somehow “confused” it. Would it make sense to try to reset the Apple tv?

        Best,
        Emil

        1. Hmm, could you try making a new automation that is triggered by motion, and for that creating a shortcut that only turns on a light?

          1. Triggering just one scene as a Shortcut actually works. I’m going to try to build it up and see where it breaks.

            Thank you!

            Bonus question: Do you use Homekit for turning the lights off again after some time? I can’t seem to find the feature when using Shortcuts. And a couple of years ago I just started using the Hue app to turn the lights off after getting triggered by a sensor because Homekit wasn’t reliable. Many times only one of the lights turned off.

          2. That actually works. I also developed it a bit further with an if-statement given the time (in this case if the time is over 2100 start a scene, else start another). And that also works. Very weird.

            Bonus question: What are you using to turn off the lights again after getting triggered by a sensor when using Shortcuts? I can’t seem to find the feature. I started using Hue just to turn off lights a couple of years ago because it seemed more reliable than Homekit (I remember that it often only turned off one of the lights).

              1. Yeah, no worries. I’m getting so much spam in these comments, that I’ve moderate all comments before they show up. I probably get 30-50 spam comments for every real one.

            1. Great! šŸ˜Š This is the way Iā€™ve been troubleshooting when stuff has broken for me. Just build them back up slowly to see where something goes wrong. Sometimes it has seemed like it only needed to be deleted and rebuilt to start working.

              For turning lights off, I use a version of the of the when no motion is detected with a warning automation shortcut. Most of the time (about 98% of the time) it works. However, I have fail-safe for it, by using a dummy switch in Hoobs (Homebridge), which is resettable and timed. So if the shortcut fails, the dummy switch will trigger the same shortcut to run after another 5 minutes (checking for motion, and if no motion in 2 minutes, it will turn off the lights). The combination of the two has never failed.

              1. I have managed to make it work for one of my zones. Now I’ll just have to incorporate your turning off-technique. And thenā€”hopefullyā€”I’m good to go šŸ˜Š

                Thank you so much for the answers.

                1. Sounds great! Happy to help! Let me know if there’s something else you’re having troubles with.

Leave a Reply to Stefan Cancel Reply

Your email address will not be published. Required fields are marked *