Pimatic plugin for controlling Kodi (XBMC) Media player.
{
"id": "kodi-player",
"name": "Kodi",
"class": "KodiPlayer",
"host": "192.168.1.2",
"port": 9090
}
Play music
if smartphone is present then play Kodi
Pause music
if smartphone is absent then pause Kodi
Next song
if buttonNext is pressed then play next song on Kodi
Previous song
if buttonPrev is pressed then play previous song on Kodi
Save yourself!
if currentArtist of Kodi = "Justin Bieber" then play next song on Kodi
Predictates examples
if Kodi is playing then switch speakers on and dim lights to 30
if Kodi is not playing then switch speakers off and dim lights to 100
if Kodi is playing and kodi.type != "song" then dim lights to 30
To make sure lights only dim if you are watching a movies/series.
You can add custom Player.Open commands to the plugin. Player.Open can execute almost anything. From opening Youtube movies, Soundcloud streams to simple opening a file.
Example configuration for a custom command:
{
"plugin": "kodi",
"customOpenCommands": [
{
"name": "nyan",
"command": "plugin://plugin.video.youtube/?action=play_video&videoid=QH2-TGUlwu4"
}
]
}
Execute the custom command if yourrule then execute Open Command nyan on Kodi
This is just one of the examples you can do with the Player.Open command to Kodi, This can also execute scripts in Kodi.
You only need to find out what the script/plugin path is, and what parameter to give.
Big thanks to the code of Pimatic. I used the pimatic-mpd plugin as a base for this project.
- Add volume controls
- create new device (template)
- better support for multimedia (now focused @ music)