Always use three back ticks around the configuration code to preserve spacing. Yaml is very picky about indentation, wrong spacing is the most common error.
I suggest you put your mqtt broker definitions back in configuration.yaml until everything is working. Make sure that works first by doing a mosquitto_pub of a test topic/message and making sure you can see the result with a mosquitto_sub in a different window.
And then check your spacing in switch.yaml, which still appears to be wrong
after reboot, system hass it is no longer visible from the browser: my log:
2018-01-29 08:34:50 ERROR (SyncWorker_0) [homeassistant.util.yaml] while parsing a block collection
in "/config/switch.yaml", line 1, column 1
expected <block end>, but found '<block sequence start>'
in "/config/switch.yaml", line 14, column 2
2018-01-29 08:34:50 ERROR (MainThread) [homeassistant.bootstrap] Error loading /config/configuration.yaml: while parsing a block collection
in "/config/switch.yaml", line 1, column 1
expected <block end>, but found '<block sequence start>'
in "/config/switch.yaml", line 14, column 2
if you put mqtt: !include mqtt.yaml in your config you must not repeat mqtt:inside the file
the following lines are indented only one space. Indentation is always two spaces.
I never put dictionaries in external files, so I’m not sure if the lines Broker, port, username, password should be indented or not. In doubt keep them in the main file
The switch.yaml seems correct, sometimes an error in one configuration propagate to other config due to parsing problems. Try as @piansom suggested, make the broker work first, then switches.
2018-01-29 13:47:52 ERROR (MainThread) [homeassistant.setup] Error during setup of component mqtt
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 196, in _async_setup_component
result = yield from component.async_setup(hass, processed_config)
File "/usr/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 399, in async_setup
success = yield from hass.data[DATA_MQTT].async_connect()
File "/usr/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 506, in async_connect
self._mqttc.connect, self.broker, self.port, self.keepalive)
File "/usr/lib/python3.6/asyncio/futures.py", line 332, in iter
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
future.result()
File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/lib/python3.6/site-packages/paho/mqtt/client.py", line 768, in connect
return self.reconnect()
File "/usr/lib/python3.6/site-packages/paho/mqtt/client.py", line 895, in reconnect
sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0))
File "/usr/lib/python3.6/socket.py", line 724, in create_connection
raise err
File "/usr/lib/python3.6/socket.py", line 713, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
2018-01-29 13:48:06 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=84 from 2018-01-29 12:46:14.253106)
2018-01-29 13:48:08 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of switch.mqtt. Setup failed for dependencies: mqtt
2018-01-29 13:48:09 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform switch.mqtt: Could not setup all dependencies.
2018-01-29 13:48:09 ERROR (MainThread) [homeassistant.components.device_tracker] Unable to load /config/known_devices.yaml: Config file not found: /config/known_devices.yaml
Do you have a standalone MQTT broker? Mosquitto? Managed to connect to it with a different client with same user and password? I use MQTT Spy (Downloads · eclipse/paho.mqtt-spy Wiki · GitHub).
Give up, he doesn’t listen and obviously thought he knew best right from the start by not using any of the dozens of easy to follow, cut and pasteable, tutorials that tell you how to do this!
Hi, I followed all the tutorials.
I am sorry that I take myself for an idiot.
in any case, I will start from scratch to understand what happens.
I will follow all the advice.
thank you