The aim of this project is to control multiple sonoff devices using MQTT.
The sonoff devices have all been prepped to support the Sonoff-Tasmota firmware. This firmware provides MQTT support to the sonoff devices.
The solution:
- uses the paho MQTT java library for MQTT communication;
- relies on a running MQTT broker, like Mosquitto;
- uses ngx-mqtt
- uses ngx-ui-switch
- the solution is deployed as spring boot standalone application services
- scheduling is realised using the description on baeldung blog in combination with this github example.
Because the solution is implemented using spring boot it can be easily started using java -jar <jar-file-name>.jar
.
This allows the application to be started as a systemd service on a Raspberry PI.
This article describes how to configure this.