Device discovery
Find owned and shared devices and open account-bound connections.
home, err := client.GetHome(ctx, roborock.AccountRequest{Auth: auth})
data, err := client.GetHomeData(ctx, roborock.HomeDataRequest{
Auth: auth, HomeID: home.ID, Version: roborock.HomeDataV3,
})
devices, err := client.ListDevices(ctx, roborock.AccountRequest{Auth: auth})Check each error before consuming results. Home-data revisions V1, V2, and V3 are explicit selections. Optional online state distinguishes a reported offline value from an absent value. Category, capability flags, and advertised A01 properties remain separate device metadata. ListDevices returns owned and shared devices with ID, model, online state, protocol, and local key. Do not log the local key or serialize discovered devices to ordinary diagnostic output.
GetHomeRooms(ctx, roborock.HomeRoomsRequest{Auth: auth, HomeID: home.ID}) refreshes owned home room names. GetSharedDeviceRooms(ctx, roborock.SharedDeviceRoomsRequest{Auth: auth, DeviceID: device.ID}) refreshes a received device's room names. Both return RoomsResult.Rooms, with numeric cloud IDs and optional names. These cloud IDs remain separate from map segment IDs used for cleaning.
session, err := client.OpenDevice(sessionCtx, roborock.OpenDeviceRequest{
Auth: auth, DeviceID: device.ID,
LocalKey: device.LocalKey, Protocol: device.Protocol,
})
if err != nil { return err }
defer session.Close()The local key is required for device encryption. A session binds one account and device until closed. Keep sessionCtx alive for that whole lifetime and use separate deadlines for RPC calls. Discovery preserves future protocol values; unsupported connection protocols fail with Unsupported.
Choose operations using device families, then continue with vacuum operations, maps, or A01. See the generated reference for account and device contract shapes.