MQTT Help and Advice

Hi All. I am looking at MQTT with not much knowledge, am I correct in thinking I need a MQTT Broker to connect devices over WIFI to my PI and read the values in Node Red?
I will be looking at making or copying a few projects, two being reading a ORNO OR-WE-514 Modbus RTU Energy Meter and the other being trying to read a Outside Light Level sensor and then controlling garden lights, so any advice would be fantastic on types of hardware and where to purchase?
Thanks
Paul.

Yes. Mosquitto is a common choice for a broker. It is cross platform and written in C so very efficient and has a low resource requirement.

For an excellent guide to MQTT see https://www.hivemq.com/mqtt-essentials/

2 Likes

Probably need a bit more detail on some of the items... like the garden lights - are they mains operated ?

Here's a link to a tutorial about an Infra-red detector - it might give you some ideas.

http://resources-area.co.uk/node-red-flows/ir_security_tutorial.pdf

The infra-red detector could be replaced with a light dependent resistor (LDR) and fed into the analog pin of a Wemos D1 Mini.

If your garden lights are mains-driven then I would use something like a SonOff switch S20 (flashed with Tasmota) as it is very easy to contol via MQTT.

Quite a few of the members on this forum use Wemos devices (ESP8266 12F) (flashed with ESP Easy, Tasmota or ESP-Home) that do the 'interface' functions and let the RPi act as the master controller.

PS:
I control my garden lights from BigTimer which is programmed to turn the lights ON at dusk and OFF at 22:00 hrs. The system can be run in 'Automatic' or 'Manual' mode. Various lights can be enabled/disabled depending on what I want to achieve.

Here's a screen-shot of the dashboard.

3 Likes

Thanks Will check that out.
Regards
Paul

Hi Thanks for the info.
All the Garden lights are 220V ac and currently I use a Trend IQ4, which I have a Trend IQ3 on the other side of the house which as an External Light Sensor connected, so I can set the required LUX and bring the lights on and no matter what time of night I can turn off so they are not on al night. I have a Sonoff 4CHPro, doing nothing so may investigate that, but thanks for the link and ideas.
Regards
Paul

1 Like

Have a look at https://flows.nodered.org/node/node-red-contrib-aedes

It's extremely quick and easy to setup, and although it doesn't provide the full wealth of options that Mosquitto does, it's probably more than adequate for your needs and experience.

3 Likes

Cheers Paul. Wil check that out, Just need something basic and then I can experiment more after that.
Thanks
Paul

that runs the broker inside Node-RED - which is fine for messing about (as Paul suggests). A lot of folk use the Mosquitto broker on Pi etc as it is part of the available software and then runs independently of Node-RED which can aid resilience and performance.

3 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.