Giter VIP home page Giter VIP logo

yams's Introduction

yams

A Python web service for controlling Yamaha receivers from an Amazon echo device.

Usage

Yams is super easy to run. Just get Python 3.5.1 (I highly recommend pyenv) and do the following inside this directory.

$ pyvenv env
$ . env/bin/activate
$ pip install .
# Note that it's best to assign a static DHCP ip to the receiver so the ip is
# always the same, then pass that it in with the -r option.
$ python -m yams # Optionally with --debug or --port.

This will run a web server on port 8185 by default, but this can be changed via a -p flag. You can turn on debug mode by passing -d.

Alexa Skill

Note this project is aimed towards developers. It's a complicated process to set up an Amazon Echo skill, and this project has to run somewhere on the same network as the receiver it is meant to control, otherwise you'd have to open up access to the receiver to the internet. For example, I run Yams on a Raspberry Pi 2. One of the more complicated aspects of setting up an unpublished Echo Skill is that it is required that the web server has a valid SSL certificate. Fortunately, a self-signed certificate will work for unpublished skills and alexandra, the framework used to develop this skill, has some documentation on it and a script to help with generating the files you need.

Intents and utterances are included in intents.json and utterances.txt, respectively. All slots are custom types, which I have set as follows on my own skill:

  • Directions
    • up
    • down
  • VolumeOptions
    • a little
    • a bit
    • a lot
    • a bunch
  • ReceiverPowerStates
    • on
    • off
  • RecieverInputs
    • chromecast
    • playstation
    • play station

ReceiverInputs is the only one you'd configure differently when setting up your own skill. You set the mappings from these slot values in the input_mappings.json file.

Activation Word

I recommend 'receiver' as the activation word for this skill. 'yams' will work, but I had spotty luck with the Echo often thinking I was asking it to turn itself up or down.

Functionality

Yams can turn your receiver on and off (if network standby is enabled), turn the volume up and down at various levels of granularity, and switch inputs for you. Most common remote functionality is covered.

When you get bored of listening to yourself ask it "what's the yams?". If you don't get it, you don't listen to enough Kendrick Lamar.

yams's People

Contributors

raynes avatar

Stargazers

WolfBlade avatar Michael Clausen avatar Michael Corrado avatar Christian Dahlhausen avatar  avatar Tilo Baller avatar Austin Shoecraft avatar Andrew avatar

Watchers

 avatar James Cloos avatar Matt Furnari avatar Keith C Wire avatar  avatar  avatar

Forkers

sagilo

yams's Issues

How to install and configurate?

Hi!
I'm totally new to programming but I bought an Amazon Echo and I have a Yamaha rx-v779 receiver I really want to be able to control via amazon echo with your "yams". Not only via IR (via Broadlink RM Pro with RM bridge and ha bridge) since it doesn’t support you volume commands for example. (Really dig them!)

I have manage to set up a ha bridge and everything works, but I don't understand how to set up this one..

If you could help me with how to make this work I would really appreciate it! :D

Kind regards, Pehr

OpenSSL and parsing issue

Great little application which I have been able to get running with my alexa and my yamaha receiver. Note that there is an error in the package installation of OpenSSL which I was able to work around. I'm relatively new to python so I'm not sure if there is a way to update the installers to prevent it from occurring.

When you install yams the OpenSSL package that gets installed will fail with an error about an undefined environment variable. Not sure if YAMS calls the OpenSSL dependency or Alexandra.

The work around is to go into the python directory \Lib\site-packages and delete the OpenSSL and pyOpenSSL directories. You then need to use pip to reinstall the pyOpenSSL package. This resolved the issue on my machine.

There is a second issue I had with Alexandra running on my windows PC. It will attempt to parse the site certificate path from amazon and puke because the path after the server name doesn't match /echo.api/. In util.py _get_certificate() I needed to change the following line to remove the startswith statement. I printed out the path and it was correct but apparently startswith doesn't parse the path correctly. Might be a windows path issue.

# Sanity check location so we don't get some random person's cert.
if url.scheme != 'https' or \
   host not in ['s3.amazonaws.com', 's3.amazonaws.com:443'] or \
   **not path.startswith('/echo.api/'):** <- this fails
    log.error('invalid cert location %s - host %s - path %s', cert_url, host, path)
    return

Otherwise I'm digging it and was able to get everything running without too much pain for a python noob.

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.