I seem to not be able to get my switch to work for mqtt and my sonoff basic switch. Here is my config and other information! Now i do have cloudmqtt for tracking but i have not changed anything for that area all i added was the switch to config.yaml. what could be the issue?
You need to connect a client to your broker to listen to all topics, to see what your Sonoff is sending (if anything). The topic they use seems to vary by release.
I use mosquitto_sub, but I here many people use MQTT.FX
mosquitto_sub -t "#" -v -u user -P password
Of course, that is assuming that HA is connecting to your broker.
I use MQTT Box on my PC, and MyMQTT app on my Android phone.
âStill nothingâ? Be more descriptive of ânothingâ. Are you unable to turn the switch on or off?
Hereâs how you can test your Sonoff outside of Home Assistant:
From a browser, log on to Tasmota.
Click on Toggle to make sure the hardware is connected. The relay in the Sonoff should turn on and off.
If not, then you have a problem in the Sonoff. (Iâve never had one fail this test).
Click on Console
In âEnter commandâ, type fulltopic
Unless you changed something you should see:
{"FullTopic":"%prefix%/%topic%/"}
Now type prefix and note the result.
Again, unless you changed something, you should get:
{"Prefix1":"cmnd"}
Now type topic.
In my case, I get:
{"Topic":"light"}
So, the complete command topic for this light is:
cmnd/light/power
Then go to your favorite MQTT tool, and send the payload âonâ or âoffâ to topic "cmnd/light/power
If the MQTT tool turns the Sonoff on and off, then your problem is not in the Sonoff.
Thanks for the replyâs
I am able to access Tasmota and login into the device, i can turn the switch ON and OFF through the devices ip address now when using the console i get what is shown in the picture below. When using that information to send a packet like in the picture nothing takes place. There is ON and OFF shown in the picture but that is just me turning it on manually by pushing the switches button. So basically home assistant is sending the packet but the switch is not seeing the packet, One thing to add is that the device is picked up by mqtt as shown in the first post and picture
I really like using Tasmota on my ESP nodes and I am slowly moving all of them to that firmware, but I am frustrated by the bizarre topic hierarchy that weâre stuck with. I know you can change the prefix and topic, but weâre still stuck with âpowerâ and âPOWERâ for the cmnd and stat topics respectively.
This is not the case with latest Tasmota Versions. I have my Sonoff Basics running with Tasmota 6.2.1 and I confirm that both cmnd and stat topics are upper-case POWER
I am going crazy with this mqtt tasmota setup issue. I 'm on hassio v0.78 and recently restored a snapshot but now my mqtt switches stop working. It did work before so Iâm confused.
How should the yaml look like? Anyone has a step by step instruction how to get this working again?
MQTT Host 192.168.1.xx
MQTT Port 1883
MQTT Client &
Fallback Topic DVES_E88A33
MQTT User pi
MQTT Topic sonoff-FAN
MQTT Group Topic sonoffs
MQTT Full Topic cmnd/sonoff-FAN/
You first need to do verify that you can control the switch with MQTT messages using an MQTT tool on your PC or cellphone. I donât recognize the tool in your image, above.
What did you get from the console when you entered fulltopic, topic and prefix?
Which tools do you mean because the tools i use are the tasmota with the ip address of the switch and then home assistant with nothing else but the mqtt broker now i do use mqtt for tracking who is at home but that should not have an effect on the switch!
Here is what i get when i type in prefix, fulltopic, topic in tasmota console!!
The tools that gpbenton and I told you about five days ago.
I use MQTT Box on my PC, and MyMQTT app on my Android phone. There are many more, but these I like. gpbenton is using the Mosquitto command line tool on his Pi. I prefer an app that lets me publish and subscribe in the same program.
Your console responses confirm this:
Topic: cmnd/Tank/power
Payload: OFF
(or ON)