# Kibana for weather station

**URL:** <https://discuss.elastic.co/t/kibana-for-weather-station/114909>\
**Category:** Kibana\
**Created:** [January 10, 2018, 3:41pm UTC](https://discuss.elastic.co/t/kibana-for-weather-station/114909 "2018-01-10T15:41:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![bk10](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@bk10](https://discuss.elastic.co/u/bk10)\
**Post date:** [January 10, 2018, 3:41pm UTC](https://discuss.elastic.co/t/kibana-for-weather-station/114909/1 "2018-01-10T15:41:38Z")

</div>

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

 ![1](https://us1.discourse-cdn.com/elastic/original/3X/0/8/0803a2fb8186d1502acdb9370c95a68069ed18e8.PNG)

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

 ![2](https://us1.discourse-cdn.com/elastic/original/3X/7/b/7b1f2b19311e6884e8b94c24510622dd9bb77071.PNG)

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? 🙂 Temperature can be below 0\*C 😉

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

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [January 10, 2018, 6:26pm UTC](https://discuss.elastic.co/t/kibana-for-weather-station/114909/2 "2018-01-10T18:26:16Z")

</div>

Hello,

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

```auto
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](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!

---

<div class="post-metadata">

**Author:** ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)\
**Post date:** [January 10, 2018, 6:31pm UTC](https://discuss.elastic.co/t/kibana-for-weather-station/114909/3 "2018-01-10T18:31:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bk10](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@bk10](https://discuss.elastic.co/u/bk10)\
**Post date:** [January 10, 2018, 7:19pm UTC](https://discuss.elastic.co/t/kibana-for-weather-station/114909/4 "2018-01-10T19:19:13Z")

</div>

What if I do not have concatenate? ☹

 ![4](https://us1.discourse-cdn.com/elastic/original/3X/0/1/015397709f11f1ed47232eb26a2b416c9a31aadb.PNG)  
My Kibana is 5.6.5  
Build 15592, Commit SHA 80f98787

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [January 10, 2018, 7:23pm UTC](https://discuss.elastic.co/t/kibana-for-weather-station/114909/5 "2018-01-10T19:23:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bk10](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@bk10](https://discuss.elastic.co/u/bk10)\
**Post date:** [January 10, 2018, 7:45pm UTC](https://discuss.elastic.co/t/kibana-for-weather-station/114909/6 "2018-01-10T19:45:30Z")

</div>

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

 ![5](https://us1.discourse-cdn.com/elastic/original/3X/7/a/7af7206b944a948f747a9cf5cd10b6ea5a79940d.PNG)

---

<div class="post-metadata">

**Author:** ![bk10](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@bk10](https://discuss.elastic.co/u/bk10)\
**Post date:** [January 11, 2018, 2:03am UTC](https://discuss.elastic.co/t/kibana-for-weather-station/114909/7 "2018-01-11T02:03:45Z")

</div>

Eventually did it!

 ![6](https://us1.discourse-cdn.com/elastic/original/3X/b/7/b720ad355719444bbea700e32d88db23482dd156.PNG)

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

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [January 11, 2018, 1:13pm UTC](https://discuss.elastic.co/t/kibana-for-weather-station/114909/8 "2018-01-11T13:13:07Z")

</div>

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](https://github.com/elastic/kibana/issues/15987) and also made the developer of this viz aware of this issue.

---

<div class="post-metadata">

**Author:** ![bk10](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@bk10](https://discuss.elastic.co/u/bk10)\
**Post date:** [February 2, 2018, 8:34pm UTC](https://discuss.elastic.co/t/kibana-for-weather-station/114909/9 "2018-02-02T20:34:29Z")

</div>

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

 ![outdoor](https://us1.discourse-cdn.com/elastic/original/3X/d/4/d430f2c617ecc4c2720ecc690c040c8fca5741ca.jpg)

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:

 ![10](https://us1.discourse-cdn.com/elastic/original/3X/3/c/3c2c3e9a1086ccb9ee03595fbfb713e18dd84a14.PNG)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 2, 2018, 8:34pm UTC](https://discuss.elastic.co/t/kibana-for-weather-station/114909/10 "2018-03-02T20:34:35Z")

</div>

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