#How to get the automations.yaml via API?

1 messages · Page 1 of 1 (latest)

high jetty
royal quartz
#

I'm pretty sure you can't via the REST API

#

And HA generally doesn't care where automations are located as long as they're included or are in a package. Only the UI cares

#

So perhaps you're asking how to get all the automations somehow?

high jetty
#

I would like to write code to create the automations. Before I start automating the creation of automations, I'd like to be able to quickly get the current config(s) to validate or check into git. I know HA has it's own backup system and I use it, but I thought it'd be straight forward to get the entire config.

#

Should I just enable ssh and scp them over? How are people using external IDEs or writing code to create or version control their automations?

royal quartz
#

It's much more straightforward to simply make a backup of the config directory than trying to extract it from the API

#

And generating the YAML directly into an included file or package is much more straightforward than trying to build an automation from the API

#

And if you want to use the API, it will be the websockets API and not the REST API

high jetty
#

Thanks RobC, and when you say make a backup. You mean calling a function inside HA to create the backup in the HA filesystem (I'm running HAOS on a vm).

Or do you mean simply expose the filesystem outside of HAOS and copy the dir myself?

high jetty
#

Ok, I just exposed the FS over samba. That will work.

#

RobC, curious why you say websockets? I don't need perisistant connections.