Skip to content

How does messageID and sign is calculated in html curl #237

Answered by krahabb
sco0o asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @sco0o,
the latest (alpha) release in meross_lan implements reading the device position so you might give it a try if this is the case.

At any rate, the messageId is really a simple randomly chosen GUID while the sign is a bit more comple and I don't have a clue about curl but this is a sample snippet in node.js taken from the bytespyder's library

signPacket(packet) {
        const messageId = md5(uuid4())
        const timestamp = Math.floor(Date.now() / 1000)
        const signature = md5(messageId + this.key + timestamp)
        packet.header.messageId = messageId
        packet.header.timestamp = timestamp
        packet.header.sign = signature
        return packet
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sco0o
Comment options

Answer selected by sco0o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants