Advertisement
Guest User

Untitled

a guest
Feb 28th, 2025
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.10 KB | None | 0 0
  1. mode: parallel
  2. max_exceeded: silent
  3. description: This Script can be used by the LLM to initiate a playback on a TV
  4. fields:
  5. media_type:
  6. selector:
  7. select:
  8. options:
  9. - tvshow
  10. - movie
  11. name: Media Type
  12. description: >-
  13. This argument is mandatory and must always be provided no matter what!
  14. "media_type" can only be one of 2 different values: "movie" if the search
  15. is about a specific movie.- "tvshow" if the search is about a tv show
  16. serie.media_type is mandatory and must always be provided. In case a
  17. request does not match any of these types, for example when music from a
  18. specific genre is requested, then use "tvshow".
  19. required: true
  20. default: tvshow
  21. library_name:
  22. selector:
  23. select:
  24. options:
  25. - TV Shows
  26. - Movies
  27. name: Library Name
  28. description: >-
  29. "library_name" is the library the user wants to play the media from.
  30. 'Movies' for movies and 'TV Shows' for TV series
  31. required: true
  32. media_id:
  33. selector:
  34. text: null
  35. name: Media ID
  36. description: >-
  37. This argument is mandatory and must always be provided no matter what!
  38.  
  39. media_id is the queried name
  40.  
  41. - If the search is about a tv show: Then media_id is tv show title
  42.  
  43. - If the search is about a movie: Then media_id is the movie title This is
  44. a mandatory argument and must always be provided.
  45. required: true
  46. media_player:
  47. selector:
  48. entity:
  49. filter:
  50. integration: cast
  51. multiple: false
  52. name: Media Player
  53. required: true
  54. description: >-
  55. This fieds allows the LLM to select the right CHROMECAST to use. A speaker
  56. should NEVER be used. And an entity ending with "Speakers" is INCORRECT
  57. default: media_player.hotbox_top_chromecast
  58. sequence:
  59. - variables:
  60. player_data: |
  61. {% if media_player %}
  62. {{integration_entities('cast')
  63. | expand
  64. | selectattr('entity_id', 'search', 'chromecast')
  65. | selectattr('entity_id', 'search', media_player.split(' ') | first | lower)
  66. | map(attribute='entity_id') | list }}
  67. {% elif area %}
  68. {{ integration_entities('cast')
  69. | expand
  70. | selectattr('entity_id', 'search', 'chromecast')
  71. | selectattr('entity_id', 'search', area.split(' ') | first | lower)
  72. | map(attribute='entity_id') | list }}
  73. {% endif %}
  74. target_data:
  75. entity_id: "{{ (player_data ) | default('NA', true) }}"
  76. invalid_target:
  77. response: Unable to find valid target
  78. enabled: true
  79. - variables:
  80. action_data:
  81. media_content_type: "{{media_type}}"
  82. media_content_id: >-
  83. plex://{"library_name": "{{library_name}}", "title":"{{media_id}}",
  84. "shuffle": 1}
  85. - action: media_player.play_media
  86. data: "{{ dict(action_data.items() | rejectattr('1', 'eq', 'NA')) }}"
  87. target: "{{ dict(target_data.items() | rejectattr('1', 'eq', 'NA')) }}"
  88. alias: LLM Script to start plex media playback on TVs
  89.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement