iOS icon indicating copy to clipboard operation
iOS copied to clipboard

Siri shortcuts always prompt "Allow "<shortcut name> to access "(null)"?" on watch after ios 15 update for any shortcut calling home assistant

Open smos08 opened this issue 2 years ago • 11 comments

iOS device model, version and app version

Watch Model Name: Apple watch 7 Watch Software Version: 8.1.1

Phone Model Name: Iphone 13 mini Phone Software Version: 15.1.1 Phone App version: 2021.11.1 (2021.266)

Home Assistant Core Version core-2021.11.0

Describe the bug after the ios 15 update every time i try to initiate a shortcut that interacts with home assistant from my watch i am prompted "Allow " to access "(null)"?". it asks to "allow" or "don't allow" but selecting "allow" does not prevent the prompt next time.

To Reproduce create a shortcut that calls a script (or service) and attempt to use siri to launch the shortcut from the watch

Expected behavior the shortcut should be initiated without a prompt

Screenshots watch prompt IMG_0263

siri shortcut.
BC9E33FE-6591-4BBE-B240-5CFB613FE4B6_1_102_o

Additional context running the shortcut on the phone works fine without any prompting except for the first time.

there are a few threads on reddit and mac forums of others having the same issues on other apps.

https://discussions.apple.com/thread/253209888?answerId=256023645022#256023645022 https://www.reddit.com/r/shortcuts/comments/q3jsoy/when_i_trigger_shortcuts_via_siri_on_my_apple/hkrr95e/

smos08 avatar Nov 22 '21 18:11 smos08

I can confirm I'm having the same issue image

The only workaround I have found is to do an HTTP POST request using the native shortcuts action

DewaldBez avatar Dec 04 '21 22:12 DewaldBez

This is an Apple issue. Happens to me with any shortcut that interacts with an app.

ViViDboarder avatar Jan 02 '22 18:01 ViViDboarder

This is an Apple issue. Happens to me with any shortcut that interacts with an app.

that was my assumption since it happened after ios15 but i am seeing others saying the issue has gone away on some apps after they were updated.

smos08 avatar Jan 03 '22 15:01 smos08

having same issue.

roybot0101 avatar Jan 20 '22 22:01 roybot0101

after some recent home assistant ios updates looks like i no longer get "null" as the application but i am still always prompted to allow. at this point i have to assume it is now an apple watch shortcut deficiency and will close this

smos08 avatar Feb 26 '22 15:02 smos08

@smos08 It can be fixed by moving the intent handlers to run on the watch rather than through the iPhone (we've done this with our production apps to fix the same issue.) It's definitely an Apple Watch bug though.

stx avatar Feb 26 '22 19:02 stx

@smos08 It can be fixed by moving the intent handlers to run on the watch rather than through the iPhone (we've done this with our production apps to fix the same issue.) It's definitely an Apple Watch bug though. @stx is that something i would do as a end user or needs to be done on the dev side?

smos08 avatar Feb 26 '22 20:02 smos08

Devs have to do it by adding a WatchOS Intent Extension target in Xcode. Unless you do this the Siri/Shortcut intents are sent to the iPhone and that’s what triggers the bug. I’ve reported it to Apple but they haven’t moved on it yet.

stx avatar Feb 27 '22 04:02 stx

thank you for the detailed explanation, i'm going to reopen then for now so this trail is more visible

smos08 avatar Feb 27 '22 15:02 smos08

Some of the intents could be run on watch, but some can't. To get an idea of whether it's worth adding it to the watch: which actions are you running? These probably can work:

  • Call Service
  • Fire Event
  • Get Camera Image
  • Perform Action
  • Render Template

These probably cannot:

  • Send Location
  • Update Sensors
  • Open Page

zacwest avatar Feb 27 '22 17:02 zacwest

right now the only thing i am using it for is to call the "script.turn_on" service and fire some events. the actions you have listed look well enough in the realm of at least what i would use it for and at least provide a way to accomplish most things. here is a screenshot of one of my shortcuts.

IMG_0608

smos08 avatar Feb 27 '22 17:02 smos08

Any update on this issue?

I know it's supposed to be an Apple Watch bug, but I had the same issue with some other apps (Overcast, for instance), and later an update of said app led to the issue disappearing.

Pending a fix on watchOS side, it would really be wonderful if there is something that can be done to circumvent the issue (other than using webhooks)? I used to use HA through Shortcuts all the time, until this bug emerged (iOS 15/watchos 8, I think?). Now it's so cumbersome that I basically ignore it on the watch, only use HA-shortcuts on the phone.

krissen avatar Nov 28 '22 15:11 krissen

The only workaround I have found is to do an HTTP POST request using the native shortcuts action

This workaround appears to no longer work as of iOS 16.2 / watchOS 9.2. I converted a shortcut from Home Assistant actions to the REST API, but now instead of asking for permission to access Home Assistant, my watch just asks permission to access my HA server's domain name. Actually, it's worse now, since after hitting allow my watch then asked which shortcut I'd like to run. (How about the one I asked you to run? The one you asked permission to run??)

However, I may have discovered another workaround of sorts. When trying to run the original shortcut that used Home Assistant actions, one time instead of hitting allow I just pressed the crown to dismiss the dialog quickly. I was then surprised when the shortcut ran anyway. Perhaps the crown is interpreted as "allow" rather than "cancel" in this context, or perhaps it's a bug. In any case, it's a lot more convenient than hitting allow on the screen.

thedanbob avatar Dec 27 '22 14:12 thedanbob

However, I may have discovered another workaround of sorts. When trying to run the original shortcut that used Home Assistant actions, one time instead of hitting allow I just pressed the crown to dismiss the dialog quickly. I was then surprised when the shortcut ran anyway. Perhaps the crown is interpreted as "allow" rather than "cancel" in this context, or perhaps it's a bug. In any case, it's a lot more convenient than hitting allow on the screen.

Doesn't work here, using the crown like that. Nothing happens besides scrolling the permission notification.

krissen avatar Dec 28 '22 08:12 krissen

I did some more testing last night and found a better workaround (for me). After deleting and recreating the shortcut, and uninstalling Home Assistant from the watch, running the shortcut from the watch only asks permission the first time. If I install Home Assistant to the watch it asks permission every time, and then asks which shortcut I'd like to run (which I already told it).

Obviously this won't work for anyone who uses Home Assistant complications, but I only want to run shortcuts so I don't need the watch app.

thedanbob avatar Dec 28 '22 14:12 thedanbob

oh that sounds promising for me too, i will give this a shot. i would have liked to use the compilations but can sacrifice them for this.

smos08 avatar Dec 28 '22 16:12 smos08

I did some more testing last night and found a better workaround (for me). After deleting and recreating the shortcut, and uninstalling Home Assistant from the watch, running the shortcut from the watch only asks permission the first time. If I install Home Assistant to the watch it asks permission every time, and then asks which shortcut I'd like to run (which I already told it).

Obviously this won't work for anyone who uses Home Assistant complications, but I only want to run shortcuts so I don't need the watch app.

Interesting! Indeed, a viable workaround. Although complications are sacrificed, it would be worth it for me, too.

Perhaps it'll also help troubleshoot it; the problem doesn't seem to lie with the iOS Companion, but watchOS companion.

krissen avatar Dec 29 '22 07:12 krissen

Ironically, it turns out this workaround doesn't actually work for the particular use case I've been attempting. I want to be able to run a shortcut on my watch that opens my garage door as I'm arriving home, before I get back on my home wifi. It seems in watchOS 7 Apple changed things to where instead of sending shortcuts from the watch through the associated phone, they are only run natively on the watch. Meaning, if the shortcut requires internet access (like mine) and you have a non-LTE watch (like mine), when off wifi the watch will ignore the phone's LTE connection and the shortcut will simply fail. Nice one, Apple.

I believe the Home Assistant watch app would take care of this problem if it were working. At least in principle it should route commands that require internet access through the phone when the watch is off wifi, like other watch apps do.

For now, it seems my only options are 1) use a Rube Goldberg setup in which I set a custom focus mode on the watch, which gets mirrored to the phone, which runs a "personal automation" that opens the garage door and turns the focus mode back off, or 2) dig my phone out of my pocket while driving and run the shortcut there.

thedanbob avatar Dec 29 '22 12:12 thedanbob

Commenting here to bump this issue.

I did some more testing last night and found a better workaround (for me). After deleting and recreating the shortcut, and uninstalling Home Assistant from the watch, running the shortcut from the watch only asks permission the first time. If I install Home Assistant to the watch it asks permission every time, and then asks which shortcut I'd like to run (which I already told it).

Obviously this won't work for anyone who uses Home Assistant complications, but I only want to run shortcuts so I don't need the watch app.

This does indeed work, however, it breaks actionable notifications on the Apple Watch.

jwfox5150 avatar Mar 17 '23 16:03 jwfox5150

I did some more testing last night and found a better workaround (for me). After deleting and recreating the shortcut, and uninstalling Home Assistant from the watch, running the shortcut from the watch only asks permission the first time. If I install Home Assistant to the watch it asks permission every time, and then asks which shortcut I'd like to run (which I already told it).

Obviously this won't work for anyone who uses Home Assistant complications, but I only want to run shortcuts so I don't need the watch app.

just tried this after discovering the issue, and this thread, and it worked for me. thanks!

KwisatzJim avatar May 20 '23 14:05 KwisatzJim

this appears to be resolved using the latest watchos and ios, i do not get a prompt anymore.

smos08 avatar Oct 05 '23 01:10 smos08