To use Sonoff switches with nethome, you need:
- MQTT broker
- Sonoff switch programmed with custom software to communicate with MQTT broker
MQTT broker is a server program which delivers messages between clients (in our case nethome and Sonoff switch are both clients)
Clients can publish and subscribe to messages. For example I have a Sonoff switch in garage which subscribes to
"garage/carheater" topic. When nethome wants to switch on car heater it publishes "on" message to that topic.
Sonoff receives it and turns on car heater socket. I have also a Raspberry Pi in garage which publishes
temperature every minute to "garage/temperature" topic. Nethome subscribes to this topic and receives the temperature and
displays it as "Garage Temp" thermometer.
I'm using Mosquitto MQTT broker running on Raspberry Pi. I have it installed on a separate Raspberry together with OpenVPN server,
but I cannot see any reason why it would not run on the same computer as nethome.
Here
http://www.switchdoc.com/2016/02/tutori ... pberry-pi/ is a good tutorial
how to install Mosquitto on Raspberry. It has also more detailed explanation of MQTT in general.
To program Sonoff you need to solder a four pin header to the PCB and use a USB/serial adapter for serial connection.
There is a lot of information how to connect USB/serial adapter to Sonoff in Peter Scargill's blog. You can find the link in Peter's post.
I prefer to use CP2102 USB adapter instead of FTDI232 adapter, because the transmit output level in CP2102 is already 3,3V and you don't
need to use any resistors to lower the voltage.
I have not published the software I'm running in Sonoff, but I can do it if there is interest.
There are already some implementations of Sonoff MQTT in github, but I'm not really familiar with them, so cannot give any recommendations.
Anyway, the easiest way to start, would be to get an already compiled binary and program that to Sonoff an see what happens
You can also set up a programming environment on your computer for ESP8266 tool chain, but that is a lot more complicated task.
Hopefully this gave at least some idea what is needed to use Sonoff with nethome.
Just ask if you have any questions.