I implemented a basic Smart Home service by implementing the SYNC
, EXECUTE
and DISCONNECT
actions. In the SYNC
action, all devices have willReportState
set to false
.
However, on https://developers.google.com/actions/smarthome/report-state I read that it is required for us to report state changes ourselves. This means that all devices must have willReportState
set to true
, I assume?
My main question is what happens if the last reported state is not in sync with the reality?
For example, let's assume we reported 5 minutes ago that a certain device (having the OnOff
trait) is powered off. A few seconds ago, the customer powered the device manually by pressing the power on button. Let's assume that this fact is not yet reported to or known by the Smart Home Graph.
What happens now if the customer asks to the Assistant: turn off my device? Will this request be rejected or not? That is, will the fulfillment service receive this backend, even though the Graph Home service thinks the device is already powered off?
Also, do we still have to implement the QUERY
action if we implement Report State? Or are both required?
On a sidenote, this document does also not really address the frequency in which state changes must be reported. Is it documented somewhere else?
willReportState
tofalse
. Your service will not be eligible for the visual Assistant as described in the link that you published. In case you set thewillReportState
tofalse
every time you ask for an action, the action will be executed, every time you ask for the state, the query will be executed – Notochord