Use cast.show_lovelace_view in script

I am trying to use the feature for casting in a scipt, but recieve an error.

script:
‘1580725287208’:
alias: test
sequence:

  • data:
    view_path: Hub
    entity_id: media_player.hub
    service: cast.show_lovelace_view

this works fine when calling by hand from devtools - services, but gives an error from calling the script.

error:
Kan service script/1580725287208 niet aanroepen value should be a string for dictionary value @ data[‘entity_id’]

Any help?

Michael

adjust your spacing. See link for example.

Along with what silvrr said, please format your code properly. Otherwise we can’t see these spacing issues.

Use three backticks (```) above and below your code.

‘1580725287208’:
  alias: test
  sequence:
  - data:
      view_path: Hub
    entity_id: media_player.hub
    service: cast.show_lovelace_view
  alias: test
  sequence:
    - service: cast.show_lovelace_view
      data:
        view_path: Hub
        entity_id: media_player.hub