-
Notifications
You must be signed in to change notification settings - Fork 26
Description
I have received an "unknown error occurred " when trying to get verification code through home Assistant
I ran script in postman.com and received error code 6009 "The request timestamp is not within the validity period"
The script in postman.com
- does not allow for utc + 11 for Melbourne Australia
- does not save the appId + appSecret + timestamp in a sign variable
// Set current date for statistics
var moment = require('moment');
var todayDate = new Date(); todayDate.setMinutes(todayDate.getMinutes() - todayDate.getTimezoneOffset()); todayDate.toISOString().slice(0,10)
pm.collectionVariables.set('CurrentDate', todayDate);
var appId = pm.collectionVariables.get("AppId");
var appSecret = pm.collectionVariables.get("AppSecret");
var timeStamp = moment.utc().unix().toString();
var sign = CryptoJS.SHA512(appId + appSecret + timeStamp).toString(); should this be SHA512 or SHA256
pm.request.addHeader({key: "appId", value: appId});
pm.request.addHeader({key: "timeStamp", value: timeStamp});
pm.request.addHeader({key: "sign", value: sign});
The data being sent to get the verification code is the Inverter SN and the Check code. It is not sending the (sign) appID, appSecret and timestamp and I am not exactly sure what should be sent. I am thinking appID + sign
{{BaseUrl}}/getVerificationCode?sysSn={{SysSn}}&checkCode={{checkCode}}
I have tried re-writing the script and the GET command with utc +11.0, however I have been unsuccessful in getting a verification code
Can I please get the correct script and the GET command for my inverter : AL7011025082275
From the instructions I am not sure where I need to enter the verification code in Home assistant when I do get the code
My email address is [email protected]