Set scene to change TV source

I installed the script and can control the TV from the Hass dashboard.
Now I want to make a scene to change the source to Plex, but I get following error:

reproduce_state: Unable to reproduce state <state media_player.tv=source:APP_ Plex

scene:
  - name: Plex
    entities:
      media_player.tv:
        source: APP_ Plex

This is in the states section:

media_player.tv
media_content_id:
is_volume_muted: false
app_name: APP_
supported_features: 23997
source: APP_ Plex
media_title: Plex
friendly_name: TV
media_content_type: app
volume_level: 0.25
source_list: APP_ QuickSupport,APP_ Social TV,APP_ Wireless and networks,APP_ YouTube,APP_ Update software,APP_ SPB TV,APP_ ES File Explorer,APP_ Demo me,APP_ ARTE,APP_ Cloud Explorer,APP_ Plex,APP_ Dailymotion,APP_ Play Store,APP_ GameTreeTV GOLD,APP_ App Gallery,APP_ Install channels,APP_ File Explorer,APP_ Play Games,APP_ Prime Video,APP_ How to…,APP_ Kodi,APP_ Opera Browser,APP_ Developer Tools,APP_ Deezer,APP_ VLC,APP_ Spotify,APP_ Videoland,APP_ iConcerts,APP_ Manage apps,APP_ Euronews,APP_ Top picks,APP_ TV5Monde,APP_ Cinetrailer,APP_ Play Music,APP_ MeteoNews.TV,APP_ Help,APP_ France24,APP_ BrowseActivity,APP_ TV,APP_ Media,APP_ Termux,APP_ Recordings,APP_ Play Movies & TV,APP_ Settings,APP_ Popcorn Time,APP_ App Starter for Netflix Button,TV_ Play Movies & TV

The script that gets this information is found here:

https://github.com/nstrelow/ha_philips_2016/blob/master/philips_2016.py

How can I fix this?
Thanks in advance!

May or may not help – but I created scripts to control my Roku’s – I used scripts because those will export as scenes to Alexa, allowing me to then create a routine to run the script… Anyway – here’s an example of my script that changes my source:

roku_family_netflix:
  alias: Family Netflix
  sequence:            
    - service: media_player.select_source   
      data:                                 
        entity_id: media_player.roku_family
        source: Netflix
2 Likes

Aha thanks. I will try that and let you know.
I want to somehow be able to access through the API, either a scene or script.
So hopefully this will work.

Using a script works, thanks!

plex_channel:
  alias: Plex Channel
  sequence:            
    - service: media_player.select_source   
      data:                                 
        entity_id: media_player.tv
        source: APP_ Plex

Fantastic! Glad that worked out for you.