Skip to content

Add option to enable hue-mode as a deCONZ argument #3696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 15, 2021

Conversation

KodeCR
Copy link
Contributor

@KodeCR KodeCR commented Nov 17, 2020

Without this command-line deconz argument option the basic config (without a user/api-key) isn't hue-compatible as the mode is normally based on the api-key. That seems to hinder initial hue-app pairing sometimes.

@ebaauw
Copy link
Collaborator

ebaauw commented Nov 17, 2020

You also need to update rest_configuration.cpp, to return the same values for swversion and apiversion to an authenticated GET of /config. Best define constants (in de_web_plugin_private.h) so future updates need to be made only in one place.

@KodeCR
Copy link
Contributor Author

KodeCR commented Nov 18, 2020

Thanks for reviewing. An authenticated GET /config uses configToMap, which calls basicConfigToMap first, which sets these variables, or did I miss something?

@ebaauw
Copy link
Collaborator

ebaauw commented Nov 18, 2020

Ah, you moved generating these attributes to basicConfigMap(). Sorry, I missed that.

@KodeCR
Copy link
Contributor Author

KodeCR commented Nov 18, 2020

No worries, thanks again for checking

Copy link
Member

@manup manup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few comments, can you please have a look.

Comment on lines -1025 to -1030
swupdate2["install"] = false;
autoinstall["updatetime"] = "";
autoinstall["on"] = false;
swupdate2["autoinstall"] = autoinstall;
swupdate2["lastchange"] = "";
swupdate2["lastinstall"] = "";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"install" and "lastinstall" are present in the Hue API why remove them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Hue API documentation is not very clear on this, but from the actual bridge it looks like:

  • "install" is a write only item
  • "lastinstall" is only part of the swupdate2 state for the bridge subobject

{
map["swversion"] = QLatin1String("1941132070");
map["apiversion"] = QLatin1String("1.41.0");
// map["modelid"] = QLatin1String("BSB002");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the Hue "modelid" was remove above it should to be set here I guess?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"modelid" is set in line 1081 to "deCONZ", it seems that the Hue App at least doesn't care that it's not "BSB002".
I at least can remove the commented lines though...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know, the Hue App might be fine but have you tested this also with Amazon Echo?
If in doubt I'd vote to just keep the BSB002 modelid.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested it directly with the Echo, I'm using Alexa integration through homebridge. Just to be sure I've put back the BSB002 modelid.

@manup manup added this to the v2.10.0-beta milestone Feb 4, 2021
@manup manup merged commit 19a0e70 into dresden-elektronik:master Feb 15, 2021
@Smanar
Copy link
Collaborator

Smanar commented Sep 23, 2021

Hello, this feature is still working ?
Someone is using " --hue-mode" but he still have ApiMode = 0 in log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants