I am running a supervised version of HA and also have MQTT running (as add-on) with a mqtt_user_name and mqtt_password defined on the configuration tab. Just for my own interest, I also installed MQTT-Explorer on the host machine and can actually see the topics and payloads for Sonoff and Kasa switch within MQTT-Explorer…life is good till this point!!
Now I am trying to flash the Sonoff motherboard with Tasmota using Tasmotizer, I can flash the device and it connects to Wifi as I can see the Tasmota device under DHCP lease on the router. But when I try to use the MQTT section of the Tasmotizer it does not work. So my question:
Is it possible to access (and post or create topics) the MQTT server (from home network) running on HA machine using this machine’s IP, mqtt_username , mqtt_password, port (=8883)? Just want a sanity check if I am doing it incorrectly or the idea is flawed.
I’m not running Supervised but had a thought … you say you have flashed a Sonoff and see it connected to your router. have you tried accessing the Tasmota Web UI from a browser by entering the address you see on the router (e.g. 192.168.1.x). From here you can configure the MQTT settings of the Sonoff to match those setup for your MQTT add-on. Also if you are not using Tasmota v9.2.0 then remember to go to the Tasmota console and “setoption19 1” to enable discovery by HA.
It sounds like you are new to tasmota. So first a few questions.
Once you flash it and restart the device it will start up broadcasting as an access point. ie. it will broadcast as an access point like tasmota_xxxxxx which usually the last part of the mac address. I used tamotizer to flash, but don’t use it to configure. Instead I connect to the access point and then use a web browser to connect to device and then configure the device through the browser.
I suggest you browse to the ip address that you see on the dhcp lease. You can then see the configuration menu. You can also go the the console and see what the log is telling you. To see more details in the log entry command weblog 4.
Thanks @hughhallhh56 , you suggestion did help me solve it but seems like I was following the steps correctly from serial console but did not realize that the host machine and Sonoff device were on two different subnets…guess I will more careful staking claims about my smartness
While following your steps, I had to go back to pfSense to find the hostname and new IP address and realized that I was chasing my own tail for last few hours.
Thanks for your input and glad I got to the bottom of it!
The IP address running HA/Mosquito is correct, and since port 1883 is disabled in HA so that leaves the choice of 1884, 8883 & 8884. I have tried all three but the console at Tasmota device shows that is tried to connect to HA ip address but fails and it waits 10 seconds then tries again and goes on.
I turned on port 1883 on HA Mosquitto Broker and Tasmota is now posting to MQTT but I have gone from no topics to a flood of topics from a single Tasmota device!!