- Moderator
- #1
MQTT Plugin for MediaPortal
- Publish some Mediaportal statuses to MQTTBroker
Install:
Extract files to ... Program Files\Team MediaPortal\MediaPortal\plugins\process\ folder, run MP Configurator and set Host, Port, ...
\InputDeviceMappings\MQTTPlugin.xml to C:\ProgramData\Team MediaPortal\MediaPortal\InputDeviceMappings\MQTTPlugin.xml - andrewjswan/MQTTPlugin
Latests Media MQTT topic now support HA Custom card - custom-cards/upcoming-media-card
MQTT Sensors for HA:
YAML:
sensor:
- platform: mqtt
name: "PC-NAME New Movies"
state_topic: "Mediaportal/PC-NAME/Latests/Movies"
value_template: "{{ value_json.count }}"
json_attributes_topic: "Mediaportal/PC-NAME/Latests/Movies"
json_attributes_template: '{{ {"data": value_json.data } | tojson }}'
icon: mdi:playlist-star
- platform: mqtt
name: "PC-NAME New TV Series"
state_topic: "Mediaportal/PC-NAME/Latests/TVSeries"
value_template: "{{ value_json.count }}"
json_attributes_topic: "Mediaportal/PC-NAME/Latests/TVSeries"
json_attributes_template: '{{ {"data": value_json.data } | tojson }}'
icon: mdi:playlist-star

Now Playing sensor:
YAML:
sensor:
- platform: mqtt
name: "PC-NAME Now Playing Video"
state_topic: "Mediaportal/PC-NAME/Player/Video/action"
json_attributes_topic: "Mediaportal/PC-NAME/Player/Video/data"
icon: mdi:television
camera:
- platform: generic
name: "PC-NAME Mediaportal Now Playing"
still_image_url: "{{ 'http://127.0.0.1:8123/local/images/mediaportal.jpg' if state_attr('sensor.pc_name_now_playing_video','fanart') | lower in ['', 'none'] else '' + state_attr('sensor.dark_fish_now_playing_video','fanart') }}"
YAML:
type: vertical-stack
cards:
- type: entities
entities:
- type: attribute
entity: sensor.pc_name_now_playing_video
attribute: title
name: PC-NAME
- type: picture-entity
show_name: false
show_state: false
entity: sensor.pc_name_now_playing_video
camera_image: camera.pc_name_mediaportal_now_playing
state_filter:
Pause: brightness(90%) sepia(100%) hue-rotate(15deg)
Stop: grayscale(1)
End: grayscale(1)

MQTT Commands:
*** Press button:
Topic: Mediaportal/PC-NAME/Command/button
Value: 34
*** Show message:
Mediaportal/PC-NAME/Command/message
JSON:
{
"header": "test-header",
"line1": "line1",
"line2": "line2",
"timeout": 30,
"image": "mediaportal image",
}
*** Activate Window:
Mediaportal/PC-NAME/Command/window
Value: 35
*** Play:
Mediaportal/PC-NAME/Command/play
JSON:
{
"plugin": "myvideo",
"filename": "drive:\\folder\\file.mkv"
}
JSON:
{
"header": "mymusic",
"filename": "drive:\\folder\\file.mp3"
}
JSON:
{
"header": "mymusic",
"album": "Album"
}
JSON:
{
"header": "mymusic",
"artist": "Artist"
"album": "Album"
}
Download:
PS: It is based on EventGhost plugin, but the bulk of it is redesigned for the MQTT.
Last edited: