rmcontrol
rmcontrol copied to clipboard
RM Control — A python app to control an RM2 from BroadLink.
RM Control
RM Control is an app to control an RM2 by BroadLink. It allows users to learn IR and RF codes, store them, and fire them.
Components
- vue.js front-end
- python back-end
- process watcher by supervisord
Requirements
build-essentiallibavahi-compat-libdnssd-devnodejs(>6.0.0)node-gyppython(2.7) andpython-dev
Installation
git clone https://github.com/ericmagnuson/rmcontrol.git && cd rmcontrolsudo python setup.py installexport FLASK_APP=rmcontrol; python -m flask initdbpython run.py
RM Control can be interacted with by visiting the included web interface found at http://127.0.0.1:5000 or by talking directly with the API as described farther below.
VM Initialization (Under construction.)
curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.shsudo bash nodesource_setup.shsudo apt updatesudo apt install build-essential git libavahi-compat-libdnssd-dev nodejs node-gyp python-setuptools python-pip python-devpip install pycryptosudo reboot nowsudo npm install -g --unsafe-perm request homebridge homebridge-httpmulti- To install RM Control, follow the steps in Installation above.
- Using Homebridge-HttpMulti, configure Homebridge to send commands to the RM Control API. See
config.json.samplefor an example.
Supervisor Setup
sudo apt install supervisor- In
/etc/supervisor/conf.d/, add two configuration files,rmcontrol.confandhomebridge.conf. See sample files for help. sudo systemctl enable supervisorsudo systemctl start supervisor
API Documentation
GET /
Shows all commands.
POST / {name: <name>}
Listens for a command from the RM2, and if a command is received, it will be saved with the given name.
POST /<name>
Fire the given command.
PATCH /<name> {name: <name?>, code: <code?>}
Edit the requested command by passing in a new name and/or code.
DELETE /<name>
Delete the given command.
To Do
- Add progress icon when learning.
- Finish edit capability.
- Gracefully handle errors if RM2 cannot be found.