Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mode: parallel
- max_exceeded: silent
- description: This Script can be used by the LLM to initiate a playback on a TV
- fields:
- media_type:
- selector:
- select:
- options:
- - tvshow
- - movie
- name: Media Type
- description: >-
- This argument is mandatory and must always be provided no matter what!
- "media_type" can only be one of 2 different values: "movie" if the search
- is about a specific movie.- "tvshow" if the search is about a tv show
- serie.media_type is mandatory and must always be provided. In case a
- request does not match any of these types, for example when music from a
- specific genre is requested, then use "tvshow".
- required: true
- default: tvshow
- library_name:
- selector:
- select:
- options:
- - TV Shows
- - Movies
- name: Library Name
- description: >-
- "library_name" is the library the user wants to play the media from.
- 'Movies' for movies and 'TV Shows' for TV series
- required: true
- media_id:
- selector:
- text: null
- name: Media ID
- description: >-
- This argument is mandatory and must always be provided no matter what!
- media_id is the queried name
- - If the search is about a tv show: Then media_id is tv show title
- - If the search is about a movie: Then media_id is the movie title This is
- a mandatory argument and must always be provided.
- required: true
- media_player:
- selector:
- entity:
- filter:
- integration: cast
- multiple: false
- name: Media Player
- required: true
- description: >-
- This fieds allows the LLM to select the right CHROMECAST to use. A speaker
- should NEVER be used. And an entity ending with "Speakers" is INCORRECT
- default: media_player.hotbox_top_chromecast
- sequence:
- - variables:
- player_data: |
- {% if media_player %}
- {{integration_entities('cast')
- | expand
- | selectattr('entity_id', 'search', 'chromecast')
- | selectattr('entity_id', 'search', media_player.split(' ') | first | lower)
- | map(attribute='entity_id') | list }}
- {% elif area %}
- {{ integration_entities('cast')
- | expand
- | selectattr('entity_id', 'search', 'chromecast')
- | selectattr('entity_id', 'search', area.split(' ') | first | lower)
- | map(attribute='entity_id') | list }}
- {% endif %}
- target_data:
- entity_id: "{{ (player_data ) | default('NA', true) }}"
- invalid_target:
- response: Unable to find valid target
- enabled: true
- - variables:
- action_data:
- media_content_type: "{{media_type}}"
- media_content_id: >-
- plex://{"library_name": "{{library_name}}", "title":"{{media_id}}",
- "shuffle": 1}
- - action: media_player.play_media
- data: "{{ dict(action_data.items() | rejectattr('1', 'eq', 'NA')) }}"
- target: "{{ dict(target_data.items() | rejectattr('1', 'eq', 'NA')) }}"
- alias: LLM Script to start plex media playback on TVs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement