Example for automation: switch to toggle media_player

The goal is using a xiaomi switch to toggle play and pause on a media_player.

The commang media_player toggle is not good.

I would need:

  • if media_player OFF, click, PLAY
  • if media_player ON, click, PAUSE

?

In addition, I don’t know if possible

  • if media_player ON, double click, forward X seconds

Hey,

did you try media_play_pause service from the media_player domain?
For the fast forward you could add another automation with a condition on the media player state “playing” and the service media_seek from media_player…input for media seek depends on the media player component you are using tho.

~Cheers

ahh yes that should solve the single click.

DId not understand the forward

a chromecast

I have no expierence with chromecast sorry.

~Cheers