Skip to content
This repository has been archived by the owner on Dec 8, 2019. It is now read-only.

temperature and heatIndex values on first boot up #36

Open
ericstewart22 opened this issue Aug 26, 2017 · 5 comments
Open

temperature and heatIndex values on first boot up #36

ericstewart22 opened this issue Aug 26, 2017 · 5 comments

Comments

@ericstewart22
Copy link

Hello,

Whenever I unplug my sensor or it loses power, the temperature and heatIndex values default to 0 and get sent to my MQTT broker which then makes its way into Home Assistant and results in a spike in the charts.

Here's an example of what it looks like:
image

I tried adjusting the calibrationTime variable but that didn't work. What would be the recommended way to fix this? Is it as simple as using a counter to disregard the first few MQTT values? If it is then maybe I can try and fix it myself, but I thought there might be a better way.

@VegasIOT
Copy link
Contributor

I added this to the SendState void function. I basically doesn't send if its below 1. I'm sure something more elegant like just sending a NULL would be better but this works for me

if (tempValue<1) {
Serial.println("less than 1");
}
else {
Serial.println(buffer);
client.publish(light_state_topic, buffer, true);

@kwinck
Copy link

kwinck commented Aug 29, 2017

My take on that issue is to have a timer, that ensures that it doesn't send any values the first 30 sec. or so, ie. until the calibration period is done.

@ericstewart22
Copy link
Author

ericstewart22 commented Aug 31, 2017

Thanks for the input, After some testing I'm going to use humValue < 1 for now since it seems to be the last thing to calibrate. I'll try my hand at using a timer when I have more time.

DanielXYZ2000 added a commit to DanielXYZ2000/ESP-MQTT-JSON-Multisensor that referenced this issue Oct 15, 2017
@lassivv
Copy link

lassivv commented Oct 23, 2017

Same problem and try add capacitor on power line and better 5volt supply power, nothing help not know why sensor restart/softstart every day random couple times.

After that i add this code in first rows sendstate function and everything works perfectly after that. T


byte countSentStates = 0;

  if(countSentStates <= 2)
  {
    countSentStates++;
    return;
  }

Code just ignore 3first mqtt sends and after that sends every mqtt messages normally.

@mr-sneezy
Copy link

mr-sneezy commented Apr 26, 2018

lassivv, I get these dropouts also, on two sensornodes. It seems to be a random reset from something unknown. It's not power related as I've covered that through elimination and also adding large fiters caps (1800uF) to the 5V input of the NodeMCU's just in case.
My graphs of 24 hour data look very like yours with data dropouts to below zero on temp and humidity when these events occur.
When it does this the RGB LED also goes to blue and stays that way till I send a "White' colour to it and then 'Off' via HA Light component GUI.
PS. I wonder a bit if it's something to do with a bad choice of ESP8266 NodeMCU settings in the Arduino IDE when compiling and flashing...

Update:
I've compiled DanielXYZ2000's master branch and it has resolved the random crap HA data value spikes (after random MCU resets) and also the blue led 'mind of it's own' issue.
Why wouldn't these fixes get pulled in to master ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants