krahabb / meross_lan

Home Assistant integration for Meross devices
MIT License
449 stars 47 forks source link

Device key #235

Closed rjnca closed 1 year ago

rjnca commented 1 year ago

I got the Meross LAN integration installed, but when I try to configure it, I just get a pop-up window that asks for a device key. Any idea where I can find this?

SCR-20221220-fai

krahabb commented 1 year ago

Hello @rjnca, This configuration is needed for the MQTT integration to be able to automatically discover devices. Every Meross device in-fact, uses a secret key to communicate so this is needed overall to setup your devices. If you don't use MQTT (this involves disconnecting meross devices from their cloud service and re-bind them to your private MQTT broker) you still need a device key and this key can be configured directly in every device you setup. Long story short, if you don't use MQTT, this entry must be left 'as is' (meross_lan needs it anyway as the first entry configured) and you can add another meross_lan configuration by adding the integration again, once per device that is.

There, you'll need the ip address (unless the device gets automatically discovered by DHCP on your LAN) and the device key but you will be able to recover the key by logging into your meross account (meross_lan will ask you for credentials right for the purpose)

rjnca commented 1 year ago

Thanks for the information

Phibins commented 1 year ago

Hello @rjnca, This configuration is needed for the MQTT integration to be able to automatically discover devices. Every Meross device in-fact, uses a secret key to communicate so this is needed overall to setup your devices. If you don't use MQTT (this involves disconnecting meross devices from their cloud service and re-bind them to your private MQTT broker) you still need a device key and this key can be configured directly in every device you setup. Long story short, if you don't use MQTT, this entry must be left 'as is' (meross_lan needs it anyway as the first entry configured) and you can add another meross_lan configuration by adding the integration again, once per device that is.

There, you'll need the ip address (unless the device gets automatically discovered by DHCP on your LAN) and the device key but you will be able to recover the key by logging into your meross account (meross_lan will ask you for credentials right for the purpose)

Hi @krahabb

I have been scoring the questions in order to get this set up, but keep failing.

I understand from your answer here that I need to leave the device key BLANK/EMPTY. (I am NOT using MQTT).

My device (MSG100) is not found after several restarts in the last week - I can see the device on my router, I even gave it a static IP.

I am lost on what to do next. If I misunderstood, and in fact DO need the device key - I am at my wit's end trying to retrieve it. The MEROSS LAN was added through HACS - I am using HA-OS.

image

I have also used the device pairer app to find (WHAT I BELIEVE IS) my device key, inputting this also did not result in any device being found :(

index

index-1

krahabb commented 1 year ago

Hello @Phibins, I'm sorry for the issue here, the Meross LAN Hub entry must be configured first even if you're not using it and, as stated above you can leave the key empty and forget about the entry configuration. Once configured (empty that is), start over again adding meross_lan integration another time. At this point you will be provided the 'real' device configuration form where you can set the address and device key. The pairer app is already providing you the device key (it's the 'MQTT Key' but it is used also for HTTP communication) but in meross_lan too there's an option to retrieve the 'real' device key from your Meross cloud account, nevertheless, the pairer app should be good at providing the correct one anyway ;)

Still, it is very strange the device is not automatically discovered. If not, I suggest you to install the 'Lazy.alpha.0' pre-release which has some tweaks both on DHCP discovery and MQTT configuration. In order to do so, you might have to instruct HACS to show you pre-release versions of the repo in order to see that

Phibins commented 1 year ago

Thank you Krahabb for your quicks response. Thanks to you - I managed to add all my devices into home assistant (after a lot of struggle and head scratching).

I think the read me is great - but I am not so smart it appears, and I would like to suggest some edits to the READ ME so as to accomadate the not so smart users such as myself.

  1. More explicit wording explaining that the "Device Pairer" is a separate android/ios app that can be installed on the phone. Some links to the apps on the Play-Store/App-Store would be helpful.

  2. More explicit wording explaining that you need to install the Meross Lan Integration - ONCE for set up... then again FOR EVERY device you wish to add as an entity. This was not clear to me until your comments, even after reading the instructions multiple times.

  3. That the "MQTT Key" is the "Device Key" that the integration is asking for.

Also using the terms "meross_lan integration" and "Meross Hub Lan" interchangeably - led me to believe they may be different things, when in fact they are the same thing - this caused a lot of confusion for me and led me to think i was missing something.

Thank you again for all your help!