Another Update, another issue

I thought my entire comment was helpful. I pointed out everything wrong with your config, and basically, your config is completely wrong.

I pointed out what was wrong expecting you to look at WHY they were wrong. I guess you would prefer to have the answer handed to you rather than you researching to understand how the configuration file works (hint: there is a page in the documentation on it).

Per the documentation.

So you were just randomly throwing things in the configuration and wondering why it was breaking?

Paste your code, highlight it and tap the icon in the picture above. It should format it correctly. This makes it easier to read your code and get you in the right direction.

The yaml code is very particular about spacing, it’s very important to get it right!
Good luck!

Ok apologies if I have offended anyone for posting a image of my config.

Thanks to those who have pointed me in the right direction to where I should learn about how to post correctly. I have read and now understand what you guys need in order to help me. It helps when you know where to look.

After reading francisp’s link I appreciate that this thread has maybe gone ‘off piste’ from its original topic, so please feel free to say if I should start a new one. However, let me try to explain the issues I am experiencing in more detail in line with the advice given. First, the log pasted from configurator in home assistant and formatted as per Corey_Maxim’s advice.

# Configure a default setup of Home Assistant (frontend, api, etc)
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
# base_url: example.duckdns.org:8123
# Text to speech
tts:
  platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml

mqtt:
  broker: 192.168.1.93
  username: name
  password: pass

switch:
  platform: mqtt
  name: "BalconyLights"
  command_topic: "cmd/BalconyLights/power"
  state_topic: "stat/BalconyLights/power"
  qos: 1
  payload_on: "on"
  payload_off: "off"
  retain: true

Next is the comment from configurator stating that there’s a problem;

bad indentation of a mapping entry at line 16, column 13:
password: pass
^

I currently have the following Entities and add ons working correctly.
A Google Audio Cast device
A Sonos Amp
A Sonoff Basic operating via Mosquitto MQTT

All of the above are accessible via the overview and I can access them via the Duck DNS Add on remotely.

However, one ‘Entity’ that cannot be found is a Sonoff Mini. This has been set up with Tasmota (Just like the functioning Sonoff Basic) and has been configured to use the MQTT again, just like the basic.
When reviewing the logs in the MQTT it see’s the IP address of the Mini, and says its connected. Also, looking atthe ‘Console’ of the device in Tasmota, it suggests its connected.
I have added the lines in the config.yaml file thinking that it might help.

Finally, a copy of the Log from the Developers Tools area.

Entity sensor.sonoff_status is incorrectly being triggered for updates while it is disabled. This is a bug in the mqtt integration.

November 7, 2019, 11:01 PM helpers/entity.py (WARNING)

Error loading /config/configuration.yaml: expected ‘’, but found ‘’ in “/config/configuration.yaml”, line 7, column 1

November 7, 2019, 10:52 PM components/hassio/init.py (ERROR) - message first occurred at November 7, 2019, 4:58 PM and shows up 3 times

expected ‘’, but found ‘’ in “/config/configuration.yaml”, line 7, column 1

November 7, 2019, 10:52 PM util/yaml/loader.py (ERROR) - message first occurred at November 7, 2019, 4:58 PM and shows up 3 times

Error handling request

November 7, 2019, 9:35 PM /usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py (ERROR) - message first occurred at November 7, 2019, 9:34 PM and shows up 3 times

Disconnected: Did not receive auth message within 10 seconds

November 7, 2019, 4:59 PM components/websocket_api/http.py (WARNING) - message first occurred at November 7, 2019, 4:59 PM and shows up 3 times

Received message for unregistered webhook e12cef21e6a3a4a1d918906ef88865157b43802c6b6a6ab9ac9793721e8debdd

November 7, 2019, 4:59 PM components/webhook/init.py (WARNING)

Login attempt or request with invalid authentication from 86.128.82.201

November 7, 2019, 4:59 PM components/http/ban.py (WARNING)

Error loading /config/configuration.yaml: expected ‘’, but found ‘’ in “/config/configuration.yaml”, line 3, column 1

November 7, 2019, 3:50 PM components/hassio/init.py (ERROR)

expected ‘’, but found ‘’ in “/config/configuration.yaml”, line 3, column 1

November 7, 2019, 3:50 PM util/yaml/loader.py (ERROR)

Exception occurred:

November 7, 2019, 3:00 PM /usr/local/lib/python3.7/site-packages/zeroconf.py (WARNING)

And if I may also say, I do not expect to be ‘handed’ the answer from any individual on this forum. I merely post in the hope to be pointed in the right direction and engage in conversation on a topic that people share an interest in. This is how we learn. I would hope, that once I reach the point of understanding and knowledge where I can answer other people’s questions, then I will do so with an understanding, that we all have to start somewhere.

Many Thanks once again

It seems like you are using tabs instead of spaces for indention…or you are using some " that are formatted incorrectly. If you copied from a website somewhere, that can cause it. Some websites will format the quotation marks incorrectly.

I’d be willing to bet your password needs to be in quotes. Column 13 is the 13th character in line 16 which is this line

  password: pass

The 13th column is…

  password: pass
            ^
            |
0000000001111
1234567890123

So, put your password in quotes, you probably have special characters in the password that are screwing up the parser.

Thanks once again for the responses.

I ended up finding this; http://www.yamllint.com/ which allowed me to check my code. Here’s what it reported back.

(): found character that cannot start any token while scanning for the next token at line 16 column 13

This made me realise it didn’t like special characters.

The password I posted was not the actual one I am using. And you’re right Petro, I was using a special character (@) in my password. Having removed it, the config is now correct (I have a green tick in the right hand corner).

The downside to this is that this action seems to have made things worse rather than better. I seem to have lost my ‘Entities’.

I have updated the password on both Sonoffs and they appear to be trying to connect to the MQTT

1573287044: New connection from 192.168.1.92 on port 1883.
1573287044: Socket error on client , disconnecting.
1573287051: New connection from 192.168.1.86 on port 1883.
1573287051: Socket error on client , disconnecting.

Clearly its the MQTT thats at fault here. So, I will go away and try to find a solution…Maybe start over? (one step forward, two steps back)

Thanks again

What broker are you using ?

Mosquito, the one from the add on store

You don’t need to remove it, just put that whole string in quotes. Example…

If it was

  password: @foo

change it to

  password: "@foo"

Hi Petro,

I ended up starting again, ie re-flashing the Micro-SD for the Pi and rebuilding.

I’m now back to where I was, The entities seem to be working and the MQTT is connecting with 2 devices (Sonoff’s). However, only one of the Sonoff’s is visible in the Entity registry despite both being set up the same.

I think I’ll go away and do some digging. If I’m still struggling, I’ll start a new thread.

Thankd to all for your help

Make sure they’re both using a different client ID or there will be issues. If they’re both using the same settings that could be your issue.

Hi Flamingm0e,

I checked Client ID and they are different. I have been adding to the config.Yaml File after following this instruction

By copying the example and changing the names where applicable I managed to get the ‘balcony lights’ to appear on the overview page. But initially, this stated it was unavailable. By ammending the file as per below, I can now toggle On & Off. However, nothing actually happens with the Sonoff (ie, it doesn’t actually switch on). Also, when vieweing the MQTT Integrations page, it still does not show.

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
# Example configuration.yaml entry
switch:
  - platform: mqtt
    name: "balconylights"
    state_topic: "home/balconylights/power"
    command_topic: "home/balconylights/power"
    payload_on: "ON"
    payload_off: "OFF"
    state_on: "ON"
    state_off: "OFF"
    optimistic: true
    qos: 0
    retain: true

Here is a view of the overview page

I’m getting closer…and I’m sure I’m just missing something stupid…

I meant to ask…where can I find the config file for the Fish_Tank_Light? If I could see this, then I’d surely be able to copy and adjust the information across?

Are your sonoffs actually publishing and subscribing to these same topics?

You tell us what Fish_Tank_Light is. There isn’t a “config file” for it unless YOU created one. Where did it come from? Is it from an integration or did you manually configure it in your configuration yaml?

The Fish_Tank_Light is a Sonoff Basic which has been flashed with Tasmota.

This should be subscribing to the topic ‘FishTank’
I never created a config file to get this to work. This is running from an Integration, having been automatically picked up when I set up the MQTT

I don’t understand why it never detected the Balcony Light as they were both connected to the MQTT at the time.