github

hoveeman / music-cards

  • среда, 28 марта 2018 г. в 00:16:40
https://github.com/hoveeman/music-cards

Python
Use RFID to call a curl command to homeassistant to play a Google Play playlist



Music Cards

Click the image below to see a video of it being used

RFID Jukebox with Google Home

Requires

  • python evdev. To install:
wget http://dl.piwall.co.uk/python-evdev_0.4.1-1_armhf.deb

dpkg -i python-evdev_0.4.1-1_armhf.deb
  • python mpd-2. To install
pip install python-mpd2

Steps to Run

  1. Run python config.py to select the reader from the inputs
  2. Run python add_card.py to scan cards and enter your Google Play Music Playlist Name
  3. Run python box.py to start the application and verify that it is reading your cards and csv list properly

Install Service to AutoStart

  • Change directory to music-cards/
cd music-cards/
  • Copy the musiccards.service file to systemd
sudo cp musiccards.service /etc/systemd/system/musiccards.service
  • Reload the Daemon
sudo systemctl daemon-reload
  • Start the musiccards.service
sudo systemctl start musiccards.service
  • You can check that the service is running at any time by typing
sudo systemctl status musiccards.service

HomeAssistant Setup for Google Music

  1. Place the files under homeassistant_files in the config directory of your Homeassistant machine.
  2. You will need to create custom_components/switch directory in your config directory and place gmusic.py in there.
  3. Follow this forum post to install gmusicapi, find your device id, and set up the component.

Links to items needed:

Please note that I have Home Assistant running in a Virtual Machine on another computer. If you want to run Home Assistant and the music cards on the same machine I'd recommend a Raspberry Pi 3 as opposed to the Raspberry Pi Zero