Hi all,
I’ve created a simple Siri shortcut to turn on my Tv and select one of the available sources or a Live Tv channel.
Maybe it could be useful or inspiring for someone.
Requirements:
- a Television you can control from Home Assistant and exposed to Homekit.
(I’m using an LG with WebOs)
Setup:
- Create an automation triggerd by a webhook.
Take note of the webhook_id as you need to specify it in the shortcut.
Here is mine but you can modify it as you wish:
alias: Select Tv Channel
description: ''
trigger:
- platform: webhook
webhook_id: select_channel
condition: []
action:
- service: media_player.turn_on
target:
entity_id: media_player.lg_tv
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- service: media_player.play_media
target:
entity_id: media_player.lg_tv
data_template:
media_content_id: '{{ trigger.json.event }}'
media_content_type: channel
mode: single
- Download the shortcut from here
When you install it, it will ask you several configuration questions.
You can accept the default settings I’ve included or speficy yours.
I have included 4 options for choosing a source, but again you can modify it.
You have to specify what you want to call the source and then setup the right accesory (your Tv) and the approriate source in the Home app (e.g. Netflix, Amazon Prime…).
Instead when you ask for the Live Tv, Siri will ask you for what channel.
I use the number of channels but you can also try the name (the automation probably needs some modification in this case).
The last configuration question is to activate the automation in Home Assistant.
You have to specify your HA URL followed by /api/webhook/webhook_id
The webhook_id
is the one you have created with the automation.
Well, it’s easier to do than to explain
Here is two hypothetical use cases:
- Hey Siri, turn tv on
- Ok what do you want to watch?
- Netflix
Tv turns on and Netflix is launched
===
- Hey Siri, turn tv on
- Ok what do you want to watch?
- Live Tv
- What channel do you want to watch?
- Seven
The TV turns on and then changes to the desired channel
Final Notes:
- You can modify the shortcut and the automation to select the sources directly from Home Assistant instead of using the Home app.
- This is the first time I have ever exported a shortcut, so I hope I haven’t done anything wrong with setup questions
Cheers