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

[somfytahoma] Channels not set at startup #10291

Closed
lolodomo opened this issue Mar 6, 2021 · 4 comments · Fixed by #10300
Closed

[somfytahoma] Channels not set at startup #10291

lolodomo opened this issue Mar 6, 2021 · 4 comments · Fixed by #10300
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@lolodomo
Copy link
Contributor

lolodomo commented Mar 6, 2021

When the binding is started, the channels are not initialized. They are as soon as there is a change of the corresponding state.
Unfortunately, the binding is relying on the hypothesis that a REFRESH command will be sent at startup to all linked channels.
This is something that was done in OH2 but no more in OH3.
@octa22 : it is necessary to trigger the refresh of channels at startup. I am not yet sure what is the best way to do it considering the binding architecture. But very probably in the initialize method of class SomfyTahomaBaseThingHandler.

@lolodomo lolodomo added the bug An unexpected problem or unintended behavior of an add-on label Mar 6, 2021
@octa22
Copy link
Contributor

octa22 commented Mar 6, 2021

There was this feature in the past but several users with more devices were complaining that the threshold of API was reached - there were encountering the too many requests error, so I had to change the initializatuon to a less aggressive way. So be careful ... a solution to this would be an initialization based on the getSetup cached response, but for sure a device per device initialization is a bad way.

@lolodomo
Copy link
Contributor Author

lolodomo commented Mar 6, 2021

Ok. Yes if we make a request for each channel, it could lead a many requests. So yes, the use of setup or setup/devices looks better. We could then cache the attribute containing the unit too.

@lolodomo
Copy link
Contributor Author

lolodomo commented Mar 7, 2021

I implemented the solution with a request for each thing, getting the device information.
Works well but I agree that it could lead to a lot of requests in case the user has many Tahoma devices.
So I will switch to your proposal to run and cache the result of getSetup. But I propose to set the cache duration relatively short like for example 30 seconds to reduce the risk of outdated data. At least, this cache will be used at binding startup.

@octa22
Copy link
Contributor

octa22 commented Mar 7, 2021

Sounds good, the cache should have rather short duration

lolodomo added a commit to lolodomo/openhab-addons that referenced this issue Mar 7, 2021
lolodomo added a commit to lolodomo/openhab-addons that referenced this issue Mar 7, 2021
fwolter pushed a commit that referenced this issue Mar 14, 2021
arjanmels pushed a commit to arjanmels/openhab2-addons that referenced this issue Mar 14, 2021
themillhousegroup pushed a commit to themillhousegroup/openhab2-addons that referenced this issue May 10, 2021
computergeek1507 pushed a commit to computergeek1507/openhab-addons that referenced this issue Jul 13, 2021
thinkingstone pushed a commit to thinkingstone/openhab-addons that referenced this issue Nov 7, 2021
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this issue May 5, 2022
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