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

Double calculated values for absoulte humidity sensor #5

Closed
monotonus opened this issue Jul 16, 2019 · 12 comments
Closed

Double calculated values for absoulte humidity sensor #5

monotonus opened this issue Jul 16, 2019 · 12 comments
Labels
question Further information is requested

Comments

@monotonus
Copy link

I have an issue with the calculated absolute humidity on my balcony:

grafik

As you can see there are many strange spikes in the graph. These are double values in the same minute:

grafik
grafik

I don't know why this just occurs there that often. For the indoor sensors it does'nt have these spikes. Maybe because there are not that much changes than outdoor?

grafik

The sensors are all Xiaomi Temperature and Humidty sensors without pressure (the round ones).

Any idea?

@NovDavid
Copy link

NovDavid commented Dec 5, 2020

I have the same issue. I'm using the same sensor as you, via zigbee2mqtt. My theory is that hass updates the temperature and humidity values with a little time difference, but fires an update of the absolute humidity for both, hence the duplicate data points in absolute humidity, with the first being incorrect.
I didn't debug it though,so it's just a theory, and I haven't yet come up with a solution either.

@rautesamtr
Copy link
Collaborator

Maybe an optional poll mode could work around this. Basically sacrificing responsiveness for a smoother graph.

rautesamtr referenced this issue in rautesamtr/thermal_comfort Jan 15, 2022
This adds an optional poll mode wich can be enabled through a platform
configuration variable in yaml. This is implemented to avoid issues such
as #5
rautesamtr referenced this issue in rautesamtr/thermal_comfort Jan 15, 2022
This adds an optional poll mode wich can be enabled through a platform
configuration variable in yaml. This is implemented to avoid issues such
as #5
rautesamtr added a commit that referenced this issue Jan 15, 2022
This adds an optional poll mode wich can be enabled through a platform
configuration variable in yaml. This is implemented to avoid issues such
as #5
@rautesamtr
Copy link
Collaborator

rautesamtr commented Jan 15, 2022

Could you both give 30c5511 a try if using poll mode fixes the issue for you?
You have to enable polling in your yaml config to enable it and use a scan_interval that avoids those duplicate entries.
e.g.

sensor:
  - platform: thermal_comfort
    poll: true
    scan_interval: 300
    sensors:
      livingroom:
        friendly_name: Living Room
        temperature_sensor: sensor.temperature_livingroom
        humidity_sensor: sensor.humidity_livingroom

@rautesamtr rautesamtr added the question Further information is requested label Jan 15, 2022
@rautesamtr
Copy link
Collaborator

Closing this for now.

@tetsuo55
Copy link

tetsuo55 commented Jan 28, 2022

@rautesamtr the way @lymanepp solved it for me was by adding a change threshold, this way the double calculated value would be dropped and not written to the database.

Unfortunately his repo has been force pushed but i have the snippet of code here

new_state = self._calc_simmer_danger()

if new_state == self._state:
    return False

if (
    isinstance(new_state, float)
    and isinstance(self._state, float)
    and abs(new_state - self._state) < self._change_threshold
):
    _LOGGER.debug(
        f"Suppressed {self._name} update less than {self._change_threshold} - new: {new_state} current: {self._state}",
    )
    return False

Mark-up is not working (Fixed for you)

@lymanepp
Copy link
Contributor

@tetsuo55,

Now that this repo has SSI, I don't need to maintain a fork. But I restored my repo to https://github.com/lymanepp/thermal_comfort_archived.

@tetsuo55
Copy link

tetsuo55 commented Feb 1, 2022

@tetsuo55,

Now that this repo has SSI, I don't need to maintain a fork. But I restored my repo to https://github.com/lymanepp/thermal_comfort_archived.
Thanks
@rautesamtr is there enough information here to fix this issue in this repo?

@lymanepp
Copy link
Contributor

lymanepp commented Feb 1, 2022

@rautesamtr is there enough information here to fix this issue in this repo?

@tetsuo55, have you tried using polling?

@tetsuo55
Copy link

tetsuo55 commented Feb 1, 2022

@rautesamtr is there enough information here to fix this issue in this repo?

@tetsuo55, have you tried using polling?

No i don't want to switch until im sure it works because I'll lose history

@rautesamtr
Copy link
Collaborator

@tetsuo55 what offset did you actually use? i am looking at home assistant significant_change feature which basically sets tresholds for what is a significant change (e.g. default for °C is 0.5) but i am not sure yet how users can properly user that feature.

@lymanepp
Copy link
Contributor

lymanepp commented Feb 1, 2022

@tetsuo55 what offset did you actually use? i am looking at home assistant significant_change feature which basically sets tresholds for what is a significant change (e.g. default for °C is 0.5) but i am not sure yet how users can properly user that feature.

I was using 0.1 as the threshold for changes.

@tetsuo55
Copy link

tetsuo55 commented Feb 2, 2022

@tetsuo55 what offset did you actually use? i am looking at home assistant significant_change feature which basically sets tresholds for what is a significant change (e.g. default for °C is 0.5) but i am not sure yet how users can properly user that feature.

I was using 0.1 but maybe 0.05 would have been better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants