Import/Export CLI?

Hello,

Would it be possible to make scenes (in particular …) exportable/importable via a CLI-style interface or, failing that, via description files (in whatever format is most appropriate)? I have a bunch of identical detectors for which I want to create the same actions/scenes without having to click to create/duplicate/modify, being more comfortable with vi/sed than with the mouse :stuck_out_tongue:

Thanks in advance for your thoughts on the matter,
Have a nice rest of the day,
Jean

Hi @jean_bruder :slight_smile:

In Gladys, everything is API so you can already build yourself a small CLI for this kind of operation.

The API documentation is available here :

Ask an AI to code you a small CLI from that documentation, in my opinion in a single prompt it will give you something that works perfectly, I had already done that last year:

If you need help, don’t hesitate!

1 Like

@jean_bruder So you made it then? :slight_smile:

I’m following up — has anyone made an import/export module for scenes?

???

I’m following up

I managed to recover my API key but after that I’m completely stuck on how to retrieve the scenes

and of course how to reinject them afterwards — I don’t know how to go about it

But first of all, retrieving them

I don’t know if you saw this tutorial: Télécharger un CSV des valeurs historiques d'un capteur?

You can follow it to understand the general idea, but call the request to fetch the scenes instead:

http://YOUR_LOCAL_GLADYS_URL/api/v1/scene

(Source: Documentation → Gladys Assistant REST API documentation )

Ok thanks, I’ll take a look as soon as I have 5 minutes.