Triggering an automation when a video starts playing

Hello :wave:

I am not quite sure if this is possible, but figured there is no harm in asking.

Is it possible to trigger an automation when my Nest Hub / Nest Hub Max starts playing a YouTube video?

I looked at the available options for the device in automations, but the only thing I seem to be able to use as a trigger is “buffering”, “playing”, etc. I’m assuming that more information is shared to HA since HA also displayed track information, but I can’t seem to find any mention of media type, or how to access it in automations.

The part where this becomes “perhalps not possible” is that the automation should not trigger when a YouTube Music video starts playing.

To summarize, is it possible to trigger an automation when a video (not audio-only) starts playing?

Thanks in advance for any assistance you can provide.

First thing I would do is play the or a YouTube video and then while playing go and look at the nest device / media player entity in developer tool, states.

Look at the attributes and see if you can find an attribute that is different or unique when playing YouTube video as opposed to music etc.

If there is an attribute that’s unique then you could use that to trigger an automation.

1 Like