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

[linky] Bad values from yesterday once the refresh is working again #9386

Closed
lolodomo opened this issue Dec 15, 2020 · 6 comments · Fixed by #9423
Closed

[linky] Bad values from yesterday once the refresh is working again #9386

lolodomo opened this issue Dec 15, 2020 · 6 comments · Fixed by #9423
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@lolodomo
Copy link
Contributor

lolodomo commented Dec 15, 2020

Once #9358 is used, data refresh is hopefully back.
The new problem is that values are not the ones expected, at least for the yesterday and the current week values.
We are Tuesday, we should have these values considering Monday but yesterday value is UNDEF and current week value is 0.

Either the binding is shifting the values for one day or the request is run too early while the value for yesterday are not yet provided.
Edit: Or the API is never providing last day ?

@lolodomo lolodomo added the bug An unexpected problem or unintended behavior of an add-on label Dec 15, 2020
@lolodomo
Copy link
Contributor Author

If I go to the WEB site, the value from yesterday is available.
If I use the report console command to list the last values, yestterday is not listed. Other day values look correct.

@lolodomo
Copy link
Contributor Author

I will investigate a little more but it looks like the API is not returning the yesterday value.
If true; the channel name should be renamed as "day before yesterday".

@lolodomo
Copy link
Contributor Author

@clinique : WDYT ?

@lolodomo
Copy link
Contributor Author

If I restart the binding now, value from yesterday is now ok.
My current hypothesis is that the value from Monday was not returned by the API called Wednesday at 05am.
I will have to log the JSON content to confirm that tomorrow morning.

@lolodomo
Copy link
Contributor Author

lolodomo commented Dec 15, 2020

If this is confirmed, the solution would be to ignore the result of the request when the value from yesterday is not provided and then let the binding try again later in the day. The check frequency should then be increased a little like a try every 2 hours.

@lolodomo
Copy link
Contributor Author

At 5 in the morning, the value returned by the API for yesterday is NaN (and the current week value of course does not include yesterday).
The solution I plan to implement is to detect the NaN for the last day value in the API response and in this case to ignore this API response and trigger a new refresh later in the day.

lolodomo added a commit to lolodomo/openhab-addons that referenced this issue Dec 18, 2020
Fix openhab#9386

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
lolodomo added a commit to lolodomo/openhab-addons that referenced this issue Dec 18, 2020
Fix openhab#9386

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
cpmeister pushed a commit that referenced this issue Dec 29, 2020
* [linky] Handle case when data from yesterday is still NaN

Fix #9386
* Refresh every 2 hours until data from yesterday are available
* Log yesterday even for month and year requests

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
thinkingstone pushed a commit to thinkingstone/openhab-addons that referenced this issue Nov 7, 2021
* [linky] Handle case when data from yesterday is still NaN

Fix openhab#9386
* Refresh every 2 hours until data from yesterday are available
* Log yesterday even for month and year requests

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this issue May 5, 2022
* [linky] Handle case when data from yesterday is still NaN

Fix openhab#9386
* Refresh every 2 hours until data from yesterday are available
* Log yesterday even for month and year requests

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
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.

1 participant