diff --git a/tests/components/threshold/test_binary_sensor.py b/tests/components/threshold/test_binary_sensor.py
index e26781029c5d7a5c88a56d902048bf282f0bfd47..c4b1dad78d5cf23baa6a2df14e7eb3d4cd037e7f 100644
--- a/tests/components/threshold/test_binary_sensor.py
+++ b/tests/components/threshold/test_binary_sensor.py
@@ -597,6 +597,7 @@ async def test_device_id(hass: HomeAssistant) -> None:
     entity_registry = er.async_get(hass)
 
     source_config_entry = MockConfigEntry()
+    source_config_entry.add_to_hass(hass)
     source_device_entry = device_registry.async_get_or_create(
         config_entry_id=source_config_entry.entry_id,
         identifiers={("sensor", "identifier_test")},