# Esp8266 and multiple ds18b20's with mqtt

**URL:** <https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556>\
**Category:** General\
**Tags:** http-request, mqtt\
**Created:** [30 March 2022 17:47 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556 "2022-03-30T17:47:18Z")\
**Posts on this page:** 20\
**Page:** 12

<div class="post-metadata">

**Author:** ![9toejack](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/9toejack/32/56868_2.png) [@9toejack](https://discourse.nodered.org/u/9toejack)\
**Post date:** [21 April 2022 17:14 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/221 "2022-04-21T17:14:44Z")

</div>

so i have ds18b20 set up on gpio4 (d2)  
and a switch1 on gpio5 (i believe d1)

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [21 April 2022 17:15 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/222 "2022-04-21T17:15:43Z")

</div>

Not sure what you mean scroll down to the bottom of the list for 18

---

<div class="post-metadata">

**Author:** ![9toejack](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/9toejack/32/56868_2.png) [@9toejack](https://discourse.nodered.org/u/9toejack)\
**Post date:** [21 April 2022 17:19 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/223 "2022-04-21T17:19:17Z")

</div>

there wasnt an option for generic 18 on module type  
i just changed it to generic 0 and this is now showing.

 ![no18onlythis](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/2/2278b9eadbd2b442c56d3d5e0f29fcb22c7e79e4.png)

---

<div class="post-metadata">

**Author:** ![9toejack](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/9toejack/32/56868_2.png) [@9toejack](https://discourse.nodered.org/u/9toejack)\
**Post date:** [21 April 2022 17:20 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/224 "2022-04-21T17:20:43Z")

</div>

also not d1 and d2 do not show available here

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [21 April 2022 17:20 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/225 "2022-04-21T17:20:52Z")

</div>

Its right at the bottom of the list

---

<div class="post-metadata">

**Author:** ![9toejack](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/9toejack/32/56868_2.png) [@9toejack](https://discourse.nodered.org/u/9toejack)\
**Post date:** [21 April 2022 17:22 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/226 "2022-04-21T17:22:14Z")

</div>

lol using team viewer i wasnt seeing the bottom of the list haha.  
ok changed to that one sec.

---

<div class="post-metadata">

**Author:** ![9toejack](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/9toejack/32/56868_2.png) [@9toejack](https://discourse.nodered.org/u/9toejack)\
**Post date:** [21 April 2022 17:24 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/227 "2022-04-21T17:24:52Z")

</div>

ok i now see this in mqtt explorer

 ![mqttexplorer1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/8/6843e0b3d0bbbe0600bb56b0ff13fbbfb2cc9d0b.png)

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [21 April 2022 17:29 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/228 "2022-04-21T17:29:17Z")

</div>

```auto
[{"id":"1815959b3c3196ba","type":"ui_switch","z":"74b8a7cc2ec7d068","name":"Wferm","label":"Wferm","tooltip":"","group":"","order":4,"width":"3","height":"1","passthru":false,"decouple":"true","topic":"cmnd/Wferm/POWER","topicType":"str","style":"","onvalue":"ON","onvalueType":"str","onicon":"","oncolor":"","offvalue":"OFF","offvalueType":"str","officon":"","offcolor":"","animate":true,"className":"","x":674.4286499023438,"y":255.25001668930054,"wires":[["dc31eaf2325ec446","9dafc775d0e68f32"]]},{"id":"dc31eaf2325ec446","type":"mqtt out","z":"74b8a7cc2ec7d068","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"8db3fac0.99dd48","x":910,"y":260,"wires":[]},{"id":"b2b0feced5587e54","type":"mqtt in","z":"74b8a7cc2ec7d068","name":"","topic":"stat/Wferm/POWER","qos":"1","datatype":"json","broker":"8db3fac0.99dd48","nl":false,"rap":false,"inputs":0,"x":370,"y":240,"wires":[["1815959b3c3196ba","29e740c8c29caed1"]]},{"id":"9dafc775d0e68f32","type":"debug","z":"74b8a7cc2ec7d068","name":"out","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":950,"y":180,"wires":[]},{"id":"29e740c8c29caed1","type":"debug","z":"74b8a7cc2ec7d068","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":561.5642700195312,"y":406.924516394043,"wires":[]},{"id":"8db3fac0.99dd48","type":"mqtt-broker","name":"","broker":"localhost","port":"1883","clientid":"RailPI","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"1","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]

```

---

<div class="post-metadata">

**Author:** ![9toejack](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/9toejack/32/56868_2.png) [@9toejack](https://discourse.nodered.org/u/9toejack)\
**Post date:** [21 April 2022 17:29 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/229 "2022-04-21T17:29:42Z")

</div>

so i see these 2 things in mqtt explorer

 ![topicinfoisue](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/4/14ca0b9308b1b32091d1f654f63a79aeb7164a1a.png)  
 ![errornote](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/9/59d319862bfb75b6e367d23a5e44c31b5e9bf457.png)  
do these mean it knows that nothing is hooked up?  
aka for this to work right should i hook up a relay to it so it can validate state?

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [21 April 2022 17:30 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/230 "2022-04-21T17:30:51Z")

</div>

try the flow I sent - you will need to put the switch back onto the correct group....

---

<div class="post-metadata">

**Author:** ![9toejack](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/9toejack/32/56868_2.png) [@9toejack](https://discourse.nodered.org/u/9toejack)\
**Post date:** [21 April 2022 17:33 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/231 "2022-04-21T17:33:14Z")

</div>

just did, there is no topic on mqtt out  
and should the payload be "on and off" or " 1 and 0"

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [21 April 2022 17:34 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/232 "2022-04-21T17:34:10Z")

</div>

As I set it up for you, it will then change switch on dashboard in response to esp changing relay state

Topic comes from the switch node so no need to put in MQTT - also means you can use same MQTT node for other things.

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [21 April 2022 17:44 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/233 "2022-04-21T17:44:13Z")

</div>

You will need to configure a relay1 in tasmota - it doesn't need to be wired up though

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [21 April 2022 17:52 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/234 "2022-04-21T17:52:42Z")

</div>

Any luck with this ?

---

<div class="post-metadata">

**Author:** ![9toejack](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/9toejack/32/56868_2.png) [@9toejack](https://discourse.nodered.org/u/9toejack)\
**Post date:** [21 April 2022 18:10 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/235 "2022-04-21T18:10:27Z")

</div>

Relay? Not switch?  
I came to brewery and I'm hooking up a relay, at least I'll see it light up if working

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [21 April 2022 18:26 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/236 "2022-04-21T18:26:00Z")

</div>

yeah relay is an output - switch is an input

---

<div class="post-metadata">

**Author:** ![9toejack](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/9toejack/32/56868_2.png) [@9toejack](https://discourse.nodered.org/u/9toejack)\
**Post date:** [21 April 2022 18:46 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/237 "2022-04-21T18:46:30Z")

</div>

so its set up but the sitch in node red dashboard doesnt change when i click on it  
when logged into tasmota i can hit toggle button and the relay turns on and off.  
im going to walk away for a little im getting frustrated with myself lol.

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [21 April 2022 18:51 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/238 "2022-04-21T18:51:26Z")

</div>

can you open a browser to the esp and open the console so you can see MQTT messages there

click button on dashboard and show me what you see on the esp console

---

<div class="post-metadata">

**Author:** ![9toejack](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/9toejack/32/56868_2.png) [@9toejack](https://discourse.nodered.org/u/9toejack)\
**Post date:** [21 April 2022 18:54 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/239 "2022-04-21T18:54:30Z")

</div>

its not changing in tasmota console when i use ui dashboard

---

<div class="post-metadata">

**Author:** ![9toejack](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/9toejack/32/56868_2.png) [@9toejack](https://discourse.nodered.org/u/9toejack)\
**Post date:** [21 April 2022 18:54 UTC](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556/240 "2022-04-21T18:54:55Z")

</div>

![befforetoggle](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/2/d260d067a2434849bbd2b32b1175ec042378e617.png)  
this is hitting the toggle button

[Previous page](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556.md?page=11)

[Next page](https://discourse.nodered.org/t/esp8266-and-multiple-ds18b20s-with-mqtt/60556.md?page=13)
