CJNE/pymyenergi

app_email/password requested in CLI even if not using libbi

Closed this issue · 9 comments

Hi!

I'm using the CLI to control my zappi. My understanding is that app_email and app_password are only required for libbi, but still I get prompted for them when using zappi.

I am not able to set dummy values for these, since I get an authentication failure. Is it possible to skip them somehow?

You should be using the MyEnergi hub serial for username and the API key for password. But you can’t call the ME servers asynchronously as their security method is session based, then you can log-on once and control all of their products.

Yes, I am using hub serial and API key. But still the CLI still asks me to type app_email and app_password, which I don't want to pass. Pressing Enter is not an option, since I want it to run without user interaction in a cron tab.

Running the CLI like this solves the problem as a workaround:

echo | myenergi zappi ...

This simulates pressing Enter when prompted for app_email.

I just added a "--skip-oauth" flag to the cli in PR #43
Once that's merged, you can call the cli with that flag and you won't be prompted for app email/password.

Awesome, thanks a lot!

@carlosgalvezp 0.2.0 has been released today and now you can use the --skip-oauth flag!

Awesome, just tried it and works like a charm, thank you!

Btw, I realize that password is also required when running myenergi --version, which sounds unnecessary. Perhaps it should behave just like --help?

Ah, good catch, but to be fair --version asks for the hub serial number as well if you don't have it in the config. I'll prepare a small PR for this.

CJNE commented

Fixed in 0.2.1, thanks for the PR!