u/Bryan_URN_Asshole

Using Siri to speak a family member's location from Home Assistant using IOS shortcuts

Using Siri to speak a family member's location from Home Assistant using IOS shortcuts

I'm fairly new to shortcuts and I've only been using Home Assistant for a few months, so I'm still pretty new to it all. I've learned a lot from this subreddit, so I figured I would share a shortcut I created that I use all the time in case anyone else was looking to do this.

What it does: I tell Siri "Find NAME" where the name is my wife or one of my kids. This causes the shortcut to use HA to get the location information. The shortcut then speaks the location along with how long they have been there. If they are driving it says they are driving in TOWNNAME and the current speed they are driving.

Note: I had to create a shortcut for each person, because I didnt want to have to prompt for who to track. So for each of my kids and my wife, I have a shortcut called "Find NAME". I also created a separate track script for each person because I had too many problems trying to pass the person's name to the HA script. So each shortcut calls the script.track_NAME. That script just calls a script which accepts the first scripts person name and does the work. This was so I didnt have 5 really long scripts and if I later wanted to change the output I wouldnt have to change it in 5 scripts.

I originally tried to have the script return the response and use the location that way, but I had such a problem with the POST saying 400 Bad Request, that I changed it up. I wound up using a text helper that the script writes the location information to when it runs. I then have the shortcut read that text helper.

Like I said, I am very new to this, so if anyone has some ideas on how to improve this I am all ears. Also if anyone has questions, I'll try my best to answer them.

Link to download the shortcut from icloud: https://www.icloud.com/shortcuts/972a21f14f914d4ba65104037135ef1d

First my HA setup:

This is the script that the shortcut calls. When it runs, calls the person's track script which looks like this:

https://preview.redd.it/e7ixloik5f0h1.png?width=634&format=png&auto=webp&s=1ac61986b28b4697885e2f411c45fb11d5997f0f

then that script calls the main script (like I said, so I only have to make changes once instead of in 5 places:

https://preview.redd.it/hriebwxm5f0h1.png?width=1081&format=png&auto=webp&s=2acadbd26dc7075caefa26c16f4eacfeb5bf4528

For the travel speed I have a sensor I created a while ago:

https://preview.redd.it/yyskmx8p5f0h1.png?width=658&format=png&auto=webp&s=0a93e26619fd90445b7c1d33659edff4ef0b452b

And then this is my shortcut (hopefully I didnt mess it up when i copy and pasted them all to one screenshot for easier reading):

https://preview.redd.it/4elpbvot5f0h1.jpg?width=1185&format=pjpg&auto=webp&s=7ccb9f975ab1a3835c1748a3a8b3904ce5191237

A few notes:
- The dismiss siri and continue allows my phone to be on silent mode and still speak the text.

- You need to put your long lived access token in the text box. Make sure autocorrect doesn't add a space afterwards

- The entity_id has to match the name of the script. To make things simple, for each user use the same naming convention.

- You need to create a input_text helper that the shortcut can read the response to. I used siri_location_response

- Use get dictionary value and read the key "state" to get the clean response.

And just because I'm proud of it, here is my home screen. The apollo air sensor and garbage can sensors are off right now while I'm updating some code. But it gives me a clean interface where I can quickly see where everyone is (if they are home its greyed out otherwise it says if they are at work or the address they are at). I also put a tabbed area for each area of my house along with main status indicators. Like the Foyer has a lock that is either an unlocked or locked icon. and the lights icon. So just from teh buttons i can see if a light is on or if a door is locked)

https://preview.redd.it/681n6s1x5f0h1.png?width=511&format=png&auto=webp&s=be8cd5bc91ba8dd9a297a32ab81743ec0cb4223a

reddit.com
u/Bryan_URN_Asshole — 11 days ago

Have Siri speak the location of family members using Shortcuts and Home Assistant

I'm fairly new to shortcuts and I've only been using Home Assistant for a few months, so I'm still pretty new to it all. I've learned a lot from this subreddit, so I figured I would share a shortcut I created that I use all the time in case anyone else was looking to do this.

What it does: I tell Siri "Find NAME" where the name is my wife or one of my kids. This causes the shortcut to use HA to get the location information. The shortcut then speaks the location along with how long they have been there. If they are driving it says they are driving in TOWNNAME and the current speed they are driving.

Note: I had to create a shortcut for each person, because I didnt want to have to prompt for who to track. So for each of my kids and my wife, I have a shortcut called "Find NAME". I also created a separate track script for each person because I had too many problems trying to pass the person's name to the HA script. So each shortcut calls the script.track_NAME. That script just calls a script which accepts the first scripts person name and does the work. This was so I didnt have 5 really long scripts and if I later wanted to change the output I wouldnt have to change it in 5 scripts.

I originally tried to have the script return the response and use the location that way, but I had such a problem with the POST saying 400 Bad Request, that I changed it up. I wound up using a text helper that the script writes the location information to when it runs. I then have the shortcut read that text helper.

Like I said, I am very new to this, so if anyone has some ideas on how to improve this I am all ears. Also if anyone has questions, I'll try my best to answer them.

Link to download the shortcut from icloud: https://www.icloud.com/shortcuts/972a21f14f914d4ba65104037135ef1d

First my HA setup:

This is the script that the shortcut calls. When it runs, calls the person's track script which looks like this:

https://preview.redd.it/qvhldschze0h1.png?width=634&format=png&auto=webp&s=2e061808bc91284d6b786f9ce21c638e21c432eb

then that script calls the main script (like I said, so I only have to make changes once instead of in 5 places:

https://preview.redd.it/316scdooze0h1.png?width=1081&format=png&auto=webp&s=7be3b37e40a1171ebe881744cd72e2cb2f1afe2d

For the travel speed I have a sensor I created a while ago:

https://preview.redd.it/427wzchi0f0h1.png?width=658&format=png&auto=webp&s=8e60f18ee54d3ec1b227e8ac2ae7ad7014a9bca1

And then this is my shortcut (hopefully I didnt mess it up when i copy and pasted them all to one screenshot for easier reading):

https://preview.redd.it/q9ivwsju0f0h1.jpg?width=1185&format=pjpg&auto=webp&s=d79828866028aba9b00f0802287e325997cae895

A few notes:
- The dismiss siri and continue allows my phone to be on silent mode and still speak the text.

- You need to put your long lived access token in the text box. Make sure autocorrect doesn't add a space afterwards

- The entity_id has to match the name of the script. To make things simple, for each user use the same naming convention.

- You need to create a input_text helper that the shortcut can read the response to. I used siri_location_response

- Use get dictionary value and read the key "state" to get the clean response.

And just because I'm proud of it, here is my home screen. The apollo air sensor and garbage can sensors are off right now while I'm updating some code. But it gives me a clean interface where I can quickly see where everyone is (if they are home its greyed out otherwise it says if they are at work or the address they are at). I also put a tabbed area for each area of my house along with main status indicators. Like the Foyer has a lock that is either an unlocked or locked icon. and the lights icon. So just from teh buttons i can see if a light is on or if a door is locked)

https://preview.redd.it/z3bibh2y2f0h1.png?width=511&format=png&auto=webp&s=c6cd544466c143f12d918f357ca44fbc2c0a0e83

reddit.com
u/Bryan_URN_Asshole — 11 days ago