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-essential -
libavahi-compat-libdnssd-dev -
nodejs(>6.0.0) -
node-gyp -
python(2.7) andpython-dev
Installation
-
git clone https://github.com/ericmagnuson/rmcontrol.git && cd rmcontrol -
sudo python setup.py install -
export FLASK_APP=rmcontrol; python -m flask initdb -
python 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.sh -
sudo bash nodesource_setup.sh -
sudo apt update -
sudo apt install build-essential git libavahi-compat-libdnssd-dev nodejs node-gyp python-setuptools python-pip python-dev -
pip install pycrypto -
sudo reboot now -
sudo 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 supervisor -
sudo systemctl start supervisor
API Documentation
GET /
Shows all commands.
POST / {name:
Listens for a command from the RM2, and if a command is received, it will be saved with the given name.
POST /
Fire the given command.
PATCH /}
Edit the requested command by passing in a new name and/or code.
DELETE /
Delete the given command.
To Do
- Add progress icon when learning.
- Finish edit capability.
- Gracefully handle errors if RM2 cannot be found.
