I started using the MQTT Server and Webclient addon (HA is running on HassOS) but i am running into some issues as HA is not able to connect to the MQTT server and no mqtt sensor are showing up anymore while the nodered addon can connect, receive and send messages without any problems.
Here is the error shown in the log:
2018-10-22 15:31:56 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 352, in _async_add_entity
await entity.async_added_to_hass()
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/mqtt.py", line 173, in async_added_to_hass
message_received, self._qos)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 280, in async_subscribe
topic, msg_callback, qos, encoding)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 662, in async_subscribe
await self._async_perform_subscription(topic, qos)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 697, in _async_perform_subscription
_raise_on_error(result)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 782, in _raise_on_error
'Error talking to MQTT: {}'.format(mqtt.error_string(result_code)))
homeassistant.exceptions.HomeAssistantError: Error talking to MQTT: The client is not currently connected.
I guess this message is appearing as HA tries to connect to the MQTT broker while its not yet started but i am not sure.
My config is as follows:
mqtt:
broker: hassio.local
port: 4883
client_id: ha_mqtt
username: !secret mqtt_broker_username2
password: !secret mqtt_broker_password2
certificate: /ssl/certificate.pem
A sensor for example:
- platform: mqtt
name: floortemp
unit_of_measurement: '°C'
state_topic: "home/floor/floortemp"
I have had another MQTT broker running on another server and the sensors were working fine…
Any ideas what this could be about ?