Should service "cast.show_lovelace_view" be admin-only?

I was in the same situation and created a restful command for it.

  1. As an administrator, issue a long-live access token
  2. Create a restful command in the configuration.yaml:
rest_command:
  privileged_show_lovelace_view:
    url: http://localhost:8123/api/services/cast/show_lovelace_view
      method: post
      headers:
        authorization: !secret api_admin_showlovelaceview_token
      content_type: "application/json; charset=utf-8"
      payload: '{
          "entity_id": "{{ entity_id }}",
          "dashboard_path": "{{ dashboard_path }}",
          "view_path": "{{ view_path }}"
        }'
  1. Put the issued token in the secrets.yaml
  2. In the cards’ YAML, replace all cast.show_lovelace_view to rest_command.privileged_show_lovelace_view

This should allow non administrators to cast dashboard views now.

1 Like