MQTT Configuration Problem

I am new Home Assistant. I was using Domoticz successfully in my house but moved to HA primarily for Wink integration.

I’m using the MQTT add-on along with Tasmota Sonoff Switches. The MQTT log shows the devices logging into the MQTT server. In fact, I can use the developer tool to send topics to the switch and turn it on and off.

I figure it is something simple, but have not been able to find the answer in these forums or other online resources.

here is my mqtt and switch portion of my config yaml

Screenshot_062618_075551_AM

**I’m new user and limited to one picture per post. I can provide other logs if required.

What topic and payload do you use to do this?

cmnd/SonoffDev1/Power

with a payload of (on or off).

The command topic is case sensitive, so it should be

comand_topic: "cmnd/SonoffDev1/Power"

I changed POWER to Power in my Yaml. Still not working.

Then the easiest way to see the discrepancy between the working and non-working command is to subscribe to all topics and then see what is printed out when you send the working version. Make sure that matches what is sent (case sensitive) when you press the switch on the UI.

How do I see the messages sent from HA? The switches console does resister it. On a manual send I do see it.

Here are the results from manual publishes from the mqtt tool.

when toggling the button on the overview does not result in any console entries at my switch.

The normal method is to use a client to subscribe to the topic. I like to use mosquitto_sub - just because it is always available to me. From the command line

$ mosquitto_sub -t '#' -v 

displays all messages sent to the broker. A little more info here

Try using other quotation marks.

1 Like

what he ^ said…

if you look at the styles of the quotation marks in the command and state topics that don’t work they look different.

I have my MQTT switches working now.

This morning I did a couple of things.

First I reset the topics of the switches to the fallback device name “DVES_xxxx”. I also changed the password for the MQTT broker. It originally had a special character in it. Once I made those changes, I could only send “on” messages. Looking a little more closely at the stat topic at the switch, I realized this was being sent as “POWER1” and not “POWER”.

Small change in the Yaml and everything is working.

Thanks for the help @gpbenton and @doubleUS

1 Like