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

Offset problems #1154

Closed
cosmo84 opened this issue Jan 20, 2019 · 5 comments
Closed

Offset problems #1154

cosmo84 opened this issue Jan 20, 2019 · 5 comments

Comments

@cosmo84
Copy link
Contributor

cosmo84 commented Jan 20, 2019

Referring to #763 I have set an offset of -2 degrees for one of my Xiaomi temperature sensors. The offset itself is working, but it is not respected every few updates, see the following logs:

[1/20/2019, 6:32:26 AM] [Phillips Hue] Draußen: set homekit temperature from -0.4°C to -2.3°C
[1/20/2019, 6:42:32 AM] [Phillips Hue] Draußen: set homekit temperature from -2.3°C to -0.4°C
[1/20/2019, 7:13:28 AM] [Phillips Hue] Draußen: set homekit temperature from -0.4°C to -2.5°C
[1/20/2019, 7:38:32 AM] [Phillips Hue] Draußen: set homekit temperature from -2.5°C to -0.5°C

So it seems only every second measuring is with the offset

@ebaauw
Copy link
Collaborator

ebaauw commented Jan 20, 2019

Looking at the code, config.offset is ignored when updating state.temperature (or state.humididy) from the Xiaomi special report. Note that it should not be applied when updating config.temperature, but likely config.offset wouldn’t be present anyways for those resources.

@cosmo84
Copy link
Contributor Author

cosmo84 commented Jan 20, 2019

Sorry, I don‘t get the point yet. Am I using the offset in a wrong way, or is it not intended to work like this at all?

@ebaauw
Copy link
Collaborator

ebaauw commented Jan 20, 2019

No, sorry, there's an omission in de REST API plugin. Preparing a fix...

@cosmo84
Copy link
Contributor Author

cosmo84 commented Jan 20, 2019

All right, thanks a lot.

manup pushed a commit that referenced this issue Jan 20, 2019
- Apply `config.offset` when updating `state.temperature` or `state.humidity`, see #1154;
- Also update etag and save to database when only `config.reachable`, `config.battery`, and/or `state.lastupdated` are updated;
- Issue event when `state.lastupdated` is updated to fire rules based on `state.lastupdated`.
@manup
Copy link
Member

manup commented Jan 20, 2019

Please checkout if it works now with 2.05.57, closing the issue for now.

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

No branches or pull requests

3 participants