albertogeniola / MerossIot

Async Python library for controlling Meross devices
https://albertogeniola.github.io/MerossIot/
MIT License
489 stars 89 forks source link

No documentation for meross_api_cli (format for __MEROSS_CREDS environment variable? #409

Open akohlsmith opened 1 week ago

akohlsmith commented 1 week ago

I'm trying to use the meross_api_cli utility and can log in without issue. It spits out a bit of JSON with token, key, user_id, user_email, domain, mqtt_domain, and issued_on keys. However if I try to set __MEROSS_CREDS to this string, then other commands such as device list say that the environment variable format is wrong.

I can't find documentation on the format for this environment variable, and the code does not appear to have much to go on either.

Can the documentation be updated to add the format that the utility expects this environment variable to have, and perhaps give an example or two of how the utility can authenticate and list/control a switch?

donations-bot-prod[bot] commented 1 week ago

Donation bot here. Supporters can mark their interest in this issue by adding a comment starting with "+1" (without quotes) or adding the "#supporter_sponsor" keyword (without quotes) in their comments.

You can become a donor by subscribing as Sponsor from the GitHub sponsorship page or from the BuyMeACoffee page.

Issues marked by donors will be labeled accordingly and handled with special care

akohlsmith commented 1 week ago

I figured it out, but some documentation on how to do it "right" would be helpful.

export __MEROSS_CREDS=`echo '{"token": "..." ... the whole JSON blob from the `auth login` command}' | base64`

now things like meross_api_cli device list seem to work.