[APP][Pro] Insights Graphs

Is there a way to get a graph only over an amount of minutes/seconds I figured out with the app Flow Utilities?

I sent myself some graphs after someone took a shower (water, gas and power use, in future I want humidity also). With Flow Utilities I get the amount of time in seconds someone showered. Before and after I would like a couple of minutes, but nog 50 minutes, it makes the graph quite small.

So a time of the last X seconds (from a calculated variable) would be great, if possible :wink:

@Menno_van_Hout I get an error when I want to make a graph for the last 6 hours (error code 400). 1 hour works, but is to short in this case, 24 hours works also, but is way to long (power usage of dishwasher) to see something usefullā€¦

And as I mentioned in my previous message: Would like the option to set my own time/duration for the graphs. For some graphs half an hour is more then enough, but in this case I would like about 3 hours.
Are the durations of the graphs set by Athom? Or is it possible for you te edit it?

the durations are set by athom. As it uses the normal insights api.
for the 400 i am not sure i have to reproduce this myself in-order to fix this.

Lovely app! Thank you so much.
I got the watermeter graph working from Homewizard. Cant get the energymeter to work.
Im mismatching the tags i thinkā€¦ any idea?

Edited:
I indeed see that some durations do not work. 1H works, and then 24H, but not 6H in between.

2 Likes

@JMH, @Menno_van_Hout, @Timmm

I have the same issue, 6H doesnā€™t work.

I already asked Athom in the past to improve the Insights Graphs. It is very limited with the time selection and also the number of data points they keep (after one hour they already keep fewer data points available which makes the data not always useful). It seems they are still busy with other things, less urgency for this. :pensive:

image

Experimenting a bit with the app I was wondering how to delete images once created in the /userdata/ location. Are they ephemeral and available just during a flow execution or will they remain in the persistent storage of Homey forever? If so, how to delete/wipe those in case graphs are created with unique filenames repeatedly, i.e. not overwritten?

This count for all homey apps out there:

User data gets cleared on app reboot and on homey reboot.

Insight graphs overwrites images so based on the filename you choose.

1 Like

BTW: Thereā€™s a glitch in homey-insights-graphs/app.ts at main Ā· mennovanhout/homey-insights-graphs Ā· GitHub as thereā€™s a ā€œ!ā€ missing. Youā€™d append .png if the filename ends with .png, not only if missing.

Was wondering why i couldnā€™t find a ā€œgraph.pngā€ via (replace your Homey ip as in Persistent Storage - Homey Apps SDK) http://192.168.178.72/app/nl.mennovanhout.insights-graphs/userdata/graph.png as it was stored as http://192.168.178.72/app/nl.mennovanhout.insights-graphs/userdata/graph.png.png :wink:

HTH Michael

Hi,
I tried an app restart and even Homey restartā€¦ The images remain accessible when using Persistent Storage - Homey Apps SDK links.
Only after uninstalling/re-installing the app the image was gone and http://192.168.178.72/app/nl.mennovanhout.insights-graphs/userdata/graph.png.png returns ā€œCannot GET /app/nl.mennovanhout.insights-graphs/userdata/graph.png.pngā€

Are you sure that reboots should do the the trick? At least for me thatā€™s reproducable having it done twice (with Shift-Reload, of course).
Uninstall however yields: http://192.168.178.72/app/nl.mennovanhout.insights-graphs/userdata/graph.png.png ā€œNot Found: App with ID nl.mennovanhout.insights-graphsā€, followed by reinstall intermediate ā€œApp Not Readyā€, followed by ā€œCannot GET /app/nl.mennovanhout.insights-graphs/userdata/graph.png.pngā€ and finally after re-running the flow to create graph.png (or graph.png.png) finally shows the png in the browser.

Not really a big deal when overwriting images, but at least good to know if the filenames are created uniquely.

Regards,
Michael

Hey Michael,

According to homey self userdata gets removed on all app reboots and homey reboots.

You can actually confirm this by using the homey developer tools. So Iā€™m about 100% sure.

I think your browser is just using cache. Or something

Hi,

Same for curl even with no-caching options like curl -H ā€˜Cache-Control: no-cache, no-storeā€™ http://192.168.178.72/app/nl.mennovanhout.insights-graphs/userdata/graph.png.png

Probably it is or was intended that way or probably itā€™s intended for apps during dev-mode, but reality is differentā€¦ At least on my brand new Homey Pro 2023 with latest firmware.

Is there any documentation where I could look that up? Actually I find it quite sane to have a persistent storage to be ā€œpersistentā€ and not loose data during reboots or app updates/reboots unless really uninstalling something.
Probably Iā€™ll try the ssh connection or usb connectā€¦ Maybe I would see how things are mounted in the filesystem. If itā€™s really ephemeral /userdata should be somewhere below /tmp or ramdisk like.
You mentioned dev-tools, i.e. https://tools.developer.homey.app/tools/ ? Wouldnā€™t know where to find the storage data there as thereā€™s just memory and CPU in app profiling. Can you point me to the location?

Regards, Michael

I am in Spain for a couple of weeks I canā€™t really check anything right now

2 Likes

Enjoy!

Beyond jealous

After installation I see no flow cards? Does it only work with advanced flows?

HP23 with latest stable here.

1 Like

Advanced only. This is a limitation from homey because it generates an image

2 Likes

ahh thanks, had similar question, thanks for asking and answering

Is there an instruction somewhere on how this works? I have no idea how to send or view created graphs.

@Ralph_Z use advanced flows.

After using the Insights Grahps action card, you can use any messenger card with a image token.

IMG_4402

Hi @LRvdLinden, I made a flow, but I canā€™t find the ā€˜Graphā€™. Do you know where I can find that one? I executed the flow first, but still canā€™t find it.