Skip to content
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

[unifi] Thing configuration changes are not reloaded #11407

Closed
jlaur opened this issue Oct 18, 2021 · 1 comment · Fixed by #11411
Closed

[unifi] Thing configuration changes are not reloaded #11407

jlaur opened this issue Oct 18, 2021 · 1 comment · Fixed by #11411
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@jlaur
Copy link
Contributor

jlaur commented Oct 18, 2021

When changing configuration options like the considerHome value, this is not automatically picked up by the binding.

Expected Behavior

Configuration changes should take effect automatically and instantly.

Current Behavior

Old configuration values will be considered. So for example, it considerHome is changed from 60 to 180 seconds, client will still be marked as offline after one minute.

Possible Solution

I added this logging to UniFiClientThingHandler method initialize in else:

        // mgb: called when the config changes
        if (thing.getStatus() == INITIALIZING) {
            [...]
        } else {
            logger.debug("initialize() called, thing {} status is {}, existing consider home: {}, new: {}",
                    thing.getUID(), thing.getStatus(), this.config.getConsiderHome(), config.getConsiderHome());
        }

Result:

2021-10-18 20:49:20.974 [DEBUG] [rnal.handler.UniFiClientThingHandler] - initialize() called, thing unifi:wirelessClient:home:oneplus8_jacob status is ONLINE, existing consider home: 60, new: 180

So it seems that updating config only for things in status INITIALIZING is not sufficient.

Steps to Reproduce

For file-based configuration create a wirelessClient thing like this:

Thing wirelessClient oneplus8_jacob "UniFi Wireless Client: OnePlus 8 (Jacob)" [ cid="192.168.0.28", considerHome=60 ]

Then change it to:

Thing wirelessClient oneplus8_jacob "UniFi Wireless Client: OnePlus 8 (Jacob)" [ cid="192.168.0.28", considerHome=180 ]

and observe that client will still be marked as offline after one minute. Please be aware that this example will currently not work because of #7001, so it's kind of theoretical, but when #7001 is fixed, this bug will start appearing.

Context

I was testing a fix for #7001 and changed value a few times to not have to wait too long during my tests.

Your Environment

UniFi Controller 6.2.26

@jlaur jlaur added the bug An unexpected problem or unintended behavior of an add-on label Oct 18, 2021
jlaur added a commit to jlaur/openhab-addons that referenced this issue Oct 18, 2021
Fixes openhab#11407

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
lolodomo pushed a commit that referenced this issue Oct 22, 2021
* Fix config reload after changes.

Fixes #11407

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

* Don't try to initialize client when bridge is offline.

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
dschoepel pushed a commit to dschoepel/openhab-addons that referenced this issue Nov 9, 2021
* Fix config reload after changes.

Fixes openhab#11407

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

* Don't try to initialize client when bridge is offline.

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Dave J Schoepel <dave@theschoepels.com>
@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/ubiquiti-unifi-binding-feature-discussion/14520/1220

NickWaterton pushed a commit to NickWaterton/openhab-addons that referenced this issue Dec 30, 2021
* Fix config reload after changes.

Fixes openhab#11407

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

* Don't try to initialize client when bridge is offline.

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Nick Waterton <n.waterton@outlook.com>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this issue Jan 28, 2022
* Fix config reload after changes.

Fixes openhab#11407

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

* Don't try to initialize client when bridge is offline.

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
volkmarnissen pushed a commit to volkmarnissen/openhab-addons that referenced this issue Mar 3, 2022
* Fix config reload after changes.

Fixes openhab#11407

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

* Don't try to initialize client when bridge is offline.

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this issue May 5, 2022
* Fix config reload after changes.

Fixes openhab#11407

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

* Don't try to initialize client when bridge is offline.

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants