MQTT Plugin (1 Viewer)

ajs

Development Group
  • Team MediaPortal
  • February 29, 2008
    13,753
    8,302
    Kyiv
    Home Country
    Ukraine Ukraine
    Country flag


    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

    1613740163764.png

    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') }}"
    Lovelace card:
    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)
    Result:
    1613740511646.png

    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:

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    13,753
    8,302
    Kyiv
    Home Country
    Ukraine Ukraine
    Country flag
    • Thread starter
    • Moderator
    • #2
    @JimCatMP Ready to listen to suggestions and comments. I don't quite understand what this plugin needs, and how it should work, sketched today for a couple of hours. Observing. :)
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    13,753
    8,302
    Kyiv
    Home Country
    Ukraine Ukraine
    Country flag
    • Thread starter
    • Moderator
    • #3
    Small rework, Plugin updated ...
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    13,753
    8,302
    Kyiv
    Home Country
    Ukraine Ukraine
    Country flag
    • Thread starter
    • Moderator
    • #5
    what the goal of this plugin ?
    Publish Mediaportal data to other systems, I will try to add Mediaportal management (but I don't understand what and why yet). Perhaps informing about something. :)
    i know MQTT for domotic ...
    Any system, there are a lot of them. I use Home Assistant :)
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    13,753
    8,302
    Kyiv
    Home Country
    Ukraine Ukraine
    Country flag
    • Thread starter
    • Moderator
    • #6
    With me now, if I turn on a movie to watch, the light turns off, if I finish watching or pause, the light turns on. I can think of all sorts of things. The main thing is to understand what is necessary. :)
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    13,753
    8,302
    Kyiv
    Home Country
    Ukraine Ukraine
    Country flag
    • Thread starter
    • Moderator
    • #8
    if you have any tips
    I haven't tried Domoticz, before I did anything I decided to read reviews and everyone was leaning towards Home Assistant being the most progressive product to date. So I decided to give it a try. I won't say I have it running my whole house (I don't trust it yet), but some fun little things work for me. And so far I am satisfied. So I can't tell you anything about Domoticz. On Home Assistant I can, but I'm just learning. :)
     

    azzuro

    Test Group
  • Team MediaPortal
  • May 10, 2007
    9,877
    5,539
    France - IDF
    Home Country
    France France
    Country flag
    I haven't tried Domoticz, before I did anything I decided to read reviews and everyone was leaning towards Home Assistant being the most progressive product to date. So I decided to give it a try. I won't say I have it running my whole house (I don't trust it yet), but some fun little things work for me. And so far I am satisfied. So I can't tell you anything about Domoticz. On Home Assistant I can, but I'm just learning. :)
    i'm not married with anything , i can look on Home Assistant.
     

    Users who are viewing this thread

    Similar threads

    Good work guys!
    Good work guys!
    We are proud to present MediaPortal 2.2.1 After the release of MediaPortal 2.2 Final the team focussed on improving usability and...
    Replies
    1
    Views
    3K
    Anecdotal testimonies are not helpful. If you guys would like to continue this chat, I'll move this thread to the Café section. The discussion about your issues is taking place here: Installation failing
    Anecdotal testimonies are not helpful. If you guys would like to continue this chat, I'll move this thread to the Café section...
    I have been looking for a replacement to Windows Media Center for a little over a year.No luck. Now, I'm no Microsoft fanboy, but I...
    Replies
    15
    Views
    2K
    Here are a few details regarding my recent success with using EventGhost to handle the IR input from my remote and eliminate unwanted key repeats. Hopefully this will prove useful to others with a similar issue: I recently upgraded my HTPC to an i5 after an number of years using MePo v1 on a Core Duo. Although this was a fantastic...
    Here are a few details regarding my recent success with using EventGhost to handle the IR input from my remote and eliminate...
    Here are a few details regarding my recent success with using EventGhost to handle the IR input from my remote and eliminate...
    Replies
    0
    Views
    3K
    Hi. This is planed but not ready now. Our Wiki is in the middle of a transfer process from one software to a much better one. Behind the curtains there is lots of work going on regarding the documentation. Sadly there are only a few people who have time to work on this so it will take a while until it's finished. The Icons are...
    Hi. This is planed but not ready now. Our Wiki is in the middle of a transfer process from one software to a much better one...
    It would be nice to have a "Media Portal 2 for Windows Media Center Refugees" document/topic... I have successfully installed MP2...
    Replies
    2
    Views
    1K
    Hello Doskabouter, thank your for your answert. Yes I install in september when I install my new MediaCenter Setup for the next time "MPSync" for syncronisat my two Media Center and it works for me also.
    Hello Doskabouter, thank your for your answert. Yes I install in september when I install my new MediaCenter Setup for the next...
    First!! thx @antihero05 for the idea and the WatchedSyncronizer plugin which is deprecated with the release of CentralizedDatabase...
    Replies
    41
    Views
    7K
    Top Bottom