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.
Ja vi får hoppas på en fix snart!
Absolut!
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.
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.
The 16.1 update fixes the bug, but you need to delete and recreate the automations.
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!
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.
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!
I haven’t had time to install iOS 16.1 that came out today to see if it fixes the bug. I hope it does!
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.
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.
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.
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! 🙂
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 : )
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.
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…
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).
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! 😊
Glad you discovered something new : ) yes I use HB/rpi4 and dummy switch to control alarm system (no problems this way).
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).
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.
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?
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.
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.
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 🙂
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.
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
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.
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 😊
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
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?
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.
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).
Sorry for double posting, I thought I didn’t post the first because I couldn’t find it.
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.
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.
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.
Sounds great! Happy to help! Let me know if there’s something else you’re having troubles with.