Ok, I am officially in a deadlock, need help!

Sad story: I’ve been runnin a supervised HA installation on a dedicated x86 Ubuntu server.

As you can imagine, it was falling apart slowly but steadily, as this configuration became unsupported.

I finally decided to pull the trigger, and reinstalled everything in a Proxmox VM. The HA is up and running, but them I probably made a big mistake restoring one of my older backups from the X86 Supervised era.

And while it kind of restored - my HA is all over the place. 80% of my automations don;t work, half of my Mi Home devices are missng/not available, while the other half is still there. I am having issues everywhere (can’t create new automations, have two dashboards etc etc.).

So… unless someone knows a way to still repair anything, I am prepared to wipe everything off and start from scratch.

Any ideas? Can I “reset” the HA server without re-doing the entire VM thing?

It’s very easy and fast to deploy a fresh VM using this https://community-scripts.org/scripts/haos-vm?id=haos-vm

I believe you can reset HA by deleting the entire contents of the /config folder (or renaming the folder) and restarting. That is supposed to take you back to the original welcome and onboarding screen at http://homeassistant.local:8123

Yes, but then it will involve the entire work to re-discover all my devices (especially those integrated via Mi Home), with all the tokens etc. , re-do all automations, areas etc… I know, I know, I asked myself ))) But I was hoping there’s a magic “fix it all” button or script somewhere)))

BTW, my biggest problem now is I can’t re-login into my Mi Home account from within the HA. For some weird reason, I have about 10% of my Mi Home devices exposed in HA, and the rest is gone… Like, I have 4 identical light bulbs, of which one is visible and controllable from within HA, and the other three are not))) THey’re all visible in Mi Home. Go figure…

Hm, that’s an interesting suggestion… Sorry if this is a stupid question, but do I do it from ProxMox or from within HA VM itself?

Shutdown the VM you have created already and toggle off autostart in the proxmox ui. Then create a new VM using the script linked above. Then on the onboarding page restore your backup.

This will allow you to keep what you have done in the first VM if you need or want to go back to it.

The backups only restore the config folder so it does not matter what hardware you installed HA on.

Hm. Then it means my problem is elsewhere, because a restored backup resulted in half-broken smart home.

At present, I cannot create a single automation: I am always getting "Your automation cannot be created because somehting cannot parse your configuration.yaml. Although all tests are passed in Tools…

how does your configuration.yaml look like?

If you don’t already have it you can install the Samba integration, and once that’s running you can browse to the //haserver ip and see the shared folders, which include /config.

I’ve never done this myself, and I would have thought that there are some in-use files in there that may not let you delete them if HA is running. I’ve seen other posts that mention just deleting configuration.yaml and the hidden .storage directory.

This may be the best way - but if that still causes problems try this: After you have a new, blank Homeassistant up and running, don’t restore an entire old backup. Try just restoring all of the Apps first and see if everything looks stable. None of your older devices and automations will be there, but at least you’ll know if the OS and Core are stable. Try creating an automation and confirm that you only have one dashboard. If that works, make a new backup to save everything to that point, and then try restoring from backup the “Settings and History” and “SSL Certificates”. Maybe someone with knowledge of the differences between HAOS and the Supervised method can advise how to migrate your devices and settings without causing corruption.

How old is the backup you’re trying to restore from?

Fix the missing entities first. Then likely your automations will work.

Apparently, it looks bad if nothing works properly )))

Here’s what’s in there (I removed all the # tagged lines, just the actual strings)

homeassistant:
 name: name

automation: !include automations.yaml

lovelace:
 resource_mode: yaml
 dashboards:
  lovelace:
   mode: yaml
   filename: ui-lovelace.yaml
   title: Overview
   icon: mdi:view-dashboard
   show_in_sidebar: true


default_config:


tts:
  - platform: google_translate

Try the following:

homeassistant:
 #name: name  <-- Remove this. It has a bad indentation

automation: !include automations.yaml

default_config:

tts:
  - platform: google_translate

#Add These
group: !include groups.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
light: !include devices/lights.yaml
sensor: !include sensors.yaml
binary_sensor: !include binary_sensors.yaml
mqtt: !include mqttsensors.yaml

frontend:


#Remove all the below
#lovelace:
# resource_mode: yaml
# dashboards:
#  lovelace:
#   mode: yaml
#   filename: ui-lovelace.yaml
#   title: Overview
#   icon: mdi:view-dashboard
#   show_in_sidebar: true

Will try. But then do I need to create/fix/update all of those referenced YAMLs?

No, something is wrong. Now I can’t even restart it - it cannot find the referenced YAMLs.

Depends if you have them already created or not. If you do, then yes. If you don’t, then just fix the second line. Either remove the rest, or update the path if you have existing yaml files for some of them.

I just gave you my config which has been working stably for years.

PS - my light: !include devices/lights.yaml is a custom path, so change that to light: !include lights.yaml since yours probably won’t match.

I tried pointing the configuration.yaml to one of those files (light.yaml), hoping it will help to clear the mess with some of my Mi Home light bulbs. I have a few Philips Zhirui E27 bulbs, and they behave VERY weiredly: some of them are visible in HA, and some are not. I double-checked: they all are visible in Mi Home, I double-checked tokens and IPs - all is great.

I can operate all of these lights from Mi Home app, but inside HA some of them are exposed via the integration in Unavailable state… Go figure) HA is fun)

On the positive side, I think I found the way to bring back my Zigbee switches. I had to remove and re-add some of them (especially the round Aqara buttons) for them to be usable in automations.

Here it’s a bit more consitend: all of my Aqara round buttons required this. Still strange: they repair with the same device ID. Maybe, some other parameters in Zigbee network are different.

Long story short: I calmed down a bit, and decided not to swing the axe too much))). I will try to save the existing config, step by step, and see where I get.

Thank you all for your comments!

Battery zigbee devices (like the round Aqara buttons you mention) need between 6-25h to check in, depending on which zigbee integration you’re using. You should be able to bring them back by short-pressing the buttons on them without needing to re-pair them.
The same might be true for your Mi Home devices - they either need some time to announce themselves, or else you might need to press a button on them or reload the integration.

Just give your network 24h to stabilise, then post back.

Will do. The single press trick didn’t work. I clicked and reclicked them all before re-pairing - no good, for some reason.

Anyway, crawling back little by little.

OK, dust has settled down a bit, and here’s the current state of things:

  1. My Zigbee devices are all back, but with some caveats. All of these caveats are related to Xiaomi/Aqara devices.

Problem 1. My dual-rocker zigbee Aqara switches only expose Left Single, Right Single and Both Single actions. In the previous life )))), they exposed Hold actions for left, right and both. Did anyone run into a similar problem? What does it depend on? At the same time, my single round buttons all expose all imaginable actions (single/double/triple/quad/many/hold/release). My 6-button Aqara Opple switches (by far the best ever made imo) also expose all of their expected actions.

ignore this part, I think I know where the problem could be - I could’ve confused two Aqara switches that I have, one is v1 that only exposes 3 actions, the other is v2, that exposes much more. Will double-check.

Problem 2: one of my Sonoff Zigbee relays decided that it wants to join the network via the most remotely located Mi plug. As the result, the LQI is between 0 and 5 ))) And I can’t find the way to tell this stupid thing to connect to other coordinators that have much better link quality. In the Z2MQTT map this relay is connected to two nodes, one with great link and the other with this weak LQI. For some reason, the reported link quality is the worst one, and the behavior confirms it: sometimes it takes qiute a while to react to a switch command. Any ideas on how to fix it? Unpairing/repairing may help? Or is there a way to manually point the link?

  1. I am still stuck with my Mi Home integration. The logic escapes me.
  • I can see ALL of my Mi Home devices in the Mi Home app on my Android: Mi DGNWG02LM Gateway (the one with an RGB LED Ring around it, Z2MQTT model lumi.gate.v3), four e27 Philips ZhiRui white bulbs, four E14 Philips ZhiRui Candle bulbs, and two Mi Smart Plugs (zigbee models). Of those I can see in my HA: the gate, two out of four e27 bulbs and both power sockets. I can’t see any of the e14 bulbs and for some weird reason two of the 4 e27 bulbs.

I double-checked the tokens via the Mi Home app, they all match what was there in the “previous life” (I know that because I have a light.yaml file with all IPs and tokens for bulbs).

And, of course, as we all know, I can’t re-authenticate my Mi Home account. The “advanced” way via the gateway IP and token does not work neither - it authenticates fine, but it does not add any of the missing devices into HA.

Any suggestions would be hightly appreciated! In fact, if I am able to revive my Mi Home devices, I’d be perfectly happy with the way my HA home is right now, I will manually re-do all the automations and do some further polishing of the dashboard, but the Mi Home bug is really a bummer…
Thank you in advance!

There’s a small arrow next to Permit Join in Z2M. Unpair the device (do a force remove if you have to), then when you get to pair it back click the arrow & select the closest coordinator.
There’s no guarantee that it will stick to that coordinator since the mesh will adjust, but it’s the only way I know.

Can’t help much with the missing Mi Home devices, but have you checked that you didn’t get a duplicate device in HA? Check if you have any devices/entities ending in _2