question

Alan Bacon avatar image
Alan Bacon asked

Alexa Change Report - no update in Smart Home Devices screen

I am developing an Alexa Home Skill and am trying to proactively report the state of the devices, using the change report request as defined here: https://developer.amazon.com/en-US/docs/alexa/smarthome/state-reporting-for-a-smart-home-skill.html#report-state-with-changereport-events

However I can see no evidence anywhere of my state report taking any effect.

1. The alexa app does not update the state of the bulb

2. The devices screen in the alexa developer console has no entry for the power state (if retrievable is set to false) and does not update to the expected value from the change report if retreivable is set to true.

3. There are no records of change reports being recieved in the alexa developer console under analytics -> operation metrics -> change report

4. Change reports do not appear to force the alexa app to re-poll for a state report either.

This previous question and answer: https://amazon.developer.forums.answerhub.com/questions/242675/alexa-change-report.html implied that I should be able see the effect of these reports somewhere.


I have made sure that proactiveReporting is set to true on my discovery response and have also tried setting retrievable to both true and false:

          capabilities: [
            {
              interface: 'Alexa.PowerController',
              version: '3',
              type: 'AlexaInterface',
              properties: {
                supported: [
                  {
                    name: 'powerState',
                  },
                ],
                retrievable: false,
                proactivelyReported: true,
              },
            },
            {
              type: 'AlexaInterface',
              interface: 'Alexa.EndpointHealth',
              version: '3.2',
              properties: {
                supported: [
                  {
                    name: 'connectivity',
                  },
                ],
                retrievable: true,
              },
            },
            {
              type: 'AlexaInterface',
              interface: 'Alexa',
              version: '3',
            },
          ],

I am recieving a 202 status code when I send my change report, which looks like this: (I have also tried sending the endpoint health in the same response, i have tried putting the information in the context as well)

    {
      event: {
        header: {
          namespace: 'Alexa',
          name: 'ChangeReport',
          messageId: <random uuid>,
          payloadVersion: '3',
        },
        endpoint: {
          scope: {
            type: 'BearerToken',
            token: <my_access_token>,
          },
          endpointId: 'sample-bulb-01', // this matches endpoint in discovery resp
        },
        payload: {
          change: {
            cause: {
              type: 'PHYSICAL_INTERACTION',
            },
            properties: [
              {
                namespace: 'Alexa.PowerController',
                name: 'powerState',
                value: 'ON',
                timeOfSample: <iso_current_datetime>,
                uncertaintyInMilliseconds: 0,
              },
            ],
          },
        },
      },
      context: {}
    }

Under build -> permissions in the alexa developer console i have enabled "send alexa events". And am using the clientId and clientSecret to generate the access token. As per the instructions here: https://developer.amazon.com/en-US/docs/alexa/smarthome/authenticate-a-customer-permissions.html


Please could someone inform me of whether I am doing something incorrect or if Amazon service is not behaving as expected or if I'm looking for the effect of the change reports in the wrong place?

My main concern is when I come to write the brightness controllers I want Alexa to know what the current brightness of the room is even if it has been changed using the room switch. For example:

if a user uses alexa to set the room to 100% brightness,

a 2nd user then uses the room switch to adjust the brightness to 50%

the first user then uses alexa to reduce the room brightness by 20%

---

will alexa then set the brightness to be 80% or 30%?


Thank you


changereport
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers