Help configure Generic MQTT import

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ulfh2018
Normal user
Posts: 39
Joined: 19 Feb 2018, 06:11
Location: Oslo Norway

Help configure Generic MQTT import

#1 Post by ulfh2018 » 04 Oct 2018, 19:36

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

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Help configure Generic MQTT import

#2 Post by grovkillen » 04 Oct 2018, 19:56

MQTT import will only accept float values. But what exactly are you trying to achieve? Please explain further.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

ulfh2018
Normal user
Posts: 39
Joined: 19 Feb 2018, 06:11
Location: Oslo Norway

Re: Help configure Generic MQTT import

#3 Post by ulfh2018 » 04 Oct 2018, 20:35

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?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Help configure Generic MQTT import

#4 Post by grovkillen » 04 Oct 2018, 21:52

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.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

ulfh2018
Normal user
Posts: 39
Joined: 19 Feb 2018, 06:11
Location: Oslo Norway

Re: Help configure Generic MQTT import

#5 Post by ulfh2018 » 04 Oct 2018, 23:29

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!

randytsuch
Normal user
Posts: 33
Joined: 05 Jun 2017, 05:32

Re: Help configure Generic MQTT import

#6 Post by randytsuch » 05 Oct 2018, 01:02

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

ulfh2018
Normal user
Posts: 39
Joined: 19 Feb 2018, 06:11
Location: Oslo Norway

Re: Help configure Generic MQTT import

#7 Post by ulfh2018 » 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!

randytsuch
Normal user
Posts: 33
Joined: 05 Jun 2017, 05:32

Re: Help configure Generic MQTT import

#8 Post by randytsuch » 05 Oct 2018, 17:07

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-)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 5 guests