Skip to content

The Request Timestamp is not within the validity period #216

@Tazzie1207

Description

@Tazzie1207

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

  1. does not allow for utc + 11 for Melbourne Australia
  2. 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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions