Skip to content

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

Merged
manup merged 4 commits into
dresden-elektronik:masterfrom
KodeCR:update_hue_mode
Feb 15, 2021
Merged

Add option to enable hue-mode as a deCONZ argument#3696
manup merged 4 commits into
dresden-elektronik:masterfrom
KodeCR:update_hue_mode

Conversation

@KodeCR

@KodeCR KodeCR commented Nov 17, 2020

Copy link
Copy Markdown
Contributor

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

ebaauw commented Nov 17, 2020

Copy link
Copy Markdown
Collaborator

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

KodeCR commented Nov 18, 2020

Copy link
Copy Markdown
Contributor Author

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

@ebaauw

ebaauw commented Nov 18, 2020

Copy link
Copy Markdown
Collaborator

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

@KodeCR

KodeCR commented Nov 18, 2020

Copy link
Copy Markdown
Contributor Author

No worries, thanks again for checking

@manup manup left a comment

Copy link
Copy Markdown
Member

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 thread rest_configuration.cpp
Comment on lines -1025 to -1030
swupdate2["install"] = false;
autoinstall["updatetime"] = "";
autoinstall["on"] = false;
swupdate2["autoinstall"] = autoinstall;
swupdate2["lastchange"] = "";
swupdate2["lastinstall"] = "";

Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread rest_configuration.cpp Outdated
{
map["swversion"] = QLatin1String("1941132070");
map["apiversion"] = QLatin1String("1.41.0");
// map["modelid"] = QLatin1String("BSB002");

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread authorisation.cpp Outdated
@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

Smanar commented Sep 23, 2021

Copy link
Copy Markdown
Collaborator

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