# Displaying sensor curves on the dashboard

**URL:** <https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535>\
**Category:** Demandes livrées\
**Created:** [September 20, 2021, 5:54am UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535 "2021-09-20T05:54:00Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![cicoub13](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/cicoub13/32/4482_2.png) [@cicoub13](https://community.gladysassistant.com/u/cicoub13)\
**Post date:** [September 24, 2021, 8:09am UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/21 "2021-09-24T08:09:36Z")

</div>

Some feedback:

- about 4 minutes to perform the 3 aggregations (3 months, about a dozen devices) 🚀
- the widget on the dashboard is very easy to understand and use 👏, it is also very responsive, regardless of the interval chosen
- same comment from @VonOx about the title. If it’s a field with autofill, it should be placed after the device selection. Otherwise, it’s frustrating to enter something and have it automatically replaced
- when there are no values, «&nbsp;interval&nbsp;» is written as «&nbsp;intervalle&nbsp;» in French 😉
- same comment from @VonOx about the time display for «&nbsp;Last 24h&nbsp;» (there’s a missing S, by the way)

Great job anyway, it’s a great feature

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [September 24, 2021, 8:19am UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/22 "2021-09-24T08:19:20Z")

</div>

Thanks for the feedback @cicoub13, that makes sense!

I’ll take note.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [September 24, 2021, 8:30am UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/23 "2021-09-24T08:30:52Z")

</div>

> [@cicoub13](#):
>
> Same comment from @VonOx about the title. If it’s a field with autofill, it should be placed after the device selection. Otherwise, it’s frustrating to enter something and have it automatically replaced

Yes, I agree, it’s really annoying if it’s first of all 😅

I fixed it by putting the title at the end (it makes more sense), and I removed the autofill, it’s up to the user to choose a name.

[https://streamable.com/iz71ny](https://streamable.com/iz71ny)

> [@cicoub13](#):
>
> When there are no values, «&nbsp;interval&nbsp;» is written as «&nbsp;intervalle&nbsp;» in French 😉

Fixed 🙂

> [@cicoub13](#):
>
> Same comment as @VonOx about the time display for «&nbsp;Last 24h&nbsp;» (it’s missing an S by the way)

I’ll fix it!

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [September 24, 2021, 8:49am UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/24 "2021-09-24T08:49:27Z")

</div>

@cicoub13 are you on Raspberry?

---

<div class="post-metadata">

**Author:** ![cicoub13](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/cicoub13/32/4482_2.png) [@cicoub13](https://community.gladysassistant.com/u/cicoub13)\
**Post date:** [September 24, 2021, 9:08am UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/25 "2021-09-24T09:08:24Z")

</div>

No, on a MacBook Pro 🙃 so performances to be nuanced. Is there a Docker image available?

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [September 24, 2021, 9:09am UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/26 "2021-09-24T09:09:33Z")

</div>

No, but it surprised me for 4 minutes

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [September 27, 2021, 1:12am UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/27 "2021-09-27T01:12:24Z")

</div>

> [@cicoub13](#):
>
> No, on a MacBook Pro 🙃 so performance to be tempered.

In my opinion, it’s the SSD disk part of the MacBook Pro that is fast, because it’s almost all disk in the end (reading/sampling but it’s quite fast/writing). So if you have a good SSD on your Pi, it should also be good in terms of performance in my opinion 🙂

> [@cicoub13](#):
>
> Is there a Docker image available?

I’ll build an image 🙂

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [September 27, 2021, 2:41am UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/28 "2021-09-27T02:41:08Z")

</div>

> [@VonOx](#):
>
> I must admit I’m not sure how I ended up with this ^^  
> ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/a/afcd053c0f574343dce48413a70f824fa2c22599.png)
> 
> I set the value back to 90

I have the answer to this riddle, it’s quite simple: -1 is supposed to represent the «&nbsp;unlimited&nbsp;» value, that’s what is defined in the signup code when you click on the «&nbsp;unlimited&nbsp;» radio button.

The issue is that there was a double bug in the code and in the tests that made this -1 value never work…

Here’s what happened:

- «&nbsp;-1&nbsp;» behaved as if you wanted to keep only the states older than «&nbsp;1 day in the future&nbsp;» (NOW - (-1) = TOMORROW) 😱 There was no if(-1) to block the state purge, I think I must have forgotten when coding it. As we weren’t using sensor values from the past yet, it wasn’t noticed. What surprises me is that I think @Terdious has an unlimited history on his instance. Do you confirm @Terdious? I think you must have deliberately removed this variable from the DB, right?
- In the tests, a fairly silly mistake, I used fake.resolves() to mock the call to variable.getValue(), except that I misused fake.resolves() and so when I had to do my tests at the time, the -1 behaved as expected, because in short I ended up with a returned function instead of -1, and thus it prevented the purge, in short a very silly thing (it was at the very beginning of v4 about a year and a half ago I think :D)

I fixed the bug and added more robust tests to ensure it doesn’t break again.

In the UI, there is now the possibility to modify the value in the settings:

 ![Screenshot 2021-09-27 at 10.31.24](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/c/c36775706dc96ed7b7a63e33d1379a3e82492e16.png)

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [September 27, 2021, 3:06am UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/29 "2021-09-27T03:06:56Z")

</div>

@cicoub13 @VonOx To resolve the issue with displaying the date on the «&nbsp;last hour&nbsp;» or «&nbsp;last 24h&nbsp;» view, I changed the default view. Now I format the time display in relative terms:

 ![Screenshot 2021-09-27 at 11.05.16](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/6/676e391653de6627b9198752a4e7a1d1c3d6d8da.png)

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [September 27, 2021, 4:58am UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/30 "2021-09-27T04:58:10Z")

</div>

New proposal for another type of display, the bar display.

Practical for certain types of devices such as «&nbsp;energy consumption&nbsp;», precipitation:

 ![Screenshot 2021-09-27 at 12.54.24](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/4/4b12d19c37bc8fa17f7f697b653784e9d3fd32f1.png)

For the display of axes, this will also be configurable when it makes sense 🙂

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [September 27, 2021, 5:35am UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/31 "2021-09-27T05:35:48Z")

</div>

Display «&nbsp;air&nbsp;» in Vue but with the axes shown:

 ![Screenshot 2021-09-27 at 13.32.48](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/6/6e3fe2c05b6d64f5eb9573f83a3000ddd3276bb0.png)

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [September 27, 2021, 5:40am UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/32 "2021-09-27T05:40:06Z")

</div>

"Display "line" with axes displayed:

 ![Screenshot 2021-09-27 at 13.39.36](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/c/cd46c1404f792d4a04acd646d300f2a8d827cc0c.png)"

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [September 27, 2021, 6:27am UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/33 "2021-09-27T06:27:41Z")

</div>

Display «&nbsp;straight line&nbsp;» (I don’t know how to translate this):

 ![Screenshot 2021-09-27 at 14.26.58](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/0/0b27c437c2787dab5d8dfc773b9a7f16f7c1c95f.png)

---

<div class="post-metadata">

**Author:** ![lmilcent](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lmilcent/32/7023_2.png) [@lmilcent](https://community.gladysassistant.com/u/lmilcent)\
**Post date:** [September 27, 2021, 7:07am UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/34 "2021-09-27T07:07:25Z")

</div>

This type of sensor can also be very useful for boolean sensors (presence sensors, opening sensors, etc.).

By the way, in the case of a presence sensor, how are the data displayed? «&nbsp;Presence detected between 2 PM and 3 PM&nbsp;» with a display of «&nbsp;1&nbsp;» on the curve and then «&nbsp;0&nbsp;» afterwards?

---

<div class="post-metadata">

**Author:** ![lmilcent](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lmilcent/32/7023_2.png) [@lmilcent](https://community.gladysassistant.com/u/lmilcent)\
**Post date:** [September 27, 2021, 7:09am UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/35 "2021-09-27T07:09:12Z")

</div>

> [@pierre-gilles](#):
>
> I’m going to build an image 🙂

Does it already exist or is it in the process of being created? I would like to test it 🙃

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [September 27, 2021, 7:37am UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/36 "2021-09-27T07:37:20Z")

</div>

> [@lmilcent](#):
>
> This type of sensor can also be very useful for boolean sensors (presence sensors, opening sensors, etc.).

Indeed!

> [@lmilcent](#):
>
> By the way, in the case of a presence sensor, how are the data displayed? «&nbsp;Presence detected between 2 pm and 3 pm&nbsp;» with a display of «&nbsp;1&nbsp;» on the curve and then «&nbsp;0&nbsp;» afterwards?

It depends on your presence sensor, whether it sends «&nbsp;0&nbsp;» values or not. If it only sends «&nbsp;1&nbsp;» values, it won’t move (even if you see the points, it won’t be very visual).

For presence sensors, I think a «&nbsp;heat map&nbsp;» display with presence/absence times would be better, like this: (so with only 2 colors)

 ![Screenshot 2021-09-27 at 15.33.40](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/8/8266a60696bbb63e79cb27ba69094fa0dce1ce71.png)

This is not included in this development, as it is quite different and specific to presence. We will need to discuss many points before starting this development as I think it is not as simple 🙂

> [@lmilcent](#):
>
> Does it already exist or is it being created? I would like to test it 🙃

Not yet, I was planning to build it at the end of the day after all my developments of the day, I will post a message here when the build is ready 🙂

In the meantime, everything is already in the PR on GitHub, but you need a development environment.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [September 27, 2021, 8:15am UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/37 "2021-09-27T08:15:46Z")

</div>

Build Docker in progress: [https://github.com/GladysAssistant/Gladys/runs/3717697450?check\_suite\_focus=true](https://github.com/GladysAssistant/Gladys/runs/3717697450?check_suite_focus=true)

The image will be available on the «&nbsp;chart&nbsp;» tag, i.e. `gladysassistant/gladys:chart`.

For reference:

> [@Lancer une image Gladys de test?](https://community.gladysassistant.com/t/lancer-une-image-gladys-de-test/6509/7?u=pierre-gilles):
>
> Alors si c’est dans un but uniquement de test (pas pour développer), il vaut mieux lancer une image Docker «&nbsp;en condition réelle&nbsp;» plutôt que de faire ça dans un environnement de développement (ce qui ne reflète pas vraiment la réalité et n’est pas forcément facile à mettre en place) Pour lancer une image Docker, c’est le même process que décrit sur la page d’installation de Gladys via Docker ( [Installation avec Docker | Gladys Assistant](https://gladysassistant.com/fr/docs/installation/docker) ), à savoir lancer un container Docker sur la machine ou …

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [September 27, 2021, 12:30pm UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/38 "2021-09-27T12:30:32Z")

</div>

For information, the Docker build is finished 🙂

Looking forward to all feedback!

---

<div class="post-metadata">

**Author:** ![lmilcent](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lmilcent/32/7023_2.png) [@lmilcent](https://community.gladysassistant.com/u/lmilcent)\
**Post date:** [September 27, 2021, 3:34pm UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/39 "2021-09-27T15:34:09Z")

</div>

> [@pierre-gilles](#):
>
> For the presence sensors, I think we should have a display like a “heat map” with the hours of presence/absence, something like this: (so with only 2 colors)
> 
> ![Screenshot 2021-09-27 at 15.33.40](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/8/8266a60696bbb63e79cb27ba69094fa0dce1ce71.png)

That’s a good idea!  
However, we should plan to leave the choice of the graph style, because sometimes I would like to know at what time I opened my door yesterday (for example), which this solution does not allow.

---

<div class="post-metadata">

**Author:** ![lmilcent](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lmilcent/32/7023_2.png) [@lmilcent](https://community.gladysassistant.com/u/lmilcent)\
**Post date:** [September 27, 2021, 3:43pm UTC](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535/40 "2021-09-27T15:43:02Z")

</div>

What are the current limitations?  
I thought I could display all types of values for the moment (even if the chart is not made for it), which is not the case (e.g., presence sensor, opening sensor).

Edit:

I just created two tests, which do not seem to work.

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/6/69de7cc9f39918e971e77113ded37d27a8a78db3.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/e/ece28ba10fda69f241eefb57c21209b345cebe3c.png)

BUT I realized that it’s because of `Display axes? = No`.

- `No` = Does not work
- `Yes` = Works

I suggest preselecting «&nbsp;Yes&nbsp;» by default for displaying axes.

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/e/e24361e3e3d057ba40804af17ff532be6e2ad1c0.png)

[Previous page](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535.md?page=1)

[Next page](https://community.gladysassistant.com/t/affichage-des-courbes-de-capteurs-sur-le-dashboard/6535.md?page=3)
