Skip to content

NodeRedDriver

shodge12 edited this page May 27, 2019 · 4 revisions

So, why do we need a driver???

Talking to Meross devices is complicated. Its a long command which requires a signature involving a private key. To get the device on your MQTT broker, you have to issue commands to set the private key along with other local information. Once everything is in place, signing all outgoing messages is the biggest hassle. The other issue is the size of the uniqueID; its a 32 character random hex string.

So what do we want for a driver?

  1. We need to shorten the UniquieID
  2. On / Off / Dim commands should be real easy and short...
  3. No message signing....
  4. It would appear as new topics in the MQTT broker....

Driver Specification

Driver IDs

Each Meross device can have multiple controls. For simplicity, I have limited the number to be a single digit. The drivers uniqueID for each Meross device takes the format <Least Significant 5 digits of the Meross UniqueID> <0> . This creates a 7 digit DriverID.

Example: This is a actual topic to send commands to a Meross Device [assume channel 0 (single item)] /appliance/1712281825467829030134298f151c4a/publish

The equivalent driver topic to send to would be /cmnd/51c4a00/POWER

Topics

Commands are sent to: /cmnd//POWER [To turn devices on or off] /cmnd//DIM [To set the illumination level]

Status is returned from the devices on: /stat//POWER [Status from devices on or off] /stat//DIM [Status from devices - dim level]

Topic Payloads - Commands

POWER The Power topic has only one argument "onoff". Here is a example:

/cmnd/51c4a01/POWER {"onoff":1}

Dim The Dim topic has only one argument "dim". Here is a example:

/cmnd/9679100/DIM {"dim":29}

Topic Payloads - Status

Status is returned in same way except an additional field is added "device" which is set to the DriverID. Here are a couple examples:

/stat/51c4a01/POWER {"device":"51c4a01","onoff":1} /stat/9679100/DIM {"device":"9679100","dim":29}

Special Dim Handling...

The driver is specifically written to interface to Homeseer. The Meross dimmer device (specifically the MSS560) will turn on the lamp attached and then set it to a specific dim level through a 'ToggleX' and a 'Light' commands / status. Homeseer likes to deal with only DIM command / status messages for a dimmable device. This driver bridges this gap. It will interpenetrate "dim":0 to a "onoff":0 and "dim":100 to a "onoff":1. The dim 1-99 are passed through directly as a 'Light' command.