MQTT plugin for Kodi: https://github.com/owagner/kodi2mqtt
Forum: http://forum.kodi.tv/showthread.php?tid=222109
My config for Pimatic (unfinished)
{
"name": "Kodi 1 - Buttons",
"id": "kodi-buttons",
"class": "MqttButtons",
"buttons": [
{
"id": "kodi1-pause-b",
"text": "| |",
"topic": "mh/gf/lab/kodi/command/playbackstate",
"message": "2"
},
{
"id": "kodi1-resume-b",
"text": "Resume",
"topic": "mh/gf/lab/kodi/command/playbackstate",
"message": "1"
},
{
"id": "kodi1-stop-b",
"text": "Stop",
"topic": "mh/gf/lab/kodi/command/playbackstate",
"message": "0"
},
{
"id": "kodi1-previous-b",
"text": "<<",
"topic": "mh/gf/lab/kodi/command/playbackstate",
"message": "previous"
},
{
"id": "kodi1-next-b",
"text": ">>",
"topic": "mh/gf/lab/kodi/command/playbackstate",
"message": "next"
}
]
},
{
"name": "Playlists",
"id": "kodi-1-playlist",
"class": "MqttButtons",
"buttons": [
{
"id": "smart_playlist_1",
"text": "smart_playlist_1",
"topic": "mh/gf/lab/kodi/command/play",
"message": "{\"item\":{\"file\":\"special://profile/playlists/music/smart_playlist_1.xsp\"}}"
}
]
},,
{
"name": "Kodi 1",
"id": "kodi-1",
"class": "MqttSensor",
"attributes": [
{
"name": "Connection",
"topic": "mh/gf/lab/kodi/connected",
"type": "string",
"unit": "",
"acronym": "",
"messageMap": {
"0": "Not ready",
"2": "Connected"
}
}
]
},
{
"name": "Kodi playbackstate",
"id": "kodi-playbackstate",
"class": "MqttSensor",
"attributes": [
{
"name": "kodi_state",
"topic": "mh/gf/lab/kodi/status/playbackstate",
"type": "string",
"acronym": "State"
},
{
"name": "kodi_playertype",
"topic": "mh/gf/lab/kodi/status/playbackstate",
"type": "string",
"acronym": "Media type"
},
{
"name": "kodi_playerid",
"topic": "mh/gf/lab/kodi/status/playbackstate",
"type": "string",
"acronym": "Player id"
}
]
},
{
"attributes": [
{
"name": "kodi_time",
"topic": "mh/gf/lab/kodi/status/progress",
"type": "string",
"acronym": "Time",
"messageMap": {}
},
{
"name": "kodi_totaltime",
"topic": "mh/gf/lab/kodi/status/progress",
"type": "string",
"acronym": "Total time",
"messageMap": {}
},
{
"name": "val",
"topic": "mh/gf/lab/kodi/status/progress",
"type": "number",
"acronym": "Progress",
"messageMap": {},
"unit": "%"
}
],
"xAttributeOptions": [
{
"name": "val",
"displaySparkline": false
}
],
"id": "kodi-progress",
"name": "Kodi progress",
"class": "MqttSensor"
},
{
"attributes": [
{
"name": "kodi_details.label",
"topic": "mh/gf/lab/kodi/status/title",
"type": "string",
"acronym": "Label"
},
{
"name": "kodi_details.streamdetails.video.0.codec",
"topic": "mh/gf/lab/kodi/status/title",
"type": "string",
"acronym": "Codec"
}
],
"xAttributeOptions": [],
"id": "kodi-media-info",
"name": "Kodi media info",
"class": "MqttSensor"
}
Config is quite modular and depends on you how to lay them. Do not forget to show off.
Yes, Victorias Secret!!
I can not launching the playlist via JSON message (Player.Open() JSON_RPC). Maybe someone smarter?
You can also send announcements to Kodi over Rules:
publish mqtt message "Hello from Pimatic" on topic "mh/gf/lab/kodi/command/notify"
Unfortunately I still do not have much time to play with it.
If you proceed with the configuration, please share.