简体   繁体   中英

Google smart home action : where to trigger a requestSync?

I created a smart home action and I have to implement the requestSync feature for certification. But I don't understand from where to call it: from my backend fulfillment? or from elsewhere?. In the documentation, I saw:

You must trigger a SYNC request:

- If the user adds a new device.
- If the user removes an existing device.
- If the user renames an existing device.
- If you implement a new device type, trait, or add a new device feature.

But all these user interactions are from the Google side (in the Google Home app), so I don't understand why Google doesn't trigger the sync itself, and how could my backend know that the user changed something?

Can someone help me with this feature? Thank you !

But I don't understand from where to call it: from my backend fulfillment? or from elsewhere?

It definitely should come from backend.

But all these user interactions are from the Google side (in the Google Home app), so I don't understand why Google doesn't trigger the sync itself, and how could my backend know that the user changed something?

This isn't a case to use the "requestSync". And your backend doesn't need to know about it if your users operate their devices from Google Home app

Here I will explain some example use case for you. Imagine that you have your own application for controlling your devices. Then you develop the smarthome action project to make your device be able to controlled over voice. When your devices are linked with HomeGraph and you change your device's name, add or remove it from your own application . This is the time that your backend system should make "requestSync".

Even if your system doesn't allow user to make such of those changes on the device unless using Google Home app , google requires your system to be able to send them the "requestSync" for the case that when you "Implement a new device type, trait, or add a new device feature" . This is the way that allows you(as developer) to update your users' devices without them(your users) unlinking and relinking their account.

And if you are not clear about "Implement a new device type, trait, or add a new device feature" . Just thinking of case that you want to add more traits for your devices and you want to make update on all devices that has been linked before to be able to use a functionality from your new trait. You will need "rquestSync"

Hope this help. Goodluck:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM