Switch Scenes depending on media state (Beta)

Hello there,

I did a blueprint where you can attach a media_player to listen and changes the scene depending on the state.

This Blueprint take care of:

  • Won’t do anything if no lights in the main scene (playing scene) are “on”
  • Will save the lights (playing scene) states when media_player switch on and turn this scene on if you did not define a scene for the other states
  • You can say which Source you want to ignore (for example I did for Spotify)

Still to do:

  • [ ] Add delay and sources to delay
  • [ ] Tests with others scene than only for playing

Tested with:

  • AndroidTV

Blueprint

Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Or import this Blueprint by using the YAML code URL:

Any feedback are welcome.

1 Like

Hi!

So I tried it, but I failed to make it work. I get the following error message in the log console:

Blueprint Scene switcher when media is playing generated invalid automation with inputs OrderedDict([('media_player', 'media_player.android_tv'), ('app_to_exclude', 'YouTube,Spotify,Google Cast')]): required key not provided @ data['action']. Got None required key not provided @ data['trigger']. Got None
Blueprint Scene switcher when media is playing generated invalid automation with inputs OrderedDict([('media_player', 'media_player.android_tv'), ('app_to_exclude', 'Spotify,YouTube,Google Cast')]): required key not provided @ data['action']. Got None required key not provided @ data['trigger']. Got None
Blueprint Scene switcher when media is playing generated invalid automation with inputs OrderedDict([('media_player', 'media_player.android_tv')]): required key not provided @ data['action']. Got None required key not provided @ data['trigger']. Got None
Blueprint Scene switcher when media is playing generated invalid automation with inputs OrderedDict([('media_player', 'media_player.google_home')]): required key not provided @ data['action']. Got None required key not provided @ data['trigger']. Got None

It looks like the “Action” is missing. In fact, in the UI where I import it, there is no such field about the action. Is it missing from the configuration? I’m not used to Blueprints :X

EDIT:
M’kay, I found something. If the blueprint is imported using the link of the community.home-assistant.io but if the Github link is used, it works.

1 Like