Kibana for weather station


#1

Hi there,

I am in the middle of building weather station based on Raspberry Pi and couple of sensors.
I succesfully sent logs from RPi to logstash and logstash resend them to elasticsearch.
First of all I am configuring temperature and humidity. I send them to elasticsearch as float type:

%{NUMBER:temperature:float} %{NUMBER:humidity:float}

Both are visible in Kibana as numeric filed

The thing is I would like to display temperature, humidity and other weather parameters as gauge:

First problem is: this avarage from temperature. Is it possible to display last temperature field from message? Not avarage from timeframe but last value from temperature field from latest message received?

Second problem: why I cannot set -25? :slight_smile: Temperature can be below 0*C :wink:

Could you help me with solving my problems?
Appreciate your help!


(Marius Dragomir) #2

Hello,

Displaying the latest value in the bucket is a bit non-intuitive, but it can be done like this:

Metric Aggregation: Top Hit
Field: temperature
Aggregate with: concatenate
Size: 1
Sort on: @timestamp
Order: Descending

As for allowing negative values in the Goal/Gauge visualizations I am surprised that it isn't allowed. You should add an enhancement request here: https://github.com/elastic/kibana
I will follow up on it as well, as it seems like a low hanging fruit and it should be a quick fix.

Also, very cool project, Kudos!


(Lee Drengenberg) #3

Another thing that you could do for the last value is to have logstash write to 2 indices.

One of those indices is the time-based index you are currently using which has values and a timestamp and each new doc is inserted into the index.

The other one would be a non-time-based index and it would only hold 1 doc that has the current temp and humidity and logstash would just do an update on that single doc.


#4

What if I do not have concatenate? :frowning:


My Kibana is 5.6.5
Build 15592, Commit SHA 80f98787


(Marius Dragomir) #5

As long as you don't have multiple documents with the same value for the timestamp, you should be fine with any of those in the list.


#6

What if it does not show anything? :frowning: What am I doing wrong?
It looks the same even if I change avarage to max, min, sum.


#7

Eventually did it!

Had to create and save search first.
Search finds messages with temperature only.


(Marius Dragomir) #8

Fair enough. I didn't know how your documents look like. I've added an issue for negative numbers support here: https://github.com/elastic/kibana/issues/15987 and also made the developer of this viz aware of this issue.


#9

If someone is interested how outdoor unit looks like I present you the prototype:

I have all stuff to put it into professional case and build case for DHT22.

Kibana still does not allow negative values in visualization configuration but it displays negative values:


(system) #10

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.