GithubHelp home page GithubHelp logo

vaslabs / home-automation Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 47 KB

This is my personal setup to play games when I travel. I'm working on a portable solution but on my own pace.

Home Page: http://www.playingplaces.com

JavaScript 29.67% Shell 70.33%
cloudgaming steam proton remoteplay aws videogames alexa

home-automation's Introduction

How to start

Use this guide if you know what you are doing. You need an AWS account and basic knowledge around IAM, SQS, EC2 and creating Alexa skills. Basic bash scripting skills, how to ssh, configure ssh access and know some javascript.

Setup

If you are on gnome you can add a .local/autostart entry to get the script running on login.

You need a dedicated SQS for reading from the machine you are running this script from, which is meant to contain alexa intents.

Use the provided .config/autostart and .local/bin to setup your startup.

AWS with Raspberry Pi setup

  • Create an ec2 instance running ubuntu and install ds4drv.
  • Configure ssh access to the ec2 instance by adding your machine's public key to the .ssh/authorized_keys
  • Create two SQS queues (one for the gaming pc, one for the raspberry pi)
  • Create a lambda function that forwards alexa events to the sqs queue. Example
  • Create an alexa skill and connect it to the lambda function
  • Create the gaming pc user that can access SQS and describe ec2 instances. On the gaming PC use aws configure to setup the AWS keys.
  • Create the raspberry pi user that can access the other SQS queue). On the raspberry pi use aws configure to setup the AWS keys.
  • Install wakeonlan on the raspberry pi

First test

  • Create a turn off gaming pc intent on your alexa skill. When you trigger it, the gaming PC and raspberry pi will read the message from the queues and turn off.
  • Turn on the raspberry pi. Create a turn on gaming pc intent on your alexa skill. Enable wake on lan on your gaming pc bios settings. When you trigger it, the raspberry pi should read the message from the queue and send a wake on lan to the gaming pc. The gaming pc should turn on.
  • Follow the code for more Alexa skill Intents

Special cases

Assuming your Alexa skill has all the intents the code expects.

Sequence for adding 4 players with dual shock 4 controllers

  1. Start ds4drv on your machine you have physical access to (the client) to create 4 devices. ps4_as_xbox_four_players
  2. On the gaming PC, start ds4drv
  3. Make sure ds4drv is also running on the ec2 instance and maps the controllers to /dev/input/event4 and /dev/input/event5 (if not, adapt the code, these values are hardcoded in the shell scripts).
  4. Connect 2 virtual controllers on your client to the ec2. Guidance here
  5. Connect your dual shock controllers with bluetooth as normal.
  6. Start remote play to connect to the gaming pc
  7. Tell alexa to connect controllers
  8. Wait for the xbox 360 notifications to appear
  9. Make sure your 2 controllers work
  10. Connect 2 more virtual controllers from your physicall device
  11. Connect your additional controllers via bluetooth.
  12. Tell alexa to add two more players (trigger the add 2 players intent)
  13. Wait until 2 more notifications appear and tests that your new controllers work.

Remote play does not connect

If your devices are connected to the internet this can happen due to the gaming PC being frozen or steam being unresponsive. On the first case you need to have smart plugs to turn them off and force a power down. For the second case you can have a restart steam intent (supported in the code)

Why is this so difficult?

This is my personal setup to play games when I travel. I'm working on a portable solution but on my own pace.

home-automation's People

Contributors

vaslabs avatar

Stargazers

 avatar

Watchers

 avatar  avatar

home-automation's Issues

Add some testing

With more things added, it would be nice to setup some github actions for sanity testing

Update Proton GE automatically

Currently, everytime there's a new version of Proton GE we have to start remote play , download the new version , place it in the right folder and restart steam.
We could save time by doing at with a home-automation command which is also triggered via the current alexa skill

Setup infrastructure as code

Currently the ec2 instance to serve game inputs is created manually.
Having it described in terraform will help portability and make project more reproducible

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.