Hass.io play media on Kodi

I want to fire a JSON RPC API command thrue a script with HA to a kodi box, but I can’t find a proper example of a code. With an example from mviezzer I have a party mode working, now I like to stream a radio station with the Kodi Addon “Radio.de”.

Is there anyone who can post a few script examples for Kodi (addons)?

There is a nice Kodi add-on for MQTT … this provides the Kodi status (on, off ,pause, screensaver, movie title, progress, etc) … it works much more easy!

That’s sounds great. I found the addon. Do you an example how it works, I want to automate a radio stream addon.

I have migrated all my automation to node-red … but it is all MQTT message management.

I have 5 Kodi running and configured the Kodi-MQTT-Addon with /Kodi/1 to /Kodi/5 … than you will have all the JSON parameters available.

I used a MQTT monitor to analyse all the messages coming out of Kodi (its a lot) … and choose the one i needed.

Good luck

I’m very curious how you setup the .yaml
I have 3 Kodi/SPMC devices. So far I have following script working:

# Play Partymode
kodi_play_something:
  alias: Kodi Play Something
  sequence:
    - service: media_player.kodi_call_method
      data:
        entity_id: media_player.kodi_w
        method: Player.Open
        item:
          partymode: music

Do you want to share you’re script code? I’m a bit of a rookie regarding the JSON parameters… Thanks anyway!

1 Like

Sorry , I have moved my automation to Node-red and have no YAML available

Hi. Did you figure out how the config looks like?
I have installed kodi2mqtt addon and connected it to my hassio broker, but I’m strugling with adding it to my config.

No I’m sorry, can’t help you. I can’t find enough informatie of the format of the commands.

FYI everyone - we’ve updated the code to support latest appdaemon and kodi.

1 Like

Can anybody tell how I can play specific spotify playlist on kodi?
I found that probably i can call to the plugin, but can’t figure out how to do it from call method.
here’s what i got from kodi debug and i want to invoke:
plugin://plugin.audio.spotify/?action=play_playlist&ownerid=spotify&playlistid=37i9TECEVXcSwR3jlLXHm8

In case, some month later. :wink:

script:
  kodi_play_radio_abricot:
    sequence:
      - service: media_player.play_media
        target:
          entity_id: media_player.abricot_kodi
        data:
          media_content_type: music
          media_content_id: >
            plugin://plugin.audio.radio_de/station/example.com