How to exchange automations and scripts using the forum

Users often feel the urge to exchange automations or scripts for sharing, guidance or debugging.

To do so, using screenshots is NOT the correct way.

Basically, the automation and script GUIs are nothing more then a YAML generator, and the forum is very capable of working with that. Therefore the preferred way of exchanging automations or scripts is to use YAML.

The below examples use the automation editor, but the script editor works the same way.

How to export an automation or script to the forum:

  • From within the automation or script editor, select the three little dots in the upper right corner, and choose ‘Edit in YAML’.
  • Select the whole text, and copy it to your clipboard.
  • Open a post in the forum (or start a new topic), hit the

    and paste the content of your clipboard there.
  • That’s it, you have copied your automation or script to the forum.

How to import an automation or script from the forum:

  • On the forum, you will find a copy button on the upper right corner of the pre-formatted text field (the double file icon), hit it and the automation or script will be copied to your clipboard:
  • In your HomeAssistant, open a new automation or script, using the 3 dots again, switch to ‘Edit in YAML’
  • Delete all text present.
  • Paste the contents of your clipboard.
  • In most cases you can now switch back to ‘Edit in visual editor.

    I say most, as the gui doesn’t handle templates very well (yet).
  • Make required changes (if any) and save the automation.
  • That’s it, you have imported an automation or script from the forum into your HomeAssistant.

The Home Assistant Cookbook - Index.

6 Likes

Ha… I actually just had to do this a few minutes ago and realized that on my iPad, copying and pasting yaml to and from the HA companion app SUCKS. It formats it with tons of %20 (spaces) and just wrecks the whole thing. Finally had to switch over to my desktop to get it working right.

Yeah, I noted, it bothers me as well.
I apply the same method, switch back to a proper browser on my laptop :wink:

1 Like

Did you put it into the index?
I just use code server but this would be handy for those afraid of that.

Just a note that this applies to scripts as well, should the title be changed to reflect that?

1 Like

Its a wiki, be my guest :wink:

1 Like

Right… just found out, do not use the copy option , but use share —> copy option :grin:

1 Like

Seriously? That simple?! :man_facepalming: