This is a very simple prototype-like software to control the power states of all devices in the CityLAB Berlin exhibition. It's running on a Raspberry Pi and exposes a web interface to be controlled from the intranet.
We're using TP-Link HS100 smart power plugs to hard-switch on/off all devices. There is no clean shutdown implemented yet. The power switches are not password protected and should therefore operate inside a separate network just for the exhibition.
List of supported TP-Link devices
- The UI consists of one single switch with instructions/warnings. After turning on the switch, switching back off is disabled for a while to ensure PCs properly boot first. There is a warning to shut down projectors manually first.
- All plugs are switched staggeredly (1 per second) to allow the local power grid to adjust for the load difference.
- The UI is password protected.
- Multiple instances of the UI are synchronized and live-updated.
- Install Node.js
- Add smart plugs to your network. Be aware: TP-Link plugs don't allow set static IP addresses. Make sure to fix IPs for those devices in your router config using their MAC addresses.
- Clone the repository and run
npm install
. - Then run
npm start
to start the server. - Point your browser to the web interface using the severs IP address and port, eg.
http://192.168.0.10:80
- Configuration: Copy
.env-sample
to.env
and change the credentials. Useconfig.json
to change the IPs of your plugs. - To start the script on boot add this script to rc.local, eg.:
sudo node /home/pi/exhibition-remote-control/index.js &
or use a process manager like pm2.
- Properly shut down PCs (using this: Windows PCs, Windows PCs, Linux PCs) and ensure PCs have shut down (using ping) before turning off smart switches.
- Turn off projectors before shutdown
- Poll smart plug state