# Tasmota power plug MQTT connecting problem

**URL:** https://discourse.nodered.org/t/tasmota-power-plug-mqtt-connecting-problem/56342
**Category:** General
**Created:** [9 January 2022 13:07 UTC](https://discourse.nodered.org/t/tasmota-power-plug-mqtt-connecting-problem/56342 "2022-01-09T13:07:19Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)
#### Post date: [9 January 2022 13:07 UTC](https://discourse.nodered.org/t/tasmota-power-plug-mqtt-connecting-problem/56342/1 "2022-01-09T13:07:20Z")

</div>

I am trying to connect a TASMOTA (not SONOFF) power plug with mqtt.  
I use node-red-contrib-tasmota. I use the sensor node to communicate.  
 ![afbeelding](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/d/ad9ac710c625736d1abc1f2bb2c09a68a945b74f.png)

 ![afbeelding](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/d/ada0e89b1b8cde24549db3d1233374c6c36c036c.png)

I have configured the broker node,

 ![afbeelding](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/a/5ad3d5d9523a7159b83449d498ce354dc80121d2.png)

But the power plug as well as node-red don't seem to be able to find each other.

 ![afbeelding](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/1/418f9b3b566c697da40f346379cc5f9881de4d04.png)

Node -red is running on 192.168.0.21, it reports,

 ![afbeelding](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/4/24d71265d67e50e8929c82848a12ffdd3b44e927.png)

I saw a topic on this before, and there the problem was another old not used broker that was in the way, but in my case there is no other broker config node, that I am aware of.

Any suggestions?

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [9 January 2022 13:12 UTC](https://discourse.nodered.org/t/tasmota-power-plug-mqtt-connecting-problem/56342/2 "2022-01-09T13:12:41Z")

</div>

You need to set the ip of the mqtt brokker in the tasmota device, at the moment it looks like you set it to 127.0.0.1, which is local host. So Tasmota device is trying to connect to itself.

Fix the ip of the mqtt server and then add that ip to the tasmota device.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [9 January 2022 14:01 UTC](https://discourse.nodered.org/t/tasmota-power-plug-mqtt-connecting-problem/56342/3 "2022-01-09T14:01:03Z")

</div>

> [@E1cid](#):
>
> You need to set the ip of the mqtt brokker in the tasmota device, at the moment it looks like you set it to 127.0.0.1, which is local host. So Tasmota device is trying to connect to itself.

I don't think that's correct, the Tasmota console says it is trying to connect to a broker at 192.168.0.21.

Is your MQTT broker provided by node-red-contrib-tasmota?  
What operating system does Node-red (and mqtt broker) run on?  
How do you know the broker is running?  
Is it set to accept network connections beyond localhost?  
Edit - another question:  
Does the broker require a username/password? To set up the password in Tasmota you have to tick the password box then enter the password and click Save.

There are various tools you can use to test your MQTT setup. See the useful articles at [http://www.steves-internet-guide.com/](http://www.steves-internet-guide.com/)

I have smart sockets flashed with Tasmota and my MQTT broker is Mosquitto (on Linux). It does need configuring to accept connections over the network.  
I don't know about the Tasmota nodes though, I don't use those.  
The sockets connect to Mosquiito and I just use the standard mqtt-in and mqtt-out nodes to communicate

---

<div class="post-metadata">

### Author: ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)
#### Post date: [9 January 2022 14:05 UTC](https://discourse.nodered.org/t/tasmota-power-plug-mqtt-connecting-problem/56342/4 "2022-01-09T14:05:47Z")

</div>

@E1cid , I think I did it right, this is the config. of the Tasmota device,

 ![afbeelding](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/7/c7afbc294791ee224ed78f7c5c42fca25541b554.png)  
 ![afbeelding](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/8/f8376fc142360c9a661dadc1ed94aec5021c2513.png)  
So the Tasmota device is trying to connect to 192.168.0.21, as you can see in the Tasmota log, which is the ip of the RPI, where Node-red is installed and where the MQTT node is configured. Changing the localhost to IP 192.168.0.21 on the broker in Node-red doesn't solve the problem.  
 ![afbeelding](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/b/3bd7c0935965ef78bd6459258d4298325702e833.png)

---

<div class="post-metadata">

### Author: ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)
#### Post date: [9 January 2022 14:50 UTC](https://discourse.nodered.org/t/tasmota-power-plug-mqtt-connecting-problem/56342/5 "2022-01-09T14:50:15Z")

</div>

@jbudd and @E1cid, I ditched the Tasmota librairy and installed AEDES broker, now it is working.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [9 January 2022 14:54 UTC](https://discourse.nodered.org/t/tasmota-power-plug-mqtt-connecting-problem/56342/6 "2022-01-09T14:54:44Z")

</div>

Aedes is simple to install since it's within Node-red, and it works but it's better to use Mosquitto. For example Mosquitto supports quality of service.

---

<div class="post-metadata">

### Author: ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)
#### Post date: [9 January 2022 15:04 UTC](https://discourse.nodered.org/t/tasmota-power-plug-mqtt-connecting-problem/56342/7 "2022-01-09T15:04:42Z")

</div>

> @jbudd  
> Aedes is simple to install since it's within Node-red, and it works but it's better to use Mosquitto. For example Mosquitto supports quality of service.

Ok, that sounds good. I will try, Thanks.

---

<div class="post-metadata">

### Author: ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)
#### Post date: [9 January 2022 15:10 UTC](https://discourse.nodered.org/t/tasmota-power-plug-mqtt-connecting-problem/56342/8 "2022-01-09T15:10:25Z")

</div>

@jbudd , I cannot find Mosquitto in the librairy. How do I install?

---

<div class="post-metadata">

### Author: ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)
#### Post date: [9 January 2022 15:15 UTC](https://discourse.nodered.org/t/tasmota-power-plug-mqtt-connecting-problem/56342/9 "2022-01-09T15:15:49Z")

</div>

@jbudd , ok I found one here,

> **[Install Mosquitto Broker Raspberry Pi | Random Nerd Tutorials](https://randomnerdtutorials.com/how-to-install-mosquitto-broker-on-raspberry-pi/)**
>
> This tutorial shows how to install the Mosquitto Broker for MQTT communication on a Raspberry Pi board.

---

<div class="post-metadata">

### Author: ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)
#### Post date: [9 January 2022 15:37 UTC](https://discourse.nodered.org/t/tasmota-power-plug-mqtt-connecting-problem/56342/10 "2022-01-09T15:37:58Z")

</div>

@jbudd , Ok, that seems to be working correctly.

Thanks for the help. 😀

---

<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: [23 January 2022 15:38 UTC](https://discourse.nodered.org/t/tasmota-power-plug-mqtt-connecting-problem/56342/11 "2022-01-23T15:38:15Z")

</div>

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