Hey guys, I seem to be having issues configuring an external MQTT broker on home-assistant 0.76.2 (on hassio rpi3). The broker is running on a server and is accessible from the local network. It’s configured to only allow TLS using a self-signed certificate.
The first issue I have is that I cannot set the root ca certificate in the config YAML. The documentation clearly states I should set the
certificate property (which should be the path of the root ca certificate file). Whenever I configure home-assistant like this:
mqtt: broker: my.broker.tld port: 8883 username: !secret mqtt_username password: !secret mqtt_password certificate: /path/to/ca.crt
It fails to configure the MQTT component (and all dependencies) with the following error:
Invalid config for [mqtt]: not a valid value for dictionary value @ data['mqtt']['certificate']. Got '/path/to/ca.crt'. (See /config/configuration.yaml, line 92). Please check the docs at https://home-assistant.io/components/mqtt/
I couldn’t find any solution for this, so I tried removing the
certificate config and just setting
true. This appears to work at first glance, looking at the logs:
2018-08-31 09:19:05 INFO (MainThread) [homeassistant.setup] Setting up mqtt 2018-08-31 09:19:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=mqtt, service=publish> 2018-08-31 09:19:05 INFO (MainThread) [homeassistant.setup] Setup of domain mqtt took 0.2 seconds. Config directory: /config [Errno 104] Connection reset by peer 2018-08-31 09:19:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=mqtt> 2018-08-31 09:19:05 INFO (Thread-2) [homeassistant.components.mqtt] Successfully reconnected to the MQTT server
But when testing the component by publishing a message to the broker, I’m not receiving anything in subscribers. The logs don’t show any errors:
2018-08-31 09:21:52 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=mqtt, service=publish, service_data=topic=homeassistant/switch/1/on, payload_template=Switch is ON> 2018-08-31 09:21:52 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]>
Home-assistant also doesn’t seem to be receiving any messages (from OwnTracks for instance).
The only odd thing I see in the logs is the very generic and not so informative
[Errno 104] Connection reset by peer message.
I tested the credentials and the access to the topic using a different client, and all is working there. What am I missing?