The python-ps4 project allows you to control your playstation with your voice with Google!
- Python 3.6+
- Node.js LTS 10.16.0+
- Firebase CLI
Note: This project uses Cloud Functions for Firebase, which requires you to associate a billing account with your project. Actions projects do not create a billing account by default. See Create a new billing account for more information.
- Create a new Smart Home project in the Actions console
- Deploy the placeholder smart home provider to Cloud Functions for Firebase
using the same Project ID:
npm install --prefix functions/ npm run firebase --prefix functions/ -- use ${PROJECT_ID} npm run deploy --prefix functions/
- In Develop > Actions, set the following configuration values that matches the
Cloud Functions for Firebase deployment:
- Fulfillment:
https://${REGION}-${PROJECT_ID}.cloudfunctions.net/smarthome
- Fulfillment:
- In Develop > Account linking, set the following configuration values:
- Linking type:
OAuth
/Authorization code
- Client ID::
placeholder-client-id
- Client secret:
placeholder-client-secret
- Authorization URL:
https://${REGION}-${PROJECT_ID}.cloudfunctions.net/authorize
- Token URL:
https://${REGION}-${PROJECT_ID}.cloudfunctions.net/token
- Linking type:
Choose one of the supported the discovery protocols that you would like to test, and enter its attributes in the Actions console at Develop > Actions > Configure local home SDK under Device Scan Configuration.
Note: These are the default values used by the virtual device for discovery. If you choose to use different values, you will need to supply those parameters when you set up the virtual device.
- Broadcast address:
255.255.255.255
- Broadcast port:
3312
- Listen port:
3311
- Discovery packet:
A5A5A5A5
Serve the sample app locally from the same local network as the Home device, or deploy it to a publicly reacheable URL endpoint.
-
Start the local development server:
npm install --prefix app/ npm run build --prefix app/ npm start --prefix app/
Note: The local development server needs to listen on the same local network as the Home device in order to be able to load the Local Home SDK application.
-
Go to the smart home project in the Actions console
-
In Develop > Actions > On device testing set the Chrome and Node development URLs to the ones displayed in the local development server logs.
Configure ip
, port
, and credential
in python-ps4.ini
located in your ${HOME} directory.
- IP: The address where python app is hosted
- Port: The port the python web app is served on
- Credential: The credential is obtained from the playstation using the playstation second screen app and Wireshark (need to automate this setup)
To build the python application run:
make run