krahabb / meross_lan

Home Assistant integration for Meross devices
MIT License
387 stars 46 forks source link

How to obtain the Device Key? #463

Closed makerwolf1 closed 1 week ago

makerwolf1 commented 1 week ago

Hey! Sorry for the low effort post, I've just spent 15 minutes searching the docs for instructions on how to obtain the meross device key. I've also fallen into a github-issue rabbit hole with lots of sub-issues with people they managed to obtain the key by following yet another link. What is the reason that there is not a section about this in the wiki?

krahabb commented 1 week ago

I'm sorry to hear this...some clues about the device key are provided in the main README but they're likely confusing or not clear enough to say that the device key is easily (and almost automatically) managed when you configure your Meross account profile in meross_lan. The manual configuration of a device anyway will 'kindly' ask you if you want to recover the correct device key from your Meross acount in case the manually (or pre-filled) provided key is wrong.

So you can either directly setup a Meross cloud profile (with your Meross credentials) or let it be created automatically in order to retrieve the device key while manually configuring/adding a device.

Once a Meross cloud profile config is in place meross_lan will try use the key stored in that one whenever you add a new device. This should work flawlessly supposing you're only adding devices from the same account...if you have different cloud accounts/devices then it could be a mess and you have to manage a bit by yourself..for this scenario too (multiple cloud accounts) meross_lan should anyway be able to correctly discriminate which is the correct one in order to provide the correct key.

If your device was not configured by the Meross app but instead was 'privately binded/paired' then the device key was provided to any of the utilities used to privately bind the device and so it is completely unknown to meross_lan (even if they normally use a '' (empty) device key by default)

makerwolf1 commented 1 week ago

Oh Now I get it, by entering the cloud credentials you just obtain the key, you do not actually connect the device through the cloud after all!
I was just trying to get it set up quickly and did not spend enough effort understanding the key concept 🙈 But yeah I think could be explained in simpler terms in the docs, but I know how hard this can be.