State accuracy indicates a smart home device’s status based on the capabilities it has enabled. For example, the state of a smart light could be on or off. Reporting an accurate state quality to Alexa is crucial for driving customer satisfaction and engagement. Accurate state quality reporting helps avoid scenarios such as where a customer’s light is turned on, but Alexa doesn't reflect that state because there isn't a timely update from the device.
Further emphasizing the importance of state quality reporting, the Echo Hub has an enhanced experience. It allows customers to control their devices, view the status of their devices, and set up routines, particularly for device capabilities such as PowerController (turn on/off a device), LockController (lock/unlock lockable devices), and ThermostatController (control thermostat for furnaces, air conditioners, and water heaters).
This blog outlines best practices for ensuring that your smart home devices communicate their status effectively, leading to a seamless experience for customers.
Best Practices
Here are four key tips for ensuring that Alexa accurately reflects the state of your smart home devices:
- Tip #1: Send Change Reporting immediately: Always send a change report within three seconds after a device state change. Whether the state changes due to a customer interaction using your app, physical interaction with the device, or Alexa voice control, timely reporting is crucial. Include all changed properties (payload object) and all unchanged properties (context object) in the report, and don’t forget to provide the Alexa.EndpointHealth status. The unchanged properties are required as they compensate for any earlier updates that were missed or rejected due to validation errors. This ensures that Alexa has the most up-to-date information.
- Tip #2: Respond to Alexa directives (ReportState, Alexa.Response) promptly: This is particularly important when customers interact with devices through the Alexa app or voice commands. The context object in the Alexa.Response should include the status of all changed properties, confirming that the command was executed and the device is responsive based on the Alexa.EndpointHealth status.
- Tip #3: Remain consistent with value formats: Ensure that the value formats used in state and change reports are consistent. For example, if you use Fahrenheit for temperature in a state report, the same format should be used in the change report. Mismatched formats can lead to confusion and increase ReportState traffic.
- Tip #4: Ensure timeOfSample is updated to reflect the new state change for each given controller: For example, if there was a change to PowerController, but not BrightnessController, the timeOfSample for PowerController should be different than BrightnessController. Keeping the timeOfSample separate for each controller will make it easier to differentiate when state changes occur via Alexa.
- Tip #5: Adhere to the Works with Alexa (WWA) requirements: Regularly review the WWA requirements to stay compliant with both existing and new state quality standards.
By implementing these best practices, you can enhance the state accuracy of your smart home devices, leading to a better customer experience. Review the state reporting examples for more details.