New Automations Not Working Unless I Reboot Host PC

I have just been setting up my Zigbee devices after migrating from a HUSBZB-1 to Zigbee2MQTT with a Sonoff 3.0. I have a SmartThings Button & Ikea 5 button remote. Both paired without issues and with either when I create a basic automation to toggle a light after creating and saving the automation it will not run. If I go back to the automation menu the newly created automation does not show up. What I found though is that it is present in the automations.yaml and if I reboot my HA PC the automations then show up in the list and work, they do not if I just reload the automations from the developer tools menu. If I edit them however to change the light that is toggled and save, the button will still toggle the original light I set, again if I reboot my HA PC the automation will work with the new light.
I am completely baffled by this behaviour and would greatly appreciate some help as I am trying to convince my wife it was a good idea spending hours moving all my Zigbee devices over to Zigbe2MQTT
Thanks in advance for any advice

Developer tools → Reload automations

I have tried this but it still doesn’t work.

As I mentioned the only way I can make the changes stick is physically reboot the PC HA is running on. I cannot even restart the front end from either the system or developer tools menu

Are you using the built-in Automation Editor to create automations or are you using a separate text editor?

If you use the Automation Editor, the moment you click the Save button it checks the automation for errors and, if there are none, immediately reloads all automations.

If you use a text editor to create/modify automations, you have to manually execute Check Configuration and Reload Automations. If you don’t execute Reload Automations (or restart Home Assistant) the automation you just created, or modified, is not loaded into Home Assistant.

So if you are using the Automation Editor and your newly created automation isn’t immediately available after clicking the Save button, it’s not normal.

If you are using a text editor it’s normal for your newly created automation to not appear until you execute Reload Automations (or restart).

I am using the built in automation creation tool within Home Assistant. I have used this many times with ZHA so understand how to use it, I really don’t understand why anything I do shows up immediately in the automations.yaml but won’t take effect until I reboot the PC

Pulling what little hair I have left out here lol

In that case, it’s not normal.

When did you first notice this behavior and are there any related error/warning messages in Logs?

It would appear that something went sideways with the configuration.yaml

I was also having issues restarting Home Assistant front end, I did a config check last night and it never completed, I was tired so I went to bed.

It made me wonder if somehow the configuration.yaml was corrupt so I made a backup then deleted it and physically rebooted the PC. Once back in I went through the file and removed a couple of lines I didn’t need any longer and added everything back and now the perform check works correctly and I can restart Home Assistant from either developer tools or system menu

The automations can be edited now and take effect immediately.

Appreciate the help

If “something went sideways with the configuration.yaml” there would be error/warning messages in the Log (especially if Home Assistant is restarted). Did you inspect the Log?

What was removed?

I do not recall adding this line and I am not sure what it is for:

# Activate the configuration editor

And I had deleted the zha inergration so I also deleted:

#  usb_path: /dev/ttyUSB1
#  database_path: /config/zigbee.db

Here’s the documentation for config.

If default_config is present in configuration.yaml then it encompasses many other options including the config option. However if default_config is not present (commented out) then the options it represents, like config, must be explicitly specified in configuration.yaml.

So if you don’t have default_config present, you need to specify config because it controls part of the frontend (and may explain the problem you had encountered):

The config integration is designed to display panels in the frontend to configure and manage parts of Home Assistant.

This is what I have further up:

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

This was there form the beginning, I do not remember adding the other lines. Everything seems to be working properly. I made a backup of the configuration.yaml in case I need to add anything back I have removed

Then there’s no need for the line containing config: because it’s already included by default_config: (as shown in its documentation).

1 Like

I had this exact same problem – migration from ZHA with a HUSBZB-1 to Zigbee2MQTT with a Sonoff 3.0.

Once I removed the following from my config everything started working as expected.

  usb_path: /dev/ttyUSB1
      ikea_provider: true 
      ledvance_provider: true
      salus_provider: true
      inovelli_provider: true
      otau_directory: /config/ota

I have a feeling this may have been the root cause,

I had deleted the zha integration and then made the change below
What I didn’t do is put a # infront of the zha: at the top.

It has been working fine since I deleted these lines and the other one I mentioned further up