Coder Social home page Coder Social logo

media-center-automation's Introduction

Media Center Automation

I have a very small media center in my bedroom with:

The PC is running a minimal arch linux installation with Kodi. I'm using a 8Bitdo NES30 bluetooth controller to control this setup. I also have a IRToy v2 connected to the PC allowing me to control the TV and amp.

This repository contains some small tools and configurations I use to automate my setup, with low power usage and convenience in mind.

  • LIRC remote configurations for the SMSL Q5 Amp and LG TV.
  • udev rule to apply the proper attribute to the NES30 bluetooth device
  • Kodi keymapping for the NES30 bluetooth remote

For detailed specifics on the PC configuration see the ansible playbook used to provision it.

Bluetooth connection status automation

The included bt-power-listener script is used to listen for connection status changes for the NES30 controller. The idea is that the power status of the controller should dicate the media center being 'in use' or not.

Power On:

  • Start the Kodi standalone service using systemd
  • Power on my TV and amp with lirc

Thes two actions will only happen under the condition that Kodi isn't already started and playing a video.

Power Off:

  • Stop the kodi standalone service using systemd
  • Power off my TV and amp with lirc

These actions will only happen if Kodi is not currently playing any media. In that case instead a notification will be displayed on screen to alert me to turn the controller back on if it has disconnected.

HDMI switcher Kodi script

This simple script is used to switch HDMI inputs on my TV. It will also suspend the bluetooth controller power listener, so that turning off the controler (or having it go into standby) will not trigger the TV and amp to turn off.

The script will bring up a dialog where pressing "OK" will switch back to the first input, this allows the workflow of:

  1. Turn on Xbox or other device connected to HDMI-2
  2. Run the hdmi.switcher script (Likely from a home menu item)
  3. Use the device (game on!)
  4. Turn the controller back on and press "A" for OK.

Arch Linux installation

A PKGBUILD file is provided in my PKGBUILDs repository

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.