This directory contains sample Sinric Pro messages in JSON. They can be used to test your project to see if you are receiving or responding to the server correctly.
What is an action?
Act of doing something using voice, app or website will generate an action message in the system. Eg: Alexa, turn on the tv will generate setPowerState action.
What is an event ?
Changing the device state physically should raise an event to let the server know about the changes the user made. Eg: pushing a button to turn on the device should send "setPowerState" event to let the server know.
Unix epoch time used in all the messages are in seconds.
Any message with the "createdAt" timestamp older than 1 minute from the current time will be discarded to avoid network replay attacks.
Message's payload must signed using Hmac sha256 since protocol version 2. Here is an example code how to generate the signature HMAC using nodejs.
function getSignature(message, appsecert) {
return crypto.createHmac('sha256', appsecert).update(message).digest('base64');
}
complete code is available here https://github.com/sinricpro/sample_messages/blob/master/signature-hmac-example.js
Following devices are supported.
Smart Switch
Smart Light Bulb
Smart Switch with Dimmer
Doorbell
Temperature Sensor (Note: Default is -1)
Thermostat
Window AC Unit (Note: Alexa supports only US-English, Default tempreature is -1))
Fan (Note: from 1 to 3)
Motion Sensor (Note: Default state is "notDetected")
Contact Sensor (Note: Default state is "closed")
TV
Smart Speaker
Smart Doorlock (Note: Default state is "UNLOCKED")
The documents in this project are licensed under the CC-BY-SA 4.0 License, which encourages you to share these documents. See https://creativecommons.org/licenses/by/4.0/ for more details.