Traces – storage location / how to download?

Where are automation traces stored? Can I simply browse to a folder and find the JSON files, or are they stored in a database? If the latter, is there any way to download them without going through the visual editor?

I am developing a blueprint/automation which fetches a large chunk of data, namely a YouTube page. No I cannot do this any other way unfortunately, as YouTube removed the parts that I need to access for this automation (the history feed) from their API years ago.

Looking at traces kinda sorta worked earlier during development, but something has caused the interface to completely break now. For the automation runs where the trigger passes all conditions to perform the actions, the whole traces UI is simply completely blank. For some reason this also makes the Download trace option in the … menu greyed out!

My belief is that the issue is something like escaping of variable strings not being done correctly/not in a completely safe way. It looked like sometimes part of the HTML I am downloading through RESTful Command was inserted in a way that the browser tries to render parts of it. Can’t tell now though as it is all blank!

Also: Are there any good (free) third party tools for visualizing traces? I guess something like a decent visual JSON editor alone would be an improvement, a VSCode plugin perhaps…?

After restarting everything, I can now view traces again. Still would like to know where they are stored and if you’ve found better ways to analyze them though!

Edit: Broke again, so… yeah. Where are those traces stored? :roll_eyes:

They are in JSON in the ,storage.
If you use the search in VSCode you can see them, and then see the path.

image

Eventually traced the blackouts to a faulty template. I had fed unexpected data into zip() and somehow this caused the whole UI to break? Super weird. Wonder what would happen if I feed a similar zip into Developer Tools > Template…

They seem (at least on my HAOS installation) be in /config/.storage/trace.saved_traces but they are all in one big file. Would’ve been neat if there was a better visualizer to feed this into than the one in HASS itself, with both tree and code views and popups to watch the results/values of every expression…