Export persistence data to csv or txt

TL:DR: How to export values from a channel to a file?

Long version:
I have a temperature sensor that is giving a funny results. It’s an industrial 4…20mA sensor connected to VMB4AN velbus input module. The sensor with integrated transmitter range is 0 to 100 deg, C. I do not know what is the resolution of the DAC converter in VMB4AN module. What I see is below. I need the data to do some analysis to see what I can really get from that sensor - module set. There is some kind of quantisation or rounding to 0.5 deg C, but not always and it confuses me a bit.

I’m OK with any method to export the data (UI, OH command line, linux). . I tried to play with a static csv.html file method from github, but it didn’t work, so I won’t be sharing the link.

1 Like

What database?

If it’s external (e.g. InfluxDB) you’ll have to look at the docs for the database you are using for how to export the data.

If it’s an internal dabase, mainly rrd4j, you are somewhat out of luck for something easy. You’ll need to query the REST API to dump the values between the date/times you care about which will give you a big JSON document. Then you’ll need to write something to translate the JSON to CSV, though at that point you should look to see if you can use the JSON instead of converting it.

1 Like

Thank you!!! “Leave blank for default” is my database :slight_smile: I might try to generate a large graph and stick to the graphical analysis and tapping the wires…

You can gather the data as JSON from the REST API. Just check out the persistence/ endpoints in the API explorer in the developer tools of Main UI.
The JSON data uses UNIX epoch timestamps.

You could use ChatGPT to write yourself a little script to convert the JSON to CSV I guess.

1 Like