Still relatively new to Home Assistant and trying to figure out if this is even possible.
I have a Samsung TV in my bedroom that is integrated via Home Assistant, and can be turned on and off from the HA app. I also have a Home Pod in the bedroom. I’d like to be able to ask Siri to sleep the TV after a certain amount of time.
Using the Shortcuts app on my iPhone, I know that I can create a shortcut called “TV sleep timer”, and then have Siri ask something like, “For how many minutes?”. I would respond with a number of minutes, and the shortcut would then capture that number as a variable and save it. Where I’m stuck is how to get that variable into Home Assistant.
I think webhooks are probably what I need to use, and I think I can figure out how to POST the webhook, including the contents of the variable containing the number of minutes, from the Shortcuts app, but I don’t really know how to implement this on the Home Assistant side.
I think I need to set something up like this:
- id: '<super_long_GUID'
alias: TV Sleep
trigger:
- platform: webhook
webhook_id: tv_sleep
condition: []
action:
- data:
message: '{{ trigger.json.text }}'
service: <I have no idea>
I would need to call a service to tell home assistant to wait a certain amount of time, and somehow pass it the variable sent via the webhook, and then I need it to call the media_player.turn_off for the masterbedroomtv entity.
Anyone know how to do this?