async def system_health_info(hass):
    """Get info for the info page."""
    mic = None
    uas = {}
    uds = {}
    all_devices = {}
    for mic in MiotCloud.all_clouds(hass):
        uas[mic.user_id] = mic
        uds[mic.unique_id] = await mic.async_get_devices_by_key('did') or {}
        all_devices.update(uds[mic.unique_id])

    api = mic.get_api_url('') if mic else 'https://api.io.mi.com'
    api_spec = 'https://miot-spec.org/miot-spec-v2/spec/services'

    version = await async_get_manifest(hass, 'version', 'unknown')
    data = {
        'component_version': version,
        'can_reach_server': system_health.async_check_can_reach_url(hass, api),
        'can_reach_spec': system_health.async_check_can_reach_url(
            hass, api_spec, 'https://home.miot-spec.com/?cant-reach',
        ),
        'logged_accounts': len(uas),
        'total_devices': len(all_devices),
    }

    return data
Get info for the info page.
custom_components/xiaomi_miot/system_health.py