MQTT Plugin (2 Viewers)

ajs

Development Group
  • Team MediaPortal
  • February 29, 2008
    14,246
    8,844
    Kyiv
    Home Country
    Ukraine Ukraine


    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
    14,246
    8,844
    Kyiv
    Home Country
    Ukraine Ukraine
    • 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
    14,246
    8,844
    Kyiv
    Home Country
    Ukraine Ukraine
    • Thread starter
    • Moderator
    • #3
    Small rework, Plugin updated ...
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    14,246
    8,844
    Kyiv
    Home Country
    Ukraine Ukraine
    • 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
    14,246
    8,844
    Kyiv
    Home Country
    Ukraine Ukraine
    • 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
    14,246
    8,844
    Kyiv
    Home Country
    Ukraine Ukraine
    • 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,900
    5,552
    France - IDF
    Home Country
    France France
    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

    Top Bottom