Event for configuration reload

Hello!

I’m wondering if there’s an event generated for configuration reload? I know there’s one for the HA restart, however can’t find for configuration reload.
My use case: initialize options for input_select, the values are taken from REST API request. So once I reload the config, the options are taken from the configuration.yaml. I trigger the initizlization service once I restart the HA, want to do the same for configuration reload
Or maybe there’s another/better way to solve my problem

The following Event Trigger listens for call_service events involving the reloading of the input_select integration.

Example 1

  trigger:
    - platform: event
      event_type: call_service
      event_data:
        domain: input_select
        service: reload

The following Event Trigger is for reload_all but I’m not sure an automation can detect it because it, and all other automations, might be in the process of being reloaded when the event occurs.

Example 2

  trigger:
    - platform: event
      event_type: call_service
      event_data:
        domain: homeassistant
        service: reload_all

Try both examples but given that your use-case is for initializing options for input_select, I suggest using the first Event Trigger example.


EDIT

You can experiment with events by opening two browser tabs, the first one pointing to Developer Tools > YAML and the second one pointing to Developer Tools > Events.

Configure the second one like shown below.

After you entered call_service, click Start Listening, quickly switch to the first tab and click Reload All YAML Configuration, then quickly switch back to the second tab and click Stop Listening. There should be 20 or more events listed on the page in reverse chronological order.

1 Like

Thanks a lot!

1 Like