A service to control Energenie sockets using the Raspberry Pi control board (PiMote). Communication via MQTT.
- MQTT - on a Raspberry Pi you can install mosquitto.
sudo apt-get update && sudo apt-get install mosquitto
- PiMote Energenie board attached to Raspberry Pi.
- Install docker
curl -sSL https://get.docker.com | sh
sudo systemctl enable docker
sudo systemctl start docker
sudo usermod -aG docker $(whoami)
- Run the socket-control container
docker run --restart=always --privileged -e MQTT_URL=mqtt://<IP/name>:<port> -e MQTT_USERNAME=<user> -e MQTT_PASSWORD=<pass> -d --name socket-control handymoose/rpi:socket-control
-
Install NodeJS v6+
-
With apt-get install python python-gpiozero python-rpi.gpio
-
Clone the repository, run npm install, run node index.js
State topics (to subscribe to):
home/socket/[1-4] on|off
Change topics (to publish to, retain=false):
home/socket/[1-4]/set on|off
Example, socket 3 is currently off, topic will be:
home/socket/3 off
to turn on socket 3 publish following message:
home/socket/3/set on