Error Message MQTT

any idea what this error message is?

    The following errors have been logged this session:

17-04-21 02:49:53 ERROR (MainThread) [homeassistant.setup] Error during setup of component mqtt
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/setup.py", line 189, in _async_setup_component
    result = yield from component.async_setup(hass, processed_config)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 363, in async_setup
    success = yield from hass.data[DATA_MQTT].async_connect()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 473, in async_connect
    None, self._mqttc.connect, self.broker, self.port, self.keepalive)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/JK/.homeassistant/deps/paho/mqtt/client.py", line 704, in connect
    return self.reconnect()
  File "/Users/JK/.homeassistant/deps/paho/mqtt/client.py", line 826, in reconnect
    sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 722, in create_connection
    raise err
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 713, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused
17-04-21 02:49:53 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of switch.mqtt. Setup failed for dependencies: mqtt
17-04-21 02:49:53 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform switch.mqtt: Could not setup all dependencies.
17-04-21 02:50:03 WARNING (MainThread) [homeassistant.setup] Setup of sensor is taking over 10 seconds.
17-04-21 02:50:03 WARNING (MainThread) [homeassistant.components.sensor] Setup of platform yr is taking over 10 seconds.
17-04-21 02:50:03 WARNING (MainThread) [homeassistant.components.sensor.yr] Retrying in 15 minutes:

It looks like your HA could not connect to your mqtt broker. Maybe authentication problems?

gl

Where so do start? The following is what I copied to configuration.yaml

mqtt:
  broker: localhost
  port: 1883
  client_id: home-assistant-1
  keepalive: 60
  username: homeassistant
  password: homeassistant
  protocol: 3.1.1

switch:
  - platform: mqtt
    name: "Sonoff power"
    state_topic: "stat/sonoff/POWER"
    command_topic: "cmnd/sonoff/POWER"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    retain: true

Use the embedded broker.

Check your broker is running and has a matching config. Are your sonoffs connecting to it?

I do not understand. WHen using

mqtt:
  broker: localhost
  port: 1883
  client_id: home-assistant-1
  keepalive: 60
  username: homeassistant
  password: homeassistant

is it the embedded or not? If not, to use the embedded what to do???

Take a look at the extensive documentation about MQTT.

ok I just put mqtt:

now I have this error

17-04-28 16:33:15 WARNING (MainThread) [homeassistant.setup] Setup of mqtt is taking over 10 seconds.
17-04-28 16:33:39 ERROR (MainThread) [hbmqtt.broker] Broker startup failed: [Errno 98] error while attempting to bind on address (‘0.0.0.0’, 1883): address already in use
17-04-28 16:33:39 ERROR (MainThread) [homeassistant.components.mqtt.server] Error initializing MQTT server

this is absolutely unclear to me

http://hbmqtt.readthedocs.io/en/latest/references/broker.html#broker-configuration

Our mosquito or other MQTT daemon instance is probably still running on 1883.

probably mosquitto.

My goal is to use a mqtt with ssl/tls, if not possible with mosquitto, then I am fine with the embedded, but how do I stop mosquitto from running on boot.

Or
how to install ssl/tls for mosquitto?

Ok, so I finally managed to stop mosquitto and using only embedded.

Now hoe to access embedded from outside my networtk? I have letsencrypt

You’ll need to ensure you configure TLS as detailed here. You can also configure Mosquitto to use TLS, and if you want to use Owntracks then you can’t use the embedded broker.

To access either from outside your network, forward port 1883, or your chosen port, to 1883 on your HA server. Ensure that you’ve configured an appropriate username and password for authentication.

The approach I used was to use a CloudMQTT instance, and set up a bridge from my local Mosquitto instance to it, following this guide. That allows me to run a local MQTT instance for use within my network, and still use OwnTracks or any remote MQTT client.

not interested in owntracks, will use zanzito (better)

I do not understand those instruction, I need to crrate a file? Which name? WHere to store it?

this I did since I use letsencrypt. I can access HASS from outside my network using https://myname.duckdns.org