This provides nodes for locally controlling e.g. Meross Smart Plug (without cloud!). It's requiring your Merross key to be provided by you. You should get this data via network sniffer or traffic interception between your Meross app and your Smart Plug or via user info fetch tool (see below). node-red-contrib-meross delivers 2 nodes:
Meross Config is a config node to set the token, message id and timestamp for being able to locally communicate with your devices.
Meross Smart Plug can be used to set smart plugs state and/or poll its current state. For setting smart plugs state to on|off you simply provide a boolean value (true|false). To request its current state you send any non-boolean payload. If your smart plug has multiple channels, all channels are triggered by default. You might control specific channels by passing the desired channel index via msg.channel attribute (1...n, 0=all channels). You might override node's ip address (e.g. '192.168.0.10') via its msg.ip attribute.
You might query Electricity Information from your Smart Plug (if supported) with the following payload:
{ "namespace": "Appliance.Control.Electricity" }
Meross Garage Door can be used to set garage doors state and/or poll its current state. For setting garage doors state to open|closed you simply provide a boolean value (true|false). To request its current state you send any non-boolean payload.
Meross Garage Door |
- MSG100 - MSG200 |
Meross Smart Plug |
- MSS110 - MSS210 - MSS310 - MSS425 |
Meross Smart Switch | - MSS710 (via Smart plug node) |
To be able to use these nodes you must provide your Meross key to your node config.
Now you should see a request in Fiddler like "https://[canvary].meross.com/v1/Auth/signin" with type "POST".
This should look like:
{ "apiStatus": 0, "sysStatus": 0, "data": { "token": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", "key": "abcdef01234567890abcdef01234567890", "userid": "123456", "email": "yourmail@domain.tld", "domain": "https://[canvary].meross.com", "mqttDomain": "mqtt-[canvary].meross.com" }, "info": "Success", "timeStamp": 1632308678 }
The key is the value from „key“.
To be able to implement additional devices feel free to provide sniffed communication between your app and devices. You might also feel free to directly contribute in this project.
Now you should see a request in Fiddle like "http://yourip/config" with type "POST".
This should look like:
{ "payload": {}, "header": { "messageId": "1234567890abcdef1234567890abcdef", "method": "GET", "from": "http://yourip/config", "sign": "567890abcdef1234567890abcdef12345678", "namespace": "Appliance.System.Ability", "triggerSrc": "iOSLocal", "timestamp": 1609232320, "payloadVersion": 1 } }
The token is the value from „sign“. The corresponding timestamp is the value from „timestamp“. The message id is the value from „messageid“.
[{"id":"88f87bae.10d938","type":"inject","z":"ec2c2ba0.1671a8","name":"Get State","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":160,"wires":[["f7696f8c.ae16c"]]},{"id":"f7696f8c.ae16c","type":"smartplug-control","z":"ec2c2ba0.1671a8","confignode":"d9dc372f.d15f08","name":"Smart Plug","ip":"10.10.10.10","x":370,"y":120,"wires":[["759b6fbe.d2d68"]]},{"id":"5b5e94ca.a0c614","type":"inject","z":"ec2c2ba0.1671a8","name":"Turn On","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":180,"y":80,"wires":[["f7696f8c.ae16c"]]},{"id":"60c5c941.c24568","type":"inject","z":"ec2c2ba0.1671a8","name":"Turn Off","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":180,"y":120,"wires":[["f7696f8c.ae16c"]]},{"id":"759b6fbe.d2d68","type":"debug","z":"ec2c2ba0.1671a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":570,"y":120,"wires":[]},{"id":"d9dc372f.d15f08","type":"meross-config","name":"Meross Config","key":"abcdef01234567890abcdef01234567890"}]