I’m new to Home Assistant and have been trying to get MQTT working. I have a couple of temperature sensors connected to a separate Raspberry Pi publishing temperature readings to a Mosquitto broker on a Synology system (192.168.1.2). I’m trying to get my Home Assistant configured to display/graph the temperature readings but not having any luck.
Here are the relevant sections from configuration.yaml:
I’ve verified that the broker is getting the info but it doesn’t appear to get to HA. The broker doesn’t require a login/password.
This is the Sensor Card Configuration:
type: sensor
entity: sensor.sensor_test
graph: line
name: Test
There are no logbook entries for this Entity. I’ve been searching the forum and other documentation but have not been able to figure out what’s going on.
Found this in the log. It looks like HA is trying to connect to a broker at core-mosquitto with a username homeassistant and a password.
This is strange because my mqtt broker is set to 192.168.1.2 with no username/passwd. Why is it being overridden?
I wonder if this is somehow left over from when I was trying to use the mqtt add on? It has been uninstalled.
2020-05-31 16:06:41 WARNING (MainThread) [homeassistant.components.mqtt] Data in your configuration entry is going to override your configuration.yaml: {‘broker’: ‘core-mosquitto’, ‘discovery’: True, ‘password’: ‘Moh5iogh4joR7oosh2eecheNgei6yiewaezahshoop8shi45eepiih5aeh7oB6si’, ‘port’: 1883, ‘protocol’: ‘3.1.1’, ‘username’: ‘homeassistant’} 2020-05-31 16:06:46 ERROR (MainThread) [homeassistant.components.mqtt] Failed to connect due to exception: [Errno -3] Try again
At this point, it looks like I can’t even connect to the broker, but about the syntax - I’m still learning, but my understanding is that I can specify the sensors by either:
If that syntax is valid, I haven’t seen it before. I would be curious if it is, do you have an example somewhere?
But yes, looks like your main problem is getting the MQTT integration connected to the broker. Maybe you should pick a single installation method, either the UI or by configuration.yaml, but not both.
Huh… looks similar to Style 2 listed in the docs, but it’s not exactly the same.
The error message says you have setup the integration in both configuration.yaml and the UI integration. You should remove one of them, it sounds like you’ve got some left over configuration in one of those that is not correct.
If not then it’s going to try to use that instead of yaml (from the logs) but since the add-on docker container is now gone since you “uninstalled” it there is nothing for the integration to connect to.