hs420srv

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2021 License: MIT Imports: 6 Imported by: 0

README

Kinivo HS420 Serial Control Server

Example Image

This project is a small server I wrote to control my HS420 HDMI Matrix/Switcher via the RS232 port. I run it on a Raspberry Pi connected via a Serial-to-USB cable, controlled by Home Assistant's RESTful Command Integration.

Installation

This project has one dependency. Run go get to install it:

go get github.com/bmizerany/pat

To build the binary, run:

go build hs420srv.go

Usage

Currently supports Linux only. Run the server to start, providing the appropriate serial port as an argument:

./hs420srv /dev/ttyUSB0

The server listens on port 10330.

GET /version Returns the current version. Mostly used to test the API is online.

POST /power Toggle the device on or off

POST /switch/<TV>/input/<INPUT> Switches the displayed input for the specified TV. TV is either 1 or 2. Input is 1-4.

This program was built without any concern for security. If you do decide to use it, make sure to lock it down behind a firewall. I used ufw to block anyone other than Home Assistant from calling the API.

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL