Help with kodi + HA

Hello everyone!

I need ideas … How to check if the kodi has changed media type …

That is, I am playing music, then I switch to movie … How to make HA identify this? and call an action?

I can identify idle status for playing
playing for idle
playing for paused

But, I can not identify playing “music” for playing “movie”

Any idea ? Can someone give a light?

I am wanting this function because I have themes from the movies they play when viewing the movie cover.

Please, I only need this output to finish with kodi …

Do a quick search for media type, it’s on here many times, but if you’ve sussed using states already you shouldn’t have any trouble as it’s the same principal as using playing and idle as triggers.

1 Like

hello bob

He does not identify, from playing to playing …

There is no way to call a trigger by tapping … because it is not changing the status. I do not know if you understand.

I solved it as follows!

Thank you Bobby


- id: '1527812884401'
  alias: tocando music para filme
  trigger:
  - entity_id: media_player.kodi
    from: playing
    platform: state
    to: playing
  - platform: template
    value_template: '{{ states.media_player.kodi.attributes.media_content_type ==
      "movie" }}'
  condition: []
  action:
  - data:
      event: luz-sala-todas-off
    service: ifttt.trigger
  - service: automation.turn_on
    entity_id:
    - automation.kodi_stop
1 Like

No probs, that’s exactly what I was referring to :slight_smile: