Page 1 of 1

Help configure Generic MQTT import

Posted: 04 Oct 2018, 19:36
by ulfh2018
I am trying to configure Generic MQTT import some of on my ESP8266 devices, but I'm not sure how to make set this up in Node Red.
I have set up the Name to Heat, the Topic to cmd and the value to On, but how can I address this from a Node Red mqtt input and mqtt output node?

I know this is a bit off the record, but I don't know where else to ask.

Best regards

Ulf

Re: Help configure Generic MQTT import

Posted: 04 Oct 2018, 19:56
by grovkillen
MQTT import will only accept float values. But what exactly are you trying to achieve? Please explain further.

Re: Help configure Generic MQTT import

Posted: 04 Oct 2018, 20:35
by ulfh2018
I have two devices configured on the ESP, on DHT22 and one generic MQTT import. The DHT22 will publish information to a MQTT broker at home, and when temperature drops below a given value, I want to publish a value to the ESP, which in some way shout be used to switch on a relay to turn on the heat.

I thought this could be done by publishing a 0 or 1 as integer (can off course convert to float, if that is needed) and make rules that could use GPIO to set a free pin high or low at the ESP.

Is this possible, or am I just fishing in an empty brook?

Re: Help configure Generic MQTT import

Posted: 04 Oct 2018, 21:52
by grovkillen
You don't need to use MQTT for that. If the DHT22 and relay is connected to the same ESP unit you can just use rules.

Re: Help configure Generic MQTT import

Posted: 04 Oct 2018, 23:29
by ulfh2018
Hi "Grovkillen" - maybe I should write in Norwegian, but I recon that would limit the value of this post.

Thank you for taking time looking at my request.

I think I need to describe the project a bit more:

I am using Node Red and some DHT22 sensors to keep track of the status of our summer house about 200 km south of Oslo. So far I'm able to define limits for temperatures which are stored in a database. I want to be able to let Node Red take action if the temerature falls under the levels I define at my RPi running Node Red, wherever I am bringing it, and then fire off some kind of signal to turn on the heater.

I am using my own MQTTbroker, which is password protected and rerouted on my router to the broker using DDNS.

If I can acompiish this without using MQTT, that's fine, but I'm not very deep into these topics yet, and though I have tried to find similar examples to follow, I still don't know how to do it.

If you could give me some hints, or a refernce to somewhere I can dig out information, I would apreciate it, but off cours I don't expect you to spend hours helping me out. I'm not a young guy anymore, so it takes longer time to pick up new stuff than when I was 30 - 40 (I'm soon 72)

Have a lovely evening!

Re: Help configure Generic MQTT import

Posted: 05 Oct 2018, 01:02
by randytsuch
My home system uses node red, esp easy and also Home Assistant.

My current nodes/flows call Home Assistant, and Home Assistant sends a mqtt command to an esp somewhere to toggle a relay.

But you should be able to have NR send the mqtt command, I just haven't done that.

If it was me, I'd set up a mqtt sniffer program, and then make sure NR is sending a mqtt command out.

In this thread, it describes how to format the mqtt commands to set the state of a gpio pin
viewtopic.php?f=4&t=5642

Good luck
Randy

Re: Help configure Generic MQTT import

Posted: 05 Oct 2018, 08:13
by ulfh2018
Thank you so much, Randy - worked as a dream, so why do it complicated when it can be done so easy. You are a genious!

Re: Help configure Generic MQTT import

Posted: 05 Oct 2018, 17:07
by randytsuch
ulfh2018 wrote: 05 Oct 2018, 08:13 Thank you so much, Randy - worked as a dream, so why do it complicated when it can be done so easy. You are a genious!
Glad I was able to help

Most of this is easy if you know how to do it 8-)