Skip to content

Simple HTTP server to control connected HDMI-CEC devices

License

Notifications You must be signed in to change notification settings

Rafostar/cec-web-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cec-web-api

License npm Downloads Donate Donate

Requires CEC capable device (e.g. Raspberry Pi or USB-CEC adapter).
Additionally cec-client must be installed. On Raspbian it is included in cec-utils package.

Installation

API can be used as both core node module or a binary app.
Install it as an app system-wide with below command:

sudo npm install cec-web-api -g

Start server with:

cec-web-api [port] [--hdmi-ports=<number>]

Port number is optional (default: 8080).
Number of HDMI ports in TV (used for changeSource function) can also be specified (default: 3).

Usage

Requests to your host will return controller object. Navigate through it like usual in JavaScript replacing dots with slashes. Use ?value=x to pass args to available functions. Below example shows how to switch dev0 (TV) HDMI source to a second port.

http://ip:port/dev0/changeSource?value=2

For more info on HDMI-CEC usage and available functions visit cec-controller GitHub page.

Donation

If you like my work please support it by buying me a cup of coffee :-)

PayPal

About

Simple HTTP server to control connected HDMI-CEC devices

Resources

License

Stars

Watchers

Forks

Packages

No packages published