INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3   Go Down

Author Topic: Home Assistant integration for jriver  (Read 12167 times)

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #50 on: April 14, 2024, 10:13:03 am »

Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #51 on: April 14, 2024, 10:24:19 am »

in fact, I'd say it's an MC bug so keep an eye on https://yabb.jriver.com/interact/index.php/topic,138671.0.html
Logged

flac.rules

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1268
Re: Home Assistant integration for jriver
« Reply #52 on: April 17, 2024, 03:46:09 am »

Sorry, I am a bit confused after reading the bug thread and the answer. I want to browse and play my playlists. Is that something i should be able to do with the plugin now?
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #53 on: April 17, 2024, 04:03:15 am »

Not via browsing no, I have to add a workaround as MC won't change their api
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #54 on: July 04, 2024, 04:12:43 pm »

finally got round to this, I think latest version (0.2.7) should allow playlist selection
Logged

casper3127

  • Recent member
  • *
  • Posts: 18
Re: Home Assistant integration for jriver
« Reply #55 on: August 09, 2024, 02:38:45 am »

I’ve been using Home Assistant for a while now, and integrating it with different applications has been a game-changer for my setup.

I checked out your GitHub page and the integration looks promising. If you’re new to Home Assistant or looking for a guide on setting it up, https://www.mklibrary.com/how-to-install-home-assistant-on-synology/ has some useful info that could help with the initial setup.
Logged

sjhilton

  • Junior Woodchuck
  • **
  • Posts: 96
Re: Home Assistant integration for jriver
« Reply #56 on: September 02, 2024, 07:15:54 am »

Hi Matt - I just wanted to say thank you for developing this. Only discovered your work on this integration today. Works really well. I did find an issue with pausing and resuming playback. For whatever reason playback my client refuses to restart after pause from the Home Assistant interface. Might be an issue with my setup.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #57 on: September 02, 2024, 11:07:21 am »

I guess it might depend on which widget you use in the front end assuming this is driven by user control rather than some automation?
Logged

sjhilton

  • Junior Woodchuck
  • **
  • Posts: 96
Re: Home Assistant integration for jriver
« Reply #58 on: September 03, 2024, 05:10:54 am »

I guess it might depend on which widget you use in the front end assuming this is driven by user control rather than some automation?
Thanks Matt. It's the default media control card. I've noticed that pushing the power button freezes the player as well. In your experience is there a better card (custom or otherwise) to use?
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #59 on: September 03, 2024, 06:24:45 am »

Not sure about but I use https://github.com/kalkih/mini-media-player combined with the built in one for it's browse function (which I rarely use tbh as it has no search feature and is not customisable) and a bunch of other buttons for convenience

I will post that config later to illustrate

Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #60 on: September 03, 2024, 09:07:50 am »

here's a snippet of my ui

Code: [Select]
- type: entities
  show_header_toggle: false
  entities:
    - card_type: vertical-stack
      type: custom:hui-element
      cards:
        - card_type: horizontal-stack
          type: custom:hui-element
          cards:
            - name: -5m
              tap_action:
                service: jriver.seek_relative
                target:
                  entity_id: media_player.paradroid
                data:
                  seek_duration: -300
              template: thin_button
              type: custom:button-card
            - name: -30s
              tap_action:
                service: jriver.seek_relative
                target:
                  entity_id: media_player.paradroid
                data:
                  seek_duration: -30
              template: thin_button
              type: custom:button-card
            - name: -1s
              tap_action:
                service: jriver.seek_relative
                target:
                  entity_id: media_player.paradroid
                data:
                  seek_duration: -1
              template: thin_button
              type: custom:button-card
            - name: +1s
              tap_action:
                service: jriver.seek_relative
                target:
                  entity_id: media_player.paradroid
                data:
                  seek_duration: 1
              template: thin_button
              type: custom:button-card
            - name: +30s
              tap_action:
                service: jriver.seek_relative
                target:
                  entity_id: media_player.paradroid
                data:
                  seek_duration: 30
              template: thin_button
              type: custom:button-card
            - name: +5m
              tap_action:
                service: jriver.seek_relative
                target:
                  entity_id: media_player.paradroid
                data:
                  seek_duration: 300
              template: thin_button
              type: custom:button-card
        - type: custom:stack-in-card
          cards:
          - type: custom:mini-media-player
            entity: media_player.paradroid
            max_volume: 80
            volume_step: 1
            artwork: full-cover
            hide:
              jump: false
              play_stop: false
              runtime: false
              runtime_remaining: false
              power_state: false
            view_layout:
              grid-area: media
            shortcuts:
              columns: 5
              buttons:
                - icon: mdi:power-plug-off
                  type: script
                  id: script.stop_all_playback_in_cinema
                - icon: mdi:alpha-a-box-outline
                  type: script
                  id: script.hdr_mode_auto
                - icon: mdi:numeric-1-box-outline
                  type: script
                  id: script.hdr_mode_one
                - icon: mdi:numeric-2-box-outline
                  type: script
                  id: script.hdr_mode_two
                - icon: mdi:numeric-3-box-outline
                  type: script
                  id: script.hdr_mode_three
            card_mod:
              style:
                .: |
                  ha-card div.mmp-player {
                   padding-bottom: 0px;
                  }
                  ha-card div.mmp-player__adds {
                   margin-left: 48px !important;
                  }
          - type: media-control
            entity: media_player.paradroid
            card_mod:
              style: |
                mwc-linear-progress {
                  display: none;
                }
                div.media-info {
                  display: none;
                }
                div.top-info {
                  display: none;
                }
                div.background {
                  display: none;
                }
                ha-icon-button {
                  display: none;
                }
                ha-icon-button.browse-media {
                  display: block;
                  padding-right: 10px;
                }
                mwc-icon-button {
                  padding-top: 0px;
                }
                div.title-controls {
                  padding: 0 0 0px;
                }
                .no-progress.player {
                  padding-bottom: 16px !important;
                }
                div.player {
                  color: inherit !important;
                }
                div.off {
                  display: none;
                }
        - card_type: horizontal-stack
          type: custom:hui-element
          cards:
            - name: -5dB
              tap_action:
                service: jriver.adjust_volume
                target:
                  entity_id: media_player.paradroid
                data:
                  delta: -5
              template: thin_button
              type: custom:button-card
            - name: -3dB
              tap_action:
                service: jriver.adjust_volume
                target:
                  entity_id: media_player.paradroid
                data:
                  delta: -3
              template: thin_button
              type: custom:button-card
            - name: -1dB
              tap_action:
                service: jriver.adjust_volume
                target:
                  entity_id: media_player.paradroid
                data:
                  delta: -1
              template: thin_button
              type: custom:button-card
            - name: +1dB
              tap_action:
                service: jriver.adjust_volume
                target:
                  entity_id: media_player.paradroid
                data:
                  delta: 1
              template: thin_button
              type: custom:button-card
            - name: +3dB
              tap_action:
                service: jriver.adjust_volume
                target:
                  entity_id: media_player.paradroid
                data:
                  delta: 3
              template: thin_button
              type: custom:button-card
            - name: +5dB
              tap_action:
                service: jriver.adjust_volume
                target:
                  entity_id: media_player.paradroid
                data:
                  delta: 5
              template: thin_button
              type: custom:button-card

pic attached (usually there's a background image there, looks like someone watching something before tags had been updated to add art)


Logged

sjhilton

  • Junior Woodchuck
  • **
  • Posts: 96
Re: Home Assistant integration for jriver
« Reply #61 on: September 04, 2024, 12:34:27 am »

Thanks Matt - I'll give that a go and do some tinkering. Certainly the play/pause functionality works with that player. I might also try to build a file info tile that picks up the playing now attributes.
Logged

beatonnz

  • Recent member
  • *
  • Posts: 6
Re: Home Assistant integration for jriver
« Reply #62 on: September 28, 2024, 11:34:48 pm »

Hi Matt:  Thanks for this Home Assistant Integration.  I looked at Home Assistant some years back but found it was too unfriendly and learning curve was steep - plus I am a long time user of MC and have four servers running on Raspberry Pi's these days which have worked flawlessly and thus no desire to move away from MC.  Previously I did not see how I could use MC with Home Assistant so just dropped the whole idea but have come back to it and it is more friendly now and your integration solves my inability to bring MC into Home Assistant.  Followed your instructions and it set up nicely.  Changed over to the mini-media-player you recommended which does have working play/pause/back/forward.

I have two problems to overcome:

  1) Even with new min-media-player pushing the power button still freezes up MC server.  I tried toggling the button off in settings but it didn't make any difference.  Looked to see if I could find the button in YAML to see if I could comment it out but couldn't find anything.  It will be important for me to fix this before I roll it out for whole house use as my family users are bound to use the power button to try and stop it.  Have you found a way to do this?
  2) I do have version 0.2.7 which you noted has working playlists but my playlists are not showing up anywhere - is there something I have to add to get them to show up?
I am a noob on Home Assistant but trying hard to learn it.  A little better on Linux/MC.
Thanks for your integration and assistance.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #63 on: September 29, 2024, 04:31:28 am »

What version of MC are you using?
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #64 on: September 29, 2024, 04:04:49 pm »

assuming the media player calls media_player.turn_off then this is implemented as calling the following

Playback/StopAll
MCC 20007,0

which works fine here so not sure why it would freeze for you
Logged

beatonnz

  • Recent member
  • *
  • Posts: 6
Re: Home Assistant integration for jriver
« Reply #65 on: September 29, 2024, 05:59:47 pm »

Thanks for the quick response.  Because I am running on pi3b+ I have stayed with MC29 so I am a little behind current releases as I believe pi3 has a hard time supporting bullseye/bookworm releases.
I retried the "pushing" the power button on the same recommended mini-media-player card while watching the server over VNC connection.  It definitely stops MC but leaves it hung in a state where it shows as still playing and won't respond to any commands.  Only solution seems to be a reboot.

I will build a MC33 on a pi4 or pi 5 and give that a try to see if it resolves the issues. 

Thanks for your help.
 

 
Logged

sjhilton

  • Junior Woodchuck
  • **
  • Posts: 96
Re: Home Assistant integration for jriver
« Reply #66 on: September 29, 2024, 07:48:48 pm »

Hi beatonnz - confirming I have a similar issue runnning the HA integration with my Raspberrypi clients. I use the following to hide power, which works for me.

hide:
  power: true

I am running MC33 on all clients and the server.
Logged

sjhilton

  • Junior Woodchuck
  • **
  • Posts: 96
Re: Home Assistant integration for jriver
« Reply #67 on: September 29, 2024, 08:10:10 pm »

Hi all - I just thought I'd share what my HA JRiver integration looks like (see attachment). I use the mini-media-player as well and I've developed a file info panel with my favourite attributes. I've also used a REST command to MCWS to create sensors that indicate bit depth, sample rate and whether playback is direct or not. I think this is better than relying on the file attributes which may not indicate resampling. I've also integrated Tidal in a similar way via Media Assistant playing to JRiver by DLNA (this was a bit tricky to resolve). Happy to share code if anyone is interested.
Logged

beatonnz

  • Recent member
  • *
  • Posts: 6
Re: Home Assistant integration for jriver
« Reply #68 on: September 29, 2024, 10:09:12 pm »

Thanks sjhilton:
Your solution re hiding the power button worked perfectly. 
I would be interested in your JRiver code which will facilitate my own learning in how I can improve my own install.
 
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #69 on: September 30, 2024, 02:04:39 am »

Thanks for the quick response.  Because I am running on pi3b+ I have stayed with MC29 so I am a little behind current releases as I believe pi3 has a hard time supporting bullseye/bookworm releases.
I retried the "pushing" the power button on the same recommended mini-media-player card while watching the server over VNC connection.  It definitely stops MC but leaves it hung in a state where it shows as still playing and won't respond to any commands.  Only solution seems to be a reboot.

I will build a MC33 on a pi4 or pi 5 and give that a try to see if it resolves the issues. 

Thanks for your help.
It may be a bug in handling that MCC command on Linux I guess, you could test it directly (ie just make that call from command line or via browser) and see if it hangs

For playlists, the API call required to load them automatically is not in mc29 so either upgrade or specify which entries you want via the config screen
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13868
Re: Home Assistant integration for jriver
« Reply #70 on: September 30, 2024, 08:38:47 am »

Thanks for the quick response.  Because I am running on pi3b+ I have stayed with MC29 so I am a little behind current releases as I believe pi3 has a hard time supporting bullseye/bookworm releases.
I retried the "pushing" the power button on the same recommended mini-media-player card while watching the server over VNC connection.  It definitely stops MC but leaves it hung in a state where it shows as still playing and won't respond to any commands.  Only solution seems to be a reboot.

I will build a MC33 on a pi4 or pi 5 and give that a try to see if it resolves the issues. 

Thanks for your help.
A bit off topic but the IdPi runs bookworm on the 3b+ fine.
Logged

beatonnz

  • Recent member
  • *
  • Posts: 6
Re: Home Assistant integration for jriver
« Reply #71 on: September 30, 2024, 09:43:25 pm »

Thanks mattkahn & bob:
Upgraded pi3b+ to bullseye and then to MC33.  Playlists work as advertised and that plus sjhilton tip to hide the power button I am all good on running MC via home assistant.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #72 on: October 01, 2024, 02:15:39 am »

I tested MCC 20007,0 on linux and it simply kills the process which means any subsequent power on (implemented as 22009,0) does nothing as there's no server process responding

it's completely different behaviour to windows as the server stays alive and just the client is killed

10014 doesn't work on Linux either so I guess it would have to be 22009,-1000 to "turn off" but that seems a bit unpleasant, any other suggestions on how to handle this on linux?

Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13868
Re: Home Assistant integration for jriver
« Reply #73 on: October 01, 2024, 09:47:09 am »

I tested MCC 20007,0 on linux and it simply kills the process which means any subsequent power on (implemented as 22009,0) does nothing as there's no server process responding

it's completely different behaviour to windows as the server stays alive and just the client is killed

10014 doesn't work on Linux either so I guess it would have to be 22009,-1000 to "turn off" but that seems a bit unpleasant, any other suggestions on how to handle this on linux?
20007,0 should just close the UI if media server is running. I can take a look at that. I know that media server is somewhat different on linux than windows.
Logged

sjhilton

  • Junior Woodchuck
  • **
  • Posts: 96
Re: Home Assistant integration for jriver
« Reply #74 on: October 04, 2024, 06:56:57 am »

Thanks sjhilton:
Your solution re hiding the power button worked perfectly. 
I would be interested in your JRiver code which will facilitate my own learning in how I can improve my own install.

Not a problem. For the info card I use the following:

Code: [Select]
          - type: entities
            entities:
              - entity: sensor.[your player_zone]_playing_now
                type: attribute
                name: Album
                attribute: Album
                icon: mdi:album
              - entity: sensor.[your player_zone]_playing_now
                type: attribute
                name: 'Track #'
                attribute: 'Track #'
                icon: mdi:numeric-1-box-multiple
              - entity: sensor.[your player_zone]_playing_now
                type: attribute
                name: Duration
                attribute: Duration
                icon: mdi:timelapse
              - entity: sensor.[your player_zone]_playing_now
                type: attribute
                name: Year
                attribute: Date (year)
                icon: mdi:timer
              - entity: sensor.[your player_zone]_playing_now
                type: attribute
                name: Times played
                attribute: Number Plays
                icon: mdi:timer-play
              - entity: sensor.[your player_zone]_playing_now
                type: attribute
                name: Last Played
                attribute: Last Played
                icon: mdi:timeline-clock-outline
              - entity: input_text.bitdepth
                type: simple-entity
                name: Bit Depth
                icon: mdi:chart-bar-stacked
              - entity: input_text.samplerate
                type: simple-entity
                name: Sample Rate
                icon: mdi:waveform
              - entity: input_text.input_text_media_player_direct
                type: simple-entity
                name: Is output direct?

The last three entries rely on an MCWS command and a couple of automations.

You would need to insert some lines into configuration.yaml.

Code: [Select]
hifiaudiopath:
    url: http://[yourip]:52199/MCWS/v1/Playback/AudioPath?Zone=-1&ZoneType=ID
    method: GET

And then the automations follow the form of:

Code: [Select]
alias: Set bitdepth, sample rate and filename
description: ""
mode: single
triggers:
  - seconds: /30
    trigger: time_pattern
conditions: []
actions:
  - action: rest_command.hifiplayback
    data: {}
    response_variable: hifiplayback
  - delay: "00:00:02"
  - action: input_text.set_value
    data:
      value: >-
        {{ (hifiplayback | regex_findall_index('<Item
        Name="Bitdepth">(.*?)</Item>')) }}
    target:
      entity_id: input_text.bitdepth
  - action: input_text.set_value
    data:
      value: >-
        {{ (hifiplayback | regex_findall_index('<Item
        Name="SampleRate">(.*?)</Item>')) }}
    target:
      entity_id: input_text.samplerate
  - action: input_text.set_value
    data:
      value: >-
        {{ (hifiplayback | regex_findall_index('<Item
        Name="Name">(.*?)</Item>')) }}
    target:
      entity_id: input_text.mediafilename

The next project will be to develop a card that displays the playlist/running times and hopefully shows the now playing track in bold or similar. That might be done by more sophisticated scraping of MC via MCWS.
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13868
Re: Home Assistant integration for jriver
« Reply #75 on: October 04, 2024, 07:49:19 am »

20007,0 should just close the UI if media server is running. I can take a look at that. I know that media server is somewhat different on linux than windows.
There isn't a real "server" mode on MC for linux as there is on mac and windows. The mode that best approximates that is when MC is started with the /mediaserver switch. With linux you should probably just minimize the UI instead.
Logged

sjhilton

  • Junior Woodchuck
  • **
  • Posts: 96
Re: Home Assistant integration for jriver
« Reply #76 on: October 06, 2024, 10:56:37 pm »

I've now developed a playlist display for my Home Assistant configuration. The coding is a bit messy as it depends upon creating a sensor for each track (a separate rest call to the MCWS playlist function on my server) and then a further sensor to determine if the sensors should display based on the total number of tracks. I've chosen an arbitrary limt of 20 tracks (as most of my albums wouldn't have more than this). I'm happy to share the code if anyone is interested. Picture attached.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #77 on: October 07, 2024, 01:50:43 am »

why do you need a sensor for each track?
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42370
  • Shoes gone again!
Re: Home Assistant integration for jriver
« Reply #78 on: October 07, 2024, 09:30:20 am »

If there are MCWS functions we could add to make this easier for you, please let us know the details.  Thanks.
Logged
Matt Ashland, JRiver Media Center

sjhilton

  • Junior Woodchuck
  • **
  • Posts: 96
Re: Home Assistant integration for jriver
« Reply #79 on: October 08, 2024, 01:23:20 am »

Thanks mattkhan and Matt

Let me further explain how I've done this. I'm sure there is likely to be a better way. I do want to emphasise that the approach I've taken is mostly to work around limitations in Home Assistant rather than any issue with MCWS.

I'm calling http://[myserverip]:52199/MCWS/v1/Playback/Playlist?Zone=0&Action=JSON by rest and then creating sensors for each track and then attributes from each of the fields in my database (at the moment this is all of them, but I'll probably cut this back to the ones I actually need as it will fill the home assistant database). This refreshes every 30 seconds.

Each track is a tile card in home assistant. I tried to use the entities card initially, but I couldn't work out how to make this work. I wanted the play icons to be dynamic so that the currently playing track icon would change each time data was called via MCWS and there had been a track change.

I created a further set of sensors as template sensors so that I could determine if each of the track sensors should be displayed or not eg if total tracks in the album is less than or equal to track number the track sensor woud display and if not the relevant track sensor would be hidden.

Edit: I should also have mentioned that I'm using config-template-card add in to code the playlist cards (basically allows for JavaScript to be used in the card).
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #80 on: October 09, 2024, 02:07:03 pm »

I can't say I'm an expert in HA frontend but it does seem like you need to use a custom card for anything non trivial, I guess there might be some list card around somewhere which would make this easier to implement

if there's anything useful that can be added to the integration then I'm happy to add it, something like your playing now & playlist stuff sounds useful so I can look at doing that at some point (no particular help to you as you have the rest command already there but easier for future people)
Logged

sjhilton

  • Junior Woodchuck
  • **
  • Posts: 96
Re: Home Assistant integration for jriver
« Reply #81 on: October 12, 2024, 07:05:14 pm »

I can't say I'm an expert in HA frontend but it does seem like you need to use a custom card for anything non trivial, I guess there might be some list card around somewhere which would make this easier to implement

if there's anything useful that can be added to the integration then I'm happy to add it, something like your playing now & playlist stuff sounds useful so I can look at doing that at some point (no particular help to you as you have the rest command already there but easier for future people)

Thanks matt - I completely agree. Happy to test anything if that would assist.

One other thought for consideration. I realised over the last couple of days that because I had been connecting the integration to one of my clients (my main hifi), the other clients (my tv) and my main server were losing track of what was playing on that client. I've now connected the integration to the main server directly, which works much better. This may be obvious, but it might be worthwhile a note in the readme on this just to say the integration should be connected to your main server (if you have a server/client setup) and if you connect the integration to the client this may cause issues. This makes setting zones as devices in the integration almost essential. 
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #82 on: October 13, 2024, 04:25:06 am »

One other thought for consideration. I realised over the last couple of days that because I had been connecting the integration to one of my clients (my main hifi), the other clients (my tv) and my main server were losing track of what was playing on that client. I've now connected the integration to the main server directly, which works much better. This may be obvious, but it might be worthwhile a note in the readme on this just to say the integration should be connected to your main server (if you have a server/client setup) and if you connect the integration to the client this may cause issues. This makes setting zones as devices in the integration almost essential.
I suspect I use it in the way you describe (integration connects to clients rather than the server) and haven't noticed any issues though I perhaps I use it differently to you. What sort of issues do you get? what does "server losing track of the client" mean exactly?
Logged

sjhilton

  • Junior Woodchuck
  • **
  • Posts: 96
Re: Home Assistant integration for jriver
« Reply #83 on: October 14, 2024, 01:10:36 am »

I suspect I use it in the way you describe (integration connects to clients rather than the server) and haven't noticed any issues though I perhaps I use it differently to you. What sort of issues do you get? what does "server losing track of the client" mean exactly?
The main one is that if I'm playing say an album on one client (the hifi) this is reflected on another client (the TV, say in theater view) and then when I go to play the next album the TV will be stuck on the last track unless I restart MC on the TV and it will pick up playback again. The playback activity may or may not be reflected on the server when I look at that.

On reflection I'm thinking that the issues I am experiencing may be more to do with my MC media network setup. I've made a separate post about this in the 'Media Network' part of the forum. It seems that my server and clients are playing back using DLNA rather than Media Network for some reason. I might need a clean install soon.

Edit: after all of that I decided to revert to connecting the integration to the client as it is more stable (even with the issues mentioned above).
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #84 on: October 15, 2024, 02:40:15 am »

there's a new version of this released, just to address some point of order that HA logs that I could see in my setup to do with how it reacts when a particular MC instance is offline at startup. I don't see how this will make any actual difference in practice but it makes the log complaint go away.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #85 on: October 15, 2024, 03:35:41 pm »

in other news, the integration is now in HACS proper so there should be no need to add as a custom repository from now on (will update docs soon)
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #86 on: October 17, 2024, 02:31:05 am »

If there are MCWS functions we could add to make this easier for you, please let us know the details.  Thanks.
I raised one here -> https://yabb.jriver.com/interact/index.php/topic,139860.0.html

Logged

avpman

  • Galactic Citizen
  • ****
  • Posts: 445
  • Dad to three beatuiful Boxers by rescue.
Re: Home Assistant integration for jriver - Playing Now
« Reply #87 on: October 17, 2024, 06:04:47 pm »

Is there a Playing Now view available showing all the tracks queued? If so, I can't find it. It would be a great addition.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #88 on: October 18, 2024, 01:30:02 am »

I am adding that in the next release
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #89 on: October 18, 2024, 02:20:07 am »

for showing the current playlist, given MC doesn't have a push api, I want to avoid excessive polling of a relatively large dataset for something that changes v rarely. To that end, I was thinking of only refreshing the playlist if

* the playback state changes to playing or it is still playing
* the track changes

would that work for people or are there some other conditions to be added?
Logged

rhgh

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 301
Re: Home Assistant integration for jriver
« Reply #90 on: October 18, 2024, 03:09:18 am »

I have added JRiver to Home Assistant. I can see my views and select music. This is also played. But when I press the pause button the music stops, when I press the play button nothing happens, playback no longer starts. If I press the next song button then playback starts with the next track.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #91 on: October 18, 2024, 03:23:19 am »

I have added JRiver to Home Assistant. I can see my views and select music. This is also played. But when I press the pause button the music stops, when I press the play button nothing happens, playback no longer starts. If I press the next song button then playback starts with the next track.
What do you see happening in MC? Logs from either ha or MC will help
Logged

sjhilton

  • Junior Woodchuck
  • **
  • Posts: 96
Re: Home Assistant integration for jriver
« Reply #92 on: October 18, 2024, 05:15:47 am »

for showing the current playlist, given MC doesn't have a push api, I want to avoid excessive polling of a relatively large dataset for something that changes v rarely. To that end, I was thinking of only refreshing the playlist if

* the playback state changes to playing or it is still playing
* the track changes

would that work for people or are there some other conditions to be added?

That sounds about right to me. I have my MCWS playlist call every 30s, but that's because I couldn't do it in a more elegant way (as you've proposed).
Logged

avpman

  • Galactic Citizen
  • ****
  • Posts: 445
  • Dad to three beatuiful Boxers by rescue.
Re: Home Assistant integration for jriver
« Reply #93 on: October 18, 2024, 07:20:48 am »

for showing the current playlist, given MC doesn't have a push api, I want to avoid excessive polling of a relatively large dataset for something that changes v rarely. To that end, I was thinking of only refreshing the playlist if

* the playback state changes to playing or it is still playing
* the track changes

would that work for people or are there some other conditions to be added?

That's good for me. BTW - Terrific work on this!
Logged

rhgh

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 301
Re: Home Assistant integration for jriver
« Reply #94 on: October 18, 2024, 12:55:47 pm »

What do you see happening in MC? Logs from either ha or MC will help
MC 32 on Raspberry pi4
Logged

rhgh

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 301
Re: Home Assistant integration for jriver
« Reply #95 on: October 19, 2024, 02:24:14 am »

MC 32 on Raspberry pi4
Das log aus Home assistant
I start a song by selecting it in the library
commands. next - back - pause - play - play - play - next
after pause it no longer responds to back and play
everything is OK in jremote
I can continue playing the song by pressing play
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #96 on: October 19, 2024, 03:10:14 am »

the issue here is that the card I use (https://github.com/kalkih/mini-media-player) sends Playback/PlayPause in this situation (which toggles the pause state) whereas the HA media card sends Playback/Play and Playback/Pause depending whether it is paused or not. Play does nothing in this situation unfortunately.

I don't really understand the point of Playback/Play only responding when nothing is playing (even when something is paused) but PlayPause always responding. Playback/Play seems completely redundant to me.

I guess I have to switch to using PlayPause in all situations rather than Play
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #97 on: October 19, 2024, 03:28:23 am »

I pushed that update in a new build, should work now
Logged

rhgh

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 301
Re: Home Assistant integration for jriver
« Reply #98 on: October 19, 2024, 04:19:17 am »

I pushed that update in a new build, should work now
I installed 0.2.10.
what can I say - it works perfectly
mattkhan thanks
whoever delivers such a super fast solution deserves respect.
thanks Reinhard
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225
Re: Home Assistant integration for jriver
« Reply #99 on: October 19, 2024, 09:35:15 am »

latest version includes 2 additional sets of sensors

sensor.<mediaserver>_<zone>_audio_is_direct
a boolean showing whether audio playback is direct or not

sensor.<mediaserver>_<zone>_playlist
a sensor with extra attributes which is a list of items from the current playlist in that zone

I'm not sure if this format is ideal for rendering, it's probably usable in a markdown card using some template or you could install https://community.home-assistant.io/t/flex-table-card/461173 like so

Code: [Select]
views:
  - title: Home
    cards:
      - type: custom:flex-table-card
        entities:
          include:
            - sensor.paradroid_music_playlist
        columns:
          - name: Artist
            data: entries
            modify: x.Artist
          - name: Album
            data: entries
            modify: x.Album
          - name: '#'
            data: entries
            modify: 'x[''Track #'']'
          - name: Name
            data: entries
            modify: x.Name
    type: custom:vertical-layout

if there's some other format that makes more sense and/or some good card to use for it then do share that
Logged
Pages: 1 [2] 3   Go Up