5.Node-RED interface

During this project, i discovered Node-RED ans nod-js development tool.

Node-RED was already pre-installed in my emoncms SD image where the MQTT server is hosted so i could directly develop a node-RED interface without doing any modification on the running system.

I use the dashboard-UI as web interface.

The interface:

ON the top part named MONITOR it is possible to restart the monitor module or reset the lora module of the monitor module.

Below this two button the monitor messages are displayed.

The General switch section are all the button to send command to all the Lora devices. The PING button send a PING command to all the devices and the reply is displayed below the monitor Buttons.

The RST button send a Reset command to all the devices.

The other button are general command send simultaneously to all the lora modules to switch ON or OFF all the following relays:

Cottages, Fridges, Garden,Wall, Night, ALL

The ALL button Switch ON or OFF all the realys on all the modules.

The NIGHT button switch ON or OFF the wall and Garden relays on all the modules.

The monitor reset button use an HTTP request to the monitor webserver.

The monitor message read an MQTT topic from the MQTT server

All the other button publish to a MQTT topic named /MONITOR1CMD

ex: /MONITOR1CMD/PING or /MONITOR1CMD/NIGHTON

The middle part named Night lights set up the nght ON OFF timer and all the relays which should be set to ON via this timer.

The night light On and night light Off time are updated via httprequest to the monitor webserver. the time is in millisecond.

The other button are published to a MQTT topic with a json String {D1:D1RLY,C12:C12RLY,C14:C14RLY, C11:C11RLY,C10:C10RLY,C9:C9RLY,C8:C8RLY,C7:C7RLY,C6:C6RLY}

The bottom part display for each bungalow the SNR and RSSI of the last received command. Those filed are updated via some MQTT topic:

/ModuleName/RSSI and /ModuleName/SNR ex: /COTTAGE12/RSSI

The RESET and PING button send a PING and RESET command to individual module by publishing to MQTT topic:

emon/ModuleName/CMD/ ex emon/DIVING1/CMD/PING

Each button Garden, Wall Cottage, fridge read and publis to MQTTtopics defined as:

/ModuleName/RELAY# ex: /COTTAGE14/RELAY1

Flows:

Check at the bottom of the page for the source json code flows.json file.

Monitor:

NightLight:

Lora Modules