Another Update, another issue

I’m hoping someone might be able to shed a little light on this issue for me.

After logging in to my Home Assistant on my PC, I was prompted to update to the latest version (I never noted down the version numbers). This then proceeded to update my Pi with the latest HA version and reboot my PI.

However, once rebooted, I no longer have access to my HA client via MQTT or direct to its IP address. I also cannot access the file system from the Samba Share Add On I had running.

I am now at a loss as to how to get around this. Interestingly, I have experienced an issue similar to this before, and the only way to get out of it was to reflash my PI and start over. I could do this again without too much grief as I only have 1 switch and 2 x media devices connected but I would rather understand whats going on so that as I add more devices and automations, I don’t lose it everytime I update the program.

Thanks in advance for your advice

What are you using? Hassio, hassbian, venv? Ya gotta give details…

Hi Petro,

Apologies, My Rasberry Pi 3 was (is?) running Hassio. This was installed by following the ‘getting started’ guide on the Home Assistant site.

Not sure what other info would be helpful so feel free just to ask and I’ll do my best to answer.

Thanks

Did your pi get a new IP address perhaps? Check with your router. And if it did, you might consider giving it a fixed IP address.

Is it possible the pi hasn’t rebooted correctly after the update and you need to pull the power cable? Although this is something to watch out for with a pi and microsd cards as it can sometimes cause corruption.

And although this is no good to you at this present moment, there is now a hassio add on for backing up your config to Google drive on a schedule, it’s very easy to use and let’s you easily restore an older version or recent backup of hassio if you suffer corruption or a wonky update to a new hassio version.

That’s a good point.

If you are using hassio, then samba should be working even if HA is not. Updating HA shouldn’t change HassOS. Did you give it enough time to fully perform the update?

Thanks for the responses guys, its really appreciated.

IP address is fixed and I can see it when I run IP Scanner. So, its definitely connected to the network, and is on the correct IP Address.

I have tried pulling the power cable to force a reboot, but no joy.

I’ve just tried accessing Samba again and realised I had been typing //Hassio rather than \Hassio So, now I can see the file system. Where should I look for any issues?

Thanks again

Just FYI, this is always a bad idea,

I have tried pulling the power cable to force a reboot, but no joy.

look in the logs. home-assistant.log or something like that.

Hi Petro, I found the log and here’s what it says;

2019-11-06 18:47:21 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=10 from 2019-11-04 19:07:11.380440)
2019-11-06 18:47:26 ERROR (MainThread) [homeassistant.config] Invalid config for [mqtt]: [Platform] is an invalid option for [mqtt]. Check: mqtt->mqtt->Platform. (See /config/configuration.yaml, line 1). Please check the docs at https://home-assistant.io/integrations/mqtt/
2019-11-06 18:47:26 ERROR (MainThread) [homeassistant.setup] Setup failed for mqtt: Invalid config.
2019-11-06 19:50:52 WARNING (zeroconf-ServiceBrowser__googlecast._tcp.local.) [zeroconf] Exception occurred:
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/zeroconf.py”, line 2245, in send
bytes_sent = s.sendto(packet, 0, (addr, port))
PermissionError: [Errno 1] Operation not permitted
2019-11-07 02:04:29 WARNING (Thread-12) [pychromecast.socket_client] [Master bedroom speaker:8009] Heartbeat timeout, resetting connection

So, it looks like there’s something wrong with the MQTT setup. But this shouldn’t stop me from accessing Home Assistant should it?

tom_1 Why do you say its a bad idea to pull the power to do a hard reset and what would be the alternative if I can’t access Home Assistant? (As you can probably tell, I’m pretty new to this so am keen to get as much info as possible).

Thanks again

Post your configuration.yaml. There seems to be something wrong with your mqtt config.

I would totally agree … But when faced with a completely locked system ; even ssh non responsive… You sometimes have no choice
(I’ve had to do this twice, expecting to have to rebuild and restore, but miraculously, I escaped disaster. I still wouldn’t recommend it though).

These errors are pointing you to the issue. Check out the docs. Compare your configuration to the docs and examples.

Exactly this happened to me almost a year ago. I know your pain. I didn’t find a solution as I didn’t have the SSH and Samba addons enabled. There just wasn’t a way to get in.

My “solution” was to start over and run Hass.io on a Virtualbox VM. Now, I’m making a clone before I do an update, so it’s easy to get back to an earlier version in case I get problems (which happened once since then). I hope you’ll find a way to get in. If not, I recommend you to choose for the same setup.

A bad config will definitely stop HA from starting up.

Ok, So I decided to bite the bullet and start over.

I have managed to pretty much get back to where I was without too much grief. However, I’m a little concerned that I am (and have been) missing something that is causing this issue to occur. So, if you don’t mind, I’ll share my config data;

group.all_switches

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: password

Switch:
Platform: mqtt
Name: “Balcony_Lights”
Command_Topic: “cmd/Balcony_Lights/power”
State_topic: “stat/Balcony_Lights/Power”
qos: 1
Payload_on: “ON”
Payload_off: “OFF”
retain: true

Now, I know there has to be something I’m missing here because I’ve added a sonoff basic which is working fine ie I can control it in Home Assistant via the MQTT and have setup the DNS to access it remotely. However, this is not the ‘Balcony Lights’ that is listed in the config.yaml.

Looking at the MQTT log, it appears to have connected to both devices;
(192.168.1.92 is the switch that is working whereas 192.168.1.86 isn’t)

1573139176: New client connected from 192.168.1.92 as DVES_068CAF (p2, c1, k30, u’Ydraiggoch’).
1573139656: Saving in-memory database to /data/mosquitto.db.
1573139876: New connection from 192.168.1.86 on port 1883.
[INFO] found Ydraiggoch on Home Assistant
1573139877: New client connected from 192.168.1.86 as DVES_A76427 (p2, c1, k30, u’Ydraiggoch’).
1573139878: Client DVES_A76427 disconnected.
1573139886: New connection from 192.168.1.86 on port 1883.
1573139886: New client connected from 192.168.1.86 as DVES_A76427 (p2, c1, k30, u’Ydraiggoch’).
1573140005: Client DVES_A76427 disconnected.
1573140014: New connection from 192.168.1.86 on port 1883.
1573140014: New client connected from 192.168.1.86 as DVES_A76427 (p2, c1, k30, u’Ydraiggoch’).
1573141457: Saving in-memory database to /data/mosquitto.db.
1573141616: Client DVES_A76427 disconnected.
1573141624: New connection from 192.168.1.86 on port 1883.
[INFO] found Ydraiggoch on Home Assistant
1573141626: New client connected from 192.168.1.86 as DVES_A76427 (p2, c1, k30, u’Ydraiggoch’).
1573143258: Saving in-memory database to /data/mosquitto.db.
1573145059: Saving in-memory database to /data/mosquitto.db.
1573146860: Saving in-memory database to /data/mosquitto.db.

The 192.168.1.86 cannot be found via integrations either?

I have a feeling that I may be missing something when following the setup instructions on the add ons. I am following them to the letter, but at no point does it tell me to add to the config.yaml file. But I get the feeling I should be.

Thanks and apologies for the ramblings

Ok, just found a fault which may or may not be a problem with my config.yaml file

The error says

I’ve read that this can be due to a space being where it shouldn’t, but have tried numerous amendments but to no avail.

Thanks

Your Switch: line is indented incorrectly, capitalized when it shouldn’t be and you’re capitalizing lots of words you shouldn’t.

Your config is just plain bad.

Your tts config is indented incorrectly on the platform line.

What is group.all_switches? You can’t define it like that.

Hi flamingm0e, I appreciate your response, although its not entirely helpful. You point out the issues you see but offer no guidance on who to rectify them.

Not helpful

How should I be indenting the lines?
I have removed all the uppercase characters under the switch topic with the exception of the username & password.
I am not sure what the ‘group.all_switches’ was for…I have removed it.

May be start with reading this topic :
https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371/4

Then we can modify what you wrote with the correct indentation.

You got a poor response because you didn’t actually post the code correctly. No one is going to help you based on an image of your config. Post code as text so people can copy, modify, and paste. Otherwise you’ll get responses that tell you all the errors without the fixes. He pretty much summed up everything that is wrong with your config but you’re upset because he said your config is bad. Do everyone a favor and help us help you. Please follow the link in @francisp response. It tells you the guidelines to make a post that people will be able to help from. Specifically follow step 11, which shows you how to properly format code.