Transfer a variable & start script from IOS shortcut to HA

I just setup my HA system a few days ago so I haven’t been tinkering too much yet but I’m trying to make a script that would be started from iOS shortcuts app which is working fine, however I would also like to add a variable, as in time.

Now I can only get the script to run, but I can’t find a simple way to send over a variable from iOS shortcuts to HA which then would be translate to a specific paus period before the scripts continues. As the time period is based on a calculation made before I would send the run command to my HA.

Hi,

I’m also trying to use shortcuts handing over a variable to a home-assistant script.
Did you get progress on that? Thanks.

Yeah I actually did, its not the most beautiful setup but I made a button in home assistant, sent it over to HomeKit, then i run the shortcut on my watch and in the shortcut I have it selected to press this button and it triggers something in HA.

My way of sending over a specific number was to make a shortcut that would press a button that increases an input number I created in HA. So I run the shortcut, the shortcut presses the button, refresh HomeKit devices, check the input number if it’s correct for the specific data I want to send, if it is press a button that signalize this to HA otherwise press the same button once again to increase the number and loop it.

I was using this to send over a battery percentage, but you could set it up so maybe 1 means something and 2 something else for HA so you just have to increase until you find your number for this action you want to do.

I hid all of this “setup” buttons in a separate room in Home in my IOS devices so it didn’t show up where I change other stuff.

Could you please put this shortcut somewhere for download?

Thank you!

I’ve stopped using the shortcut I made for this thread so it’s unfortunately been deleted.

However you could send over a variable much better as I found out you can send a dictionary and change the variable right away.

https://www.icloud.com/shortcuts/6d628b75b377426b9307f6096ed0e8b6

This shortcut remove 30m from a time I supply the shortcut and then send the new time to HA which starts an alarm.

Dm me if you need any help setting it up or any other shortcuts and ill try to help :slightly_smiling_face:

Thank you very much, Julian!

I downloaded the Shortcut and will have a look at it soon!