The asynchronously command response is not depended from the invoking a direct device method. The value for this response is taken from the existing reported property with a "hardcoded name" the same as the command name. Note, that the name is a case sensitive.
In your scenario, be sure that this reported property such as a reboot is existed before executing a command, you can populated with some initialize value. To see this response (the value of the reported property reboot) in the Command history, just make a one command request.
The following screen snippets show an example of this Reboot command:
the PnP device has been created by my Azure IoT Hub Tester:
where the reported property Reboot is:
and the Command response:
After this first executing a command, you can change many times the value of the reported property Reboot and refreshing the Command history to see the latest command response.
Note, that executing a sync command is working well also, where the device sent the response payload to the IoTC App. In this case, the command response is generated by the direct method.
Update:
The following screens demonstrated an example of the executing a sync command RebootSync from IoTC App.
- Adding a new capability (Command RebootSync) to the device template:
- the Command response object:
- Run Command RebootSync:
- Connected PnP device tester3 received the direct method RebootSync request and sent the response back to the invoker:
- Command response on the IoT Central App:
The Command history can be obtained also using the REST API, the following screen snippet shows Azure IoT Hub Tester to get this history:
Thanks
Roman