Examples of writing/reading from local storage

Subject says it. I have a few state values in my app thay are populated over time. Is there a example or documented way to write out to or read from local storage. My thought is simply to give users a way to backup user created control data in my app.

What do you mean with "local storage"? The state object? File Manager? You can do pretty much anything the Groovy environment lets you do either way, though for the latter, you'll need the File Manager API, which is documented here: File Manager | Hubitat Documentation.

Keep in mind that users can also export apps, which will save all data, including state, so depending on what your goals are, there might not be a need for you to worry about this yourself. If you're looking for parts of your app (maybe like color actions alone can be exported/imported in the new Color Animation app?), I think you'll have to write your own import/export methods. But using JSON for that and either a Map or List in Groovy should be pretty straightforward given the built-in methods available for working with these data types.

The intention was to write a process to dump some maps into a flat file in the local storage. The file manager is likely what I was thinking, but perhaps your other points mean it isn't needed.

I will need to test those options to see what i can get that way