ChipChop Support Forum
Log in
Log out
Join the forum
My Details
REPLIES: 6
VIEWS: 185
BACK
REPLY TO THIS POST
TomaszB
05 Jul 2024
Components value history (chart)
I've started experimenting with ChipChop recently, so probably the answer for my question will be RTFM :-).
Question: Is there any method to show history of component values (preferably in a form of chart) in WebApp? Example: I need a graph of temperature changes over the last 24h rather than the last value only.
Gizmo
05 Jul 2024

Hi Mr T,

I think what you are looking for is the component heartbeat log.

You can log up to 3 components per device in 10,30,60 min & 24 hrs intervals. It's in the components panels labeled Heartbeat Log



If it's activated ChipChop will automatically log the status for that component on the specified interval. There is a log size restriction but for small values like temperature you could probably have at any point around 2 weeks of data at 10 mins intervals (around 144 entries per day)

Once working you will find a "Log" button appear for in the app in the device details panel


I haven't implemented yet a graph on the phone (I will get there eventually)

If you go view the log in the Dev Console > Live Control then if the values are numeric you will also get a graph that you can zoom in/out and rollover to see the exact values



Here is the link for the post with some more info https://forum.chipchop.io/post/219/

Let me know if you need any help setting it up



Attached images
TomaszB
05 Jul 2024

Hi Gizmo

Thanks for the instant and complete reply. Now it is 100% clear.

Tomasz
Riccardo
06 Sep 2024

Hi A question to Gizmo about this topic.
I noticed a timing mismatch (2 hrs) from the graph representation and the log.
Second question is there a way to have the graph in the mobile view.
Thanks
Gizmo
07 Sep 2024

Hi Riccardo,

Well spotted, it seems that it's not a log data issue but a timezone discrepancy between the graph and the text log.
There is a lot of timezone conversions on the fly to show you the correct timestamp based on where your device is and it seems that the graph component has a mind of its own :-)
I'll look into it as soon as I can and hopefully it shouldn't be too difficult to adjust.

The graph on the phone is on my list, I have started on it but I had a snag with the touch vs. mouse controls of the graph as the phone screen is so small and fingers are big so I may have to sacrifice the zoom in slider and see if I can implement zoom buttons. I'll get there, just need to find a clear day when I can just focus on that.
Gizmo
08 Sep 2024

Hi Riccardo,

Did I ever mention that I hate working with timezones! ☠️

Anyway, it's done now and the graph should be in sync with the timestamps in the log.

As I was messing with the graph I've also got it working on the phone 😃, I can't guarantee that the "zoom/scroll bar" (under the graph) will work interactively on every phone browser, it's just the little drag handles that allow you to "zoom" into the log may not respond to everyone's finger but I've included a [+] [-] buttons so you can also zoom into the graph by using those.

Notes

1. The graph view will automatically appear if the log data is purely numeric, if the log contains any text values then it will only show as a text view

2. There are two icons/buttons under the log title that you can use to switch between the graph & text view

Let me know if you find any problems or something not working on your phone

Enjoy

G
Riccardo
09 Sep 2024

Hi Gizmo,
THANKS!
it works perfectly