Google Home Device Integration in Mobile IoT App

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Google Home Device Integration in Mobile IoT App
Complex
~5 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Google Home Device Integration into Mobile IoT App

Google Home SDK became publicly available in 2023 after years of closed beta. Before that only path — Google Home API via REST, limiting control and requiring OAuth per user via Google account. Now two paths: Google Home SDK for Android (native integration) and Device Access API (REST/gRPC, works with Android and iOS).

Device Access API: REST Integration for iOS and Flutter

Device Access works with Nest devices (thermostats, cameras, doorbell cameras). Authorization via OAuth 2.0, after which app gets access to Structures, Rooms and Devices:

GET https://smartdevicemanagement.googleapis.com/v1/enterprises/{projectId}/devices
Authorization: Bearer {access_token}

Response contains device list with traits. Nest Learning 3rd gen thermostat returns:

{
  "name": "enterprises/project-id/devices/device-id",
  "type": "sdm.devices.types.THERMOSTAT",
  "traits": {
    "sdm.devices.traits.ThermostatMode": {
      "mode": "HEAT",
      "availableModes": ["HEAT", "COOL", "HEATCOOL", "OFF"]
    },
    "sdm.devices.traits.ThermostatTemperatureSetpoint": {
      "heatCelsius": 21.5
    },
    "sdm.devices.traits.Temperature": {
      "ambientTemperatureCelsius": 19.8
    }
  }
}

Control — via ExecuteCommand:

// iOS, Alamofire
func setThermostatMode(_ mode: String, deviceName: String) async throws {
    let url = "https://smartdevicemanagement.googleapis.com/v1/\(deviceName):executeCommand"
    let body: [String: Any] = [
        "command": "sdm.devices.commands.ThermostatMode.SetMode",
        "params": ["mode": mode]
    ]
    _ = try await AF.request(url, method: .post, parameters: body,
                              encoding: JSONEncoding.default,
                              headers: authHeaders)
        .serializingDecodable(CommandResponse.self)
        .value
}

Authorization via Google Sign-In SDK with scope https://www.googleapis.com/auth/sdm.service. Store refresh token in Keychain — DeviceAccess tokens live 1 hour.

Android: Google Home SDK

Android Google Home SDK provides native ecosystem access, including Matter devices:

// build.gradle.kts
implementation("com.google.home:google-home-sdk:1.1.0")

Initialization:

val homeClient = HomeManager.getHomeClient(context)

homeClient.getHomes()
    .flowOn(Dispatchers.IO)
    .collect { homes ->
        homes.forEach { home ->
            home.devices().collect { devices ->
                devices.forEach { device ->
                    processDevice(device)
                }
            }
        }
    }

Interesting SDK feature — reactive model based on Kotlin Flow. Device state is Flow, automatically emits new values on change:

suspend fun observeThermostat(device: HomeDevice) {
    device.trait(ThermostatMode)
        ?.changes()
        ?.collect { mode ->
            updateUI(mode.mode)
        }
}

Execute commands via same trait objects:

val thermostatTrait = device.trait(ThermostatMode) ?: return
thermostatTrait.setMode(ThermostatMode.Mode.COOL)

Nest Cameras: WebRTC Streaming

Camera Access trait returns rtspUrl or WebRTC offer, depending on camera model. New Nest Cam (2021+) work only via WebRTC:

val cameraLiveStream = device.trait(CameraLiveStream)
val streamResponse = cameraLiveStream?.generateWebRtcStream(
    offerSdp = localPeerConnection.localDescription?.description ?: ""
)
// Pass streamResponse.answerSdp to RTCPeerConnection
peerConnection.setRemoteDescription(
    RTCSessionDescription(RTCSessionDescription.Type.ANSWER, streamResponse.answerSdp)
)

Common mistake: don't update stream token. WebRTC session lives 5 minutes, then Nest closes connection. Need background timer calling extendWebRtcStream() 30 seconds before expiry.

Ecosystem Limitations

Device Access API requires Google approval for each project — submit request via console, response 1-5 business days. Fee: $5 project registration. Cameras don't work in Device Access without Nest Aware subscription on user account — must explicitly mention in UX.

Google Home SDK Android still Developer Preview in 2024, API may change. For production solutions with cameras, Device Access API more reliable.

Integration timeline: Device Access API for iOS — 2-3 weeks; Android Google Home SDK with Matter — 3-4 weeks; Flutter with both — 5-6 weeks. Cost calculated individually after analyzing requirements.