# MQTT Help and Advice

**URL:** <https://discourse.nodered.org/t/mqtt-help-and-advice/29705>\
**Category:** Hardware\
**Created:** [8 July 2020 08:17 UTC](https://discourse.nodered.org/t/mqtt-help-and-advice/29705 "2020-07-08T08:17:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![swanside](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/swanside/32/28781_2.png) [@swanside](https://discourse.nodered.org/u/swanside)\
**Post date:** [8 July 2020 08:17 UTC](https://discourse.nodered.org/t/mqtt-help-and-advice/29705/1 "2020-07-08T08:17:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [8 July 2020 08:38 UTC](https://discourse.nodered.org/t/mqtt-help-and-advice/29705/2 "2020-07-08T08:38:11Z")

</div>

> [@swanside](#):
>
> 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?

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.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [8 July 2020 08:42 UTC](https://discourse.nodered.org/t/mqtt-help-and-advice/29705/3 "2020-07-08T08:42:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [8 July 2020 09:00 UTC](https://discourse.nodered.org/t/mqtt-help-and-advice/29705/4 "2020-07-08T09:00:56Z")

</div>

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](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.

 ![ScreenShot140](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/b/3b6decedd5373bdabf83b1da4cfb53071d00aa3e.png)

---

<div class="post-metadata">

**Author:** ![swanside](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/swanside/32/28781_2.png) [@swanside](https://discourse.nodered.org/u/swanside)\
**Post date:** [8 July 2020 09:16 UTC](https://discourse.nodered.org/t/mqtt-help-and-advice/29705/5 "2020-07-08T09:16:34Z")

</div>

Thanks Will check that out.  
Regards  
Paul

---

<div class="post-metadata">

**Author:** ![swanside](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/swanside/32/28781_2.png) [@swanside](https://discourse.nodered.org/u/swanside)\
**Post date:** [8 July 2020 09:20 UTC](https://discourse.nodered.org/t/mqtt-help-and-advice/29705/6 "2020-07-08T09:20:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [8 July 2020 10:41 UTC](https://discourse.nodered.org/t/mqtt-help-and-advice/29705/7 "2020-07-08T10:41:09Z")

</div>

Have a look at [https://flows.nodered.org/node/node-red-contrib-aedes](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.

---

<div class="post-metadata">

**Author:** ![swanside](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/swanside/32/28781_2.png) [@swanside](https://discourse.nodered.org/u/swanside)\
**Post date:** [10 July 2020 07:02 UTC](https://discourse.nodered.org/t/mqtt-help-and-advice/29705/8 "2020-07-10T07:02:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [10 July 2020 08:18 UTC](https://discourse.nodered.org/t/mqtt-help-and-advice/29705/9 "2020-07-10T08:18:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [8 September 2020 08:18 UTC](https://discourse.nodered.org/t/mqtt-help-and-advice/29705/10 "2020-09-08T08:18:29Z")

</div>

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