An automation created from a Blueprint that references entities in the "hubitat" domain may throw errors during initialization. The issue is that the current device trigger validation code assumes the Hubitat config entry or entries will be loaded when validation occurs, but automations created from Blueprints may/will be initialized before the Hubitat integration has been fully loaded, leading to an error like:
2022-10-02 16:44:58.587 ERROR (MainThread) [homeassistant.setup] Error during setup of component automation
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 235, in _async_setup_component
result = await task
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 255, in async_setup
if not await _async_process_config(hass, config, component):
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 695, in _async_process_config
await async_validate_config_item(hass, raw_config),
File "/usr/src/homeassistant/homeassistant/components/automation/config.py", line 74, in async_validate_config_item
config[CONF_TRIGGER] = await async_validate_trigger_config(
File "/usr/src/homeassistant/homeassistant/helpers/trigger.py", line 94, in async_validate_trigger_config
conf = await platform.async_validate_trigger_config(hass, conf)
File "/usr/src/homeassistant/homeassistant/components/device_automation/trigger.py", line 66, in async_validate_trigger_config
return await platform.async_validate_trigger_config(hass, config)
File "/config/custom_components/hubitat/device_trigger.py", line 90, in async_validate_trigger_config
hubitat_device, _ = get_hubitat_device(hass, device.id)
File "/config/custom_components/hubitat/device_trigger.py", line 213, in get_hubitat_device
hub = get_hub(hass, entry_id)
File "/config/custom_components/hubitat/hub.py", line 471, in get_hub
return hass.data[DOMAIN][config_entry_id]
KeyError: '00005252a26f2f8428662af019bddfcd'
An automation created from a Blueprint that references entities in the "hubitat" domain may throw errors during initialization. The issue is that the current device trigger validation code assumes the Hubitat config entry or entries will be loaded when validation occurs, but automations created from Blueprints may/will be initialized before the Hubitat integration has been fully loaded, leading to an error like: