diff --git a/homeassistant/components/improv_ble/config_flow.py b/homeassistant/components/improv_ble/config_flow.py index 05dd1de449a..22f2bf3623c 100644 --- a/homeassistant/components/improv_ble/config_flow.py +++ b/homeassistant/components/improv_ble/config_flow.py @@ -126,15 +126,23 @@ class ImprovBLEConfigFlow(ConfigFlow, domain=DOMAIN): ) except improv_ble_errors.InvalidCommand as err: _LOGGER.warning( - "Aborting improv flow, device %s sent invalid improv data: '%s'", - self._discovery_info.address, + ( + "Received invalid improv via BLE data '%s' from device with " + "bluetooth address '%s'; if the device is a self-configured " + "ESPHome device, either correct or disable the 'esp32_improv' " + "configuration; if it's a commercial device, contact the vendor" + ), service_data[SERVICE_DATA_UUID].hex(), + self._discovery_info.address, ) raise AbortFlow("invalid_improv_data") from err if improv_service_data.state in (State.PROVISIONING, State.PROVISIONED): _LOGGER.debug( - "Aborting improv flow, device %s is already provisioned: %s", + ( + "Aborting improv flow, device with bluetooth address '%s' is " + "already provisioned: %s" + ), self._discovery_info.address, improv_service_data.state, ) diff --git a/tests/components/improv_ble/test_config_flow.py b/tests/components/improv_ble/test_config_flow.py index 2df4be2ba7d..4536c64349c 100644 --- a/tests/components/improv_ble/test_config_flow.py +++ b/tests/components/improv_ble/test_config_flow.py @@ -664,6 +664,6 @@ async def test_provision_fails_invalid_data( assert result["type"] is FlowResultType.ABORT assert result["reason"] == "invalid_improv_data" assert ( - "Aborting improv flow, device AA:BB:CC:DD:EE:F0 sent invalid improv data: '000000000000'" + "Received invalid improv via BLE data '000000000000' from device with bluetooth address 'AA:BB:CC:DD:EE:F0'" in caplog.text )