I have tons of MQTT devices (~50) specified in my switches.yaml, etc. files and the only things that show up in the Configuration -> Integrations -> MQTT are the discovered devices.
None of my manually set devices show up there since they already have a configured status in those yaml files.
Might just need some clarifying in the docs to avoid the confusion.
What confuses me is nothing in the discovery docs remotely maps to my state or command topics… I was just thinking I should go with the flow and switch to the integration instead of manual config
Looking at your sample config above, these devices wouldn’t get discovered. They have to start with “homeassistant” or whatever you set as the Discovery Prefix.
Honestly, the only thing I see the MQTT Integration button is good for is for simplistic integrations and an “easier” way to input your MQTT credentials into.
and see what the integration discovers and go from there. My switches are just simple switches so the integration would be perfect as long as I can get away with not screwing with the settings in Tasmota…
If you don’t want to use MQTT Discovery You have to add unique_id to your configuration. unique_id must be unique. It’s best to use the MAC address of the device (without : char). Such configured device is added to the entity registry, so you can edit the entity name and friendly name from the frontend.
FWIW, the home automation software I’ve being using for the past decade (Premise Home Control) automatically assigns a Globally Unique Identifier (GUID) to every device (also known as Universally Unique Identifier - UUID).
Now that Home Assistant is evolving in the same direction, if you need identifiers for existing devices, you can use Online GUID Generator to crank them out for you. Alternately, you can use a python script to produce GUID/UUID.
I’m using Home Assistant as a frontend for Premise; the two communicate via MQTT. Every MQTT Light, Switch, etc in Home Assistant gets a unique_id that is assigned the same GUID used in Premise. A typical entry for a light looks like this:
Home Assistant detects the unique_id and adds the light to config/.storage/core.entity_registry. However, I haven’t figured out why “name” isn’t populated:
Thanks for that - my switches are working fine without the unique_id - I guess a benefit of adding that would be that the entity registry would know about them? Any real reason I need to add this?
I’d be happy to use discovery if I didn’t think it was just going to break everything for no gain and cause me to have to edit stuff in Tasmota as well - and all for nothing.
i have the same MQTT configuration like [DavidFW1960] and i run 0.87 version of HA. i put unique_id on some devices but i can’t see them in Integrations -> MQTT:configurations.yaml. Anyway i see the devices with unique_id in Entity Registry. Any ideas what i’m doing wrong?
I use autodiscovery and just tried updating to .88.0 from .87.1 All of my Tasmota MQTT Sonoffs were incorrectly assigned to their ids after restarting. I am thinking it has something to do with autodiscovery and the two broken “unused entity” old sonoffs that are no longer alive. I was able to roll back to .87.1 and everything went back to normal. I saw no notes that this might break in the release notes. I wonder what broke this?
I use MQTT discovery with the Hass.io core Mosquitto Broker and the MQTT Integration. I have nothing to configure MQTT in my config yaml and no manually defined switches. All my MQTT/Sonoff devices are working perfectly with 0.88.0
There is a new requirement/validation for everything so if you are manually configuring switches, some of the old options are now invalid. Did you check the log to see what might be causing the problems?
@DavidFW1960 I just updated Home Assistant and my MQTT switches and sensors all stopped working. I added the validation between MQTT and Home Assistant (added a new user for mqtt), hopefully successfully as the MQTT add-on log indicates that I have connection(s), to the devices at least… however none of my devices are showing up in Home assistant. I believe I followed the instructions on the help page carefully/ correctly, but still on luck. Would you be willing to share your config settings, minus the passwords of course. If they are just as above, then I don’t know what I am missing.
I don’t have any config settings to share becsause there is no mqtt section in config yaml. The broker is default settings. When I added the MQTT integration I enabled discovery. I am using a home assistant user for the mqtt username and password. You do need to enable discovery on the devices themselves. In Tasmota, setoption19 on in the console. Then they should just pop up. But the MQTT settings on the device need to be configured with the home assistant username and password or you can define a local user in the broker.
I am not using Tasmoto, I wrote my own code using Mongoose OS. Does the device requires a home assistant user or local user as well? I was hoping that if I set “anonymous” to true in the add-on I would not need to do that. I do not have OTA updates enabled, so would have to pull all my devices apart… just loaded MQTT Dash on an Android tablet, and I can connect to the MQTT server, and get the values (temperatures) from the devices. So that part is working, the values are just not getting into Home Assistant! And was just able to send commands to a switch via MQTT Dash via the MQTT server.
You can still use Anonymous login in MQTT but it would be better to set a user.
I have 3 users setup. Switches, sensors and lights. All my sensors use the sensors user, all lights the lights use and switches the switches user. They work as shared accounts. I don’t have any MQTT users setup as such, I just use Home Assistant user accounts. They just work.
You don’t have to use MQTT discovery. Discovery sets a retained message on the discovery topic with the settings for the devices, but you can still define MQTT devices manually in YAML files. See the MQTT documentation for how that is set up.
MQTT devices using discovery will not show in integrations at this stage as it is set using a MQTT retained message to the discovery topic rather than being an actual integration. That’s why you can’t find it anywhere in any files if you use discovery.