Start apps on PS4 using Google Assistant and IFTTT (updated)

This is an update to my previous post, now that we have a native PS4 component and changes to the IFTTT/webhooks interface.

I can say “Hey Google, start Netflix on the PS4” or “Hey Google, start Horizon on the PS4” to wake the PS4 and start the app/game I asked for. This works whether the PS4 is in standby or in another app. It’s faster to use this to switch between Amazon and Netflix than using the joypad.

Set up the required integrations: PS4, IFTTT Webhooks.

Create an applet on IFTTT.com:

Google Assistant : Say a phrase with a text ingredient

What do you want to say?
Start $ on the PS4

What do you want the Assistant to say in response?
OK, Here's $

Webhooks : Make a web request
URL:
https://xxxx.example.com:8123/api/webhook/hufkfib7hkcl0rwvbnja0j6zw2bi90nrm7w8d5dyybed9yojdz959uoxhwm4dnac

Method:
POST

Content Type:
application/json

Body:
{"action": "ps4_service", "title": "{{TextField}}" }

Add an automation to receive the title from Google Assistant/Webhooks. Customize it with the games that you want, and the list of words that you may say. Google may hear different things, so a few mis-spellings might help. (See .ps4-games.json or the source drop-down menu for all the media_titles the component knows about).

- id: ifttt_ps4
  alias: IFTTT PS4
  trigger:
  - event_data:
      action: ps4_service
    event_type: ifttt_webhook_received
    platform: event
  action:
  - service: media_player.select_source
    entity_id: media_player.playstation_4
    data_template:
      source: >
        {% if (trigger.event.data.title|lower in ["netflix"]) %}
            Netflix
        {% elif (trigger.event.data.title|lower in ["amazon", "amazon prime", "amazon prime video"]) %}
            Amazon Prime Video
        {% elif (trigger.event.data.title|lower in ["horizon", "horizon zero dawn"]) %}
            Horizon Zero Dawn
        {% elif (trigger.event.data.title|lower in ["red dead redemption", "red dead"]) %}
            Red Dead Redemption 2
        {% elif (trigger.event.data.title|lower in ["now tv", "nowtv"]) %}
            NOW TV
        {% elif (trigger.event.data.title|lower in ["iplayer", "eye player"]) %}
            BBC iPlayer
        {% else  %}
            {{ trigger.event.data.title }}
        {% endif %}
#     Also kick the Harmony hub to turn on TV & Amp (if required):
  - service:  remote.turn_on
    data_template:
      entity_id: remote.hubi
      activity: 20685489

I hope this is useful!

1 Like