I’m running Hass.io 0.9.6.2 trying to get a sonoff basic with tasmota 6.5.0 switch to integrate. It looks like the broker is working, and it looks like the sonoff connects to the broker. There are no devices in the integrations, and the Switch.Sonoff is “Unavailable” on the UI.
[12:05:44] INFO: Setup mosquitto configuration
[12:05:44] WARNING: SSL not enabled - No valid certs found!
[12:05:44] INFO: No local user available
[12:05:45] INFO: Initialize Hass.io Add-on services
[12:05:45] INFO: Initialize Home Assistant discovery
[12:05:45] INFO: Start Mosquitto daemon
1563732345: Loading config file /share/mosquitto/acl.conf
1563732345: mosquitto version 1.6.3 starting
1563732345: Config loaded from /etc/mosquitto.conf.
1563732345: Loading plugin: /usr/share/mosquitto/auth-plug.so
1563732345: ├── Username/password checking enabled.
1563732345: ├── TLS-PSK checking enabled.
1563732345: |-- *** auth-plug: startup
1563732345: └── Extended authentication not enabled.
1563732345: Opening ipv4 listen socket on port 1883.
1563732345: Opening ipv6 listen socket on port 1883.
1563732345: Opening websockets listen socket on port 1884.
1563732345: Warning: Mosquitto should not be run as root/administrator.
1563732346: New connection from 192.168.1.6 on port 1883.
[INFO] found merlin on Home Assistant
1563732348: New client connected from 192.168.1.6 as auto-DEDC01E3-A51B-597E-284286BD68CC (p2, c1, k60, u'merlin').
1563732348: New connection from 192.168.1.6 on port 1883.
1563732348: New connection from 192.168.1.6 on port 1883.
1563732348: Socket error on client <unknown>, disconnecting.
1563732348: New client connected from 192.168.1.6 as auto-61E81DB7-8CC0-420E-661B-EB2C30EE5F0A (p2, c1, k60, u'merlin').
1563732348: New connection from 192.168.1.14 on port 1883.
[INFO] found mosquito on Home Assistant
1563732350: New client connected from 192.168.1.14 as DVES_C7BFF8 (p2, c1, k10, u'mosquito').
1563734145: Saving in-memory database to /data/mosquitto.db.
1563735946: Saving in-memory database to /data/mosquitto.db.
192.168,1.14 is the tasmota.
192.168,1.6 is Home Assistant.
The Integration for MQTT was added using discovery, so there aren’t many options there.
I am specifying it manually, but it doesn’t work by not specifying it either. Option19 is set on the tasmota console.
What get when I remove the yaml is no switch on the UI (understandable), no integrations listed, no discovery notifications, yet the broker and Tasmota logs show everything is connected.
Something I don’t quite understand is the topic of MQTT. Is there no topic setup needed on HA or the broker ad-in?
MQTT Host 192.168.1.6
MQTT Port 1883
MQTT User mosquito
MQTT Client DVES_xxxxx
MQTT Topic sonoff
MQTT Group Topic sonoffs
MQTT Full Topic sonoff/cmnd/
MQTT Fallback Topic cmnd/DVES_xxxxxx_fb/
If you do it manually then you specify the topic in the switch configuration yaml - double check that, it is case sensitive.
The broker just records the topics and messages sent to it and publishes to clients (like HA) that subscribe to the topics, so no, no configuration for the topic required there.
Yeah, I had trouble with this too but as I had a working manual config I didn’t look too closely into why. Many others have it working fine though.
It does look like you are using fancy double quotes in your config. This ” as opposed to this " which is what should be used. Could just be a copy paste formatting thing though. Check it in your yaml.
You can use a client on your PC like “mqtt explorer” to see what the actual topics on the broker are and
a) make sure they are there
b) make sure what you have in your switch config is correct.
I don’t know how to use any other quote key. I tried retyping the yaml quotes, changing the topic to use the fallback (DVES_C7BFF8_fb), copying the yaml from the link you sent and changing the topics around a few times, but doesn’t work after a restart: Still shows the entity state as Unavailable.
Hmmm, with MQTT Explorer I connect to my broker, and only one thing pops up: tele/sonoff/LWT = Offline. Does that mean I have the explorer configured wrong, or is there a tasmota problem?
1563803672: Socket error on client DVES_C7BFF8, disconnecting.
1563803698: New connection from 192.168.1.14 on port 1883.
[INFO] found mosquito on Home Assistant
1563803699: New client connected from 192.168.1.14 as DVES_C7BFF8 (p2, c1, k30, u'mosquito').
1563803702: Client DVES_C7BFF8 disconnected.
1563803723: New connection from 192.168.1.14 on port 1883.
1563803723: New client connected from 192.168.1.14 as DVES_C7BFF8 (p2, c1, k30, u'mosquito').
Tom, It does looks like the topic and prefix are backwards. I swear I haven’t chaged this from default because I have no idea what it means. However, looking at the default tasmota and the default configuration from the HA setup page, they match. Why do you think its backwards?
Thanks for your help guys. It’s still not working though. Now the broker is not reporting a connection to the Sonoff IP. I need to just start over again.