InfluxDB and measurement spikes

I installed InfluxDB, Grafana and the InfluxDB component the other day and everything seemed to work just fine until this morning when one of my 433 MHz thermometers had a small hicup and sent a value in the -70 °C range. Obviously it was transferred to the database and is now wrecking my graphs. Is there a simple way of to filter out unreasonable values and stop them from going into the database? (if not, is there a simple way to delete them from the database?)

-70 centigrade might be reasonable in Siberia but not where I live in southern Sweden…

I was getting -800 and + 1000 from my wireless ds18b20s :slight_smile:

Here’s how I solved it:

Needless to say, this won’t remove the bad data from your database, but if all you care about is the graphs - this will do it.

3 Likes

Thanks, that’ll do for now.

From what I can find in google, it seems easier said than done to correct/erase individual values in an Influx database…

Now all I have to do is figure out why one of my thermometers isn’t registered in the database despite even if it’s whitelisted…

Indeed, influx can delete only based on time and it’s a huge PITA to delete bad data. First you have to query the database for the bad data, then you have to use a separate query for each bad input you have.

So how would one go about removing such a value?

> select * from "°C" where value < 20
name: °C
time                Last Update_str Sensor Id_str Station Id Station Name_str Zone Id_str attribution_str battery_level domain entity_id   friendly_name_str node_id power_consumption value  wake_up_interval
----                --------------- ------------- ---------- ---------------- ----------- --------------- ------------- ------ ---------   ----------------- ------- ----------------- -----  ----------------
1490253251434696960                                                                                                     sensor office_temp Office Temp                                 -142.9 

I can’t believe you can’t just delete in the same manner you select. Time series data doesn’t brake if you have missing entries.

No thanks to the documentation, I figured out that this worked:

delete from "°C" where time = 1490253251434696960

VERY frustrating start to using InfluxDB.

1 Like

Yeah, it’s a PITA. I’m thinking about going for @kirichkov’s solution in post 2 instead and filter those values out when generating graphs . I can then delete bad values at my own will while still keeping the graph Y axis from freaking out.

1 Like

I tried to add further filters to the SELECT but I couldn’t find a way to do it. All I could access were entity_id and domain. No other options.

Let me know if you figure it out.

I just typed AND, VALUE and so on manually in the fields:

I’m not sure that’s the correct way though, it doesn’t always save correctly when I do that.

Ahh! So that’s the trick.

Thanks.

I simply click the “+” icon and the drop down that shows “entity_id”, I type “value” followed by “TAB”. That adds the new condition and I can switch between “AND” / “OR” and the conditional can be changed between = , > , < , >= , <=

Yeah, that’s what I do too. The graph updates when I have completed the query but when I click Save dashboard nothing seems to happen, if I reload the page my changes are gone.