GUI Script Creation

I found a fairly basic script to trigger Kodi to update it’s Library. I’d like to use an entity button to start the scan but I need to get the script in place first.

Here is the samle script:

script:
  update_library:
    alias: Update Kodi Library
    sequence:
      - alias: Call Kodi update
        service: kodi.call_method
        data:
          entity_id: media_player.kodi
          method: VideoLibrary.Scan

But when I try to take this and use the GUI to create it I am stumped.

The Name is pretty easy, the Entity ID is even easier (auto populate) and I assume for Mode I want Single (default)

It’s the sequence section that I run into problems

Action Type: Call Service (I assume)
Service: kodi.call_method
Which then give me a “Names of the Kodi entities where to run the API method” which I put in my Media_player.kodi

Then there is Service data which I filled in with “VideoLibrary.Scan”

When I try to save them I get this error message,
“Message malformed: expected dict for dictionary value @ data[‘sequence’][0][‘data’]”

I believe you need all this:

entity_id: media_player.kodi
method: VideoLibrary.Scan

So I put that in the service data field?

I’m not sure why the yaml script terms and the GUI fields don’t align

Yes.

If you want yaml then just open the file and copy paste it there

I was looking to use the GUI but it I popped to CLI and did it that way.

60 seconds to type out or 60 minutes trying to figure out the GUI…