Giter Club home page Giter Club logo

go-rotel's Introduction

Rotel Amplifier Control

The code here is for bridging a Rotel Amplifier to MQTT, for integration into Home Assistant, where the Rotel Amplifier is connected to the serial port of a host machine. The requirements are:

  • A Linux host connected to the Rotel Amplifier via a RS232 port
  • A MQTT broker running on the same machine or on the network
  • Docker installed on the host machine

To run the docker container on an ARM64 host,

docker run --rm --name rotel --device=/dev/ttyUSB1 \
  ghcr.io/djthorpe/rotel-linux-aarch64:1.0.7 \
  rotel -mqtt localhost:1883 -tty /dev/ttyUSB1

This assumes that the serial port is /dev/ttyUSB1 and the MQTT broker is running on the same machine. The command line arguments for the rotel command are:

Usage of rotel:
  -mqtt string
    	MQTT broker address (default "localhost:1833")
  -qos int
    	MQTT quality of service
  -topic string
    	Topic for messages (default "homeassistant")
  -tty string
    	TTY for Rotel device (default "/dev/ttyUSB0")
  -version
    	Print version and exit

Building the Docker Container

To build the docker container, ensure you are logged into docker. The Makefile contains some parameters you'll want to change. Then,

git clone [email protected]:djthorpe/go-rotel.git
cd go-rotel
make docker

This will make the container and upload it to the registry.

Configuring Home Assistant

Assuming you have the MQTT integratiion installed, you can create a card in Home Assistant to control the amplifier, that looks like this:

Home Assistant Card

The card can be created using the following YAML:

type: entities
entities:
  - entity: switch.rotel_amp00
  - entity: number.rotel_amp00
  - entity: select.rotel_amp00
title: Rotel
show_header_toggle: false
state_color: true

Contributions, etc

Contributions are welcome. Please raise an issue or pull request on the GitHub repository. The limitations at the me moment are,

  • A -name parameter should uniquely identify the amplifier (at the moment it's hard-coded to "amp00")
  • Only the power, volume and source are exposed (it wouldn't be difficult to expose more controls). These are the other controls which could be added:
    • ROTEL_FLAG_MUTE
    • ROTEL_FLAG_BASS
    • ROTEL_FLAG_TREBLE
    • ROTEL_FLAG_BALANCE
    • ROTEL_FLAG_BYPASS
    • ROTEL_FLAG_SPEAKER
    • ROTEL_FLAG_DIMMER
  • Implement the following push buttons: play, stop, pause, track_next, track_prev, mute_toggle, vol_up, vol_down, bass_up, bass_down, bass_reset, treble_up, treble_down, treble_reset, balance_left, balance_right, balance_reset, speaker_a_toggle, speaker_b_toggle, dimmer_toggle, power_toggle
  • Code is only tested on an A12 amplifier, but should work on other models
  • A github workflow should be used to build the containers on different platforms and architectures
  • Only one amplifier and serial port can be controlled per host

go-rotel's People

Contributors

djthorpe avatar

Stargazers

Carter Konz avatar  avatar

Watchers

 avatar

Forkers

cartfisk

go-rotel's Issues

Not really an issuue but question: is it possible to create addon from your docker container?

I plan to try your component for the Rotel integration but i have one challenge: i use Home Assistant supervised and while it uses docker in the background, i don't know if it's easy to add your container. It would be much simpeler if this would be an addon.

I haven't digged in to this yet so i don't know how easy it is to create an addon from a container but maybe you know. If not, i can look into it.

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.