Nodejs script file to control cheap 8 channel ethernet relay
Thi script use the embedded Web server to control the relay
Edit the file according to your configuraition (IP adress, etc...)
The HTTP version is a node script used to set / get information of the relay
./relayHTTP.js <RelayNumber> <Action>
with :
<RelayNumber> : Number of the relay beetween (1 and 8)
<Action> : Action to perform, could be :
on : Open the relay
off : Close the relay
info : Get status of the relay
##MQTT Version
This version synchronise the status of the relay to a MQTT server / Topic using the previous script. You publish to MQTT and the relay will activate. Eg. publish "on" or "true" to open the relay publish "off" or "false" to close the relay publish "pulse" to open the relay for 1 second then close the relay
This program also retrieve the status of the relay and publish status to MQTT. The refresh is done every 10 seconds but can be edited or disabled (0 value).
Use as you want. This script are not supported, they are done for my personal use.