INTERACT FORUM
Windows => Third Party Plug-ins, Programs, and Skins => Topic started by: mattkhan on January 10, 2024, 02:35:43 am
-
I've published an initial 0.0.1 release of this
The readme provides full details of supported features and installation instructions https://github.com/3ll3d00d/jriver_homeassistant/blob/main/README.md
Feel free to log feature requests or bugs either here or on github
-
in case anyone notices there are no jriver icons shown, that depends on https://github.com/home-assistant/brands/pull/5071 being approved and merged
-
pushed some updates, includes access key support + some additional sensors + support for a wol based service using the MAC addresses pulled from MC (i.e. simpler config of a wake call), see https://github.com/3ll3d00d/jriver_homeassistant/releases for details
this also includes ability to specify additional library fields to surface in media player as attributes (and in those sensors), for me the intent here is being able to do things like detect an aspect ratio change so switch the projector installation mode which moves my lens into place but obviously you can use this for whatever you like (change lighting for different music or whatever)
-
another update adds relative seeking (HA media player cards seem really weak on this point so this enables you to add buttons using the jriver.relative_seek service
-
I just opened an issue on GitHub related to the API Key change, but another thing I noticed, which I wasn't sure if it was just not working how I thought...
I don't get the "Device Per Zone" question on setup. I do have multiple zones - just player and the other is a DLNA zone. Does that not make it qualify? I'd like the DLNA zone to be it's own device because I never actually use the Player zone on my server. I noticed this because I hit playback at some point and realized it had queued up files in the Player zone instead of my DLNA zone I was expecting.
Thanks!
-
I don't get the "Device Per Zone" question on setup. I do have multiple zones - just player and the other is a DLNA zone. Does that not make it qualify? I'd like the DLNA zone to be it's own device because I never actually use the Player zone on my server. I noticed this because I hit playback at some point and realized it had queued up files in the Player zone instead of my DLNA zone I was expecting.
if you check that box then you get n media_player entities, 1 per zone, so you can control them independently
if it's unchecked, you get one and it shows the currently active zone (and assumes you control this separately, i.e. using zoneswitch)
atm it excludes zones marked as DLNA though, I could change that
-
for the api key issue, try 0.0.6
-
if you check that box then you get n media_player entities, 1 per zone, so you can control them independently
if it's unchecked, you get one and it shows the currently active zone (and assumes you control this separately, i.e. using zoneswitch)
atm it excludes zones marked as DLNA though, I could change that
I installed the new version, and I see more devices now (I'm assuming because of the DLNA zone change), which is good.
When I said "I don't get" I meant, it doesn't show up for me when going through the configure screens, not that I didn't understand it :) I see 1 - Options (the views), 2 - Enable WOL, 3 - Additional Library Fields, then done.
-
ah sorry, I see what you mean
I haven't added configuration of zones into options yet (HA initial configuration and options are 2 entirely separate sets of data and forms for reasons I don't understand, seems to lead to a load of duplication of code) so there's no way to edit that after initial setup atm (added https://github.com/3ll3d00d/jriver_homeassistant/issues/11)
it also only shows that screen if there is >1 zone and now that (in 0.0.6) it's not filtering out dlna zones then it should be available to you if you delete and add from scratch, does it?
if not, something unexpected going on and I'll need a bit more detail about your setup... the output of /MCWS/v1/Playback/Zones will probably do
-
After updating, all of my other zones just showed up as individual players, without having set that option (and without remove/readding the integration). That's ok by me, because that's what I wanted, but I never checked a box that said "make a player per zone."
EDIT: Nevermind, those were the sensors that were added, not players... I'll remove/ re-add now.
-
in case anyone notices there are no jriver icons shown, that depends on https://github.com/home-assistant/brands/pull/5071 being approved and merged
this is now fixed, logos are present and visible
-
there's a new release up but just internal changes so I can get it into hacs proper + unit tests
-
After updating, all of my other zones just showed up as individual players, without having set that option (and without remove/readding the integration). That's ok by me, because that's what I wanted, but I never checked a box that said "make a player per zone."
did you get it working?
-
0.1.1 is out
fixed a bug that was preventing seeking working
made use of new MCWS endpoint (thanks Matt!) added in MC32 to remove the need to manually populate the configuration of the browse tree, that entire config screen disappears if you're using MC32 and it now loads the entire config (except for playlists which seems like a bug, reported separately). It attempts to parse the search field to work out what the media type is for each node. This last bit might be risky as parsing MC search expressions seems slightly tricky to me so let me know if something blows up.
HA frontend is really limited in terms of how that browse function works so I was thinking of making it load a field (something like "HA Name") which, if it's present, would be used in place of the standard name field.
I can't see a better way to customise what is displayed atm, examples of how to use this would be things like indicating aspect ratio for a film, whether something is 4k/1080p etc and so on. HA UI doesn't, as far as I can see, provide any support for rich info about the media so this would be a quick hack to surface a bit more info without needing to add another custom component.
-
also submitted this to hacs proper but the PR has been pending for quite a while now
the HA & HACS model for adding integrations seems fairly broken to me so I doubt I'll pursue getting it into HA itself, just seems way too hard to get things updated
-
I just installed the new version, at first it failed to setup, but then I realized my JRiver VM was still asleep. Once I booted it up, it worked great. The browse seemed to work well right away too.
Have you noticed that the coverart doesn't pull through to the player? This is what I see in the attributes of my JRiver media_player instance:
supported_features: 456639
friendly_name: serv01b - House Speakers (dlna)
volume_level: 1
is_volume_muted: false
media_content_id: 1020301
media_content_type: music
media_title: El Camino
media_artist: Amos Lee
media_album_name: Mission Bell
media_album_artist: Amos Lee
entity_picture_local: /api/media_player_proxy/media_player.serv01b_house_speakers_dlna?token=<redacted>&cache=b174ae145172cebc
zone_name: House Speakers (dlna)
entity_picture: http://192.168.3.202:52199/MCWS/v1/File/GetImage?File=1020301
media_duration: 242
media_position: 57
But when I look at the actual media_player, there's no image. I'm outputting to a DLNA zone, which also has a media_player instance in my HA and I see this when I look at that one:
volume_level: 1
is_volume_muted: false
media_content_id: http://192.168.3.202:52100/Music/F1020301.wav
media_duration: 242
media_position: 3
media_position_updated_at: 2024-01-28T16:41:03.239397+00:00
media_track: 1
shuffle: false
repeat: off
friendly_name: Kitchen Speakers - DLNA
supported_features: 397839
media_content_type: music
media_title: El Camino
media_artist: Amos Lee
media_album_name: Mission Bell
entity_picture: /api/media_player_proxy/media_player.kitchen_speakers_dlna?token=<redacted>&cache=17333a371a604331
The quality of the picture on the DLNA one is particular poor, but at least it's there. I wrote an automation on track change to get the picture from entity_picture and place it somewhere that my tablet will pick it up, but it's 5 seconds or so delayed.
-
thanks for noticing, I'd forgotten to add the token to the image url. It should be fixed in 0.1.2 but lmk if any problems
-
another release to workaround https://yabb.jriver.com/interact/index.php/topic,138016.0.html (only applies if you have multiple zones and rely on zoneswitch)
-
I can't get the integration going with HACS. Not sure where the issue is. Installed HACS via the instructions.
Added the integration repo though I can't tell if it sticks.
When I try to open the integration I get an error.
-
I can't get the integration going with HACS. Not sure where the issue is. Installed HACS via the instructions.
Added the integration repo though I can't tell if it sticks.
When I try to open the integration I get an error.
The first few things with HA are confusing, much like JRiver :)
I'm a bit confused where you're stuck and it's been a long time since I setup HACS, so my memory of all the steps might be rusty. Do you have HACS showing in your sidebar on the left? If not, then step 1 is to get that working correctly. Is this the page you mentioned you followed? https://hacs.xyz/docs/configuration/basic/
When you add a HACS integration, you add the repo in HACS, reboot, then you install the integration in the core HA integration page.
If you do have HACS showing in the sidebar and you're stuck with the JRiver integration, if you click on HACS on the left, you should then see a choice of integrations/ frontend/ add-ons. Under Integrations, you should see any repos that you've added (HACS.png attachment). Every time you load this page, it'll show a bunch of new things, I always hit dismiss to see what I have instead of what's new. If you've just installed the JRiver integration, HACS will give you some red banner that says you need to reboot. Once you've done that, then you should be able to add the intrgration using the main HA integration page (Settings > Devices & Services > Add Integration > JRiver).
-
thanks for noticing, I'd forgotten to add the token to the image url. It should be fixed in 0.1.2 but lmk if any problems
This is working great.
In case people are looking for ideas on how this can be used: I'm much closer to being able to have an HA tablet in my kitchen that can replace some of the Google Home uses. I now have it showing what's playing and a quick button to kick off a script that calls MCWS and triggers a smart playlist to go at 40% volume on the kitchen speakers (this part pre-dates the integration, but now I can get feedback and see that it starts). I also just added an automation that double clicking my Inovelli light switch next to the sink changes the volume up or down (double click on vs double click off) if the media_player's state is playing.
-
The first few things with HA are confusing, much like JRiver :)
I'm a bit confused where you're stuck and it's been a long time since I setup HACS, so my memory of all the steps might be rusty. Do you have HACS showing in your sidebar on the left? If not, then step 1 is to get that working correctly. Is this the page you mentioned you followed? https://hacs.xyz/docs/configuration/basic/
When you add a HACS integration, you add the repo in HACS, reboot, then you install the integration in the core HA integration page.
If you do have HACS showing in the sidebar and you're stuck with the JRiver integration, if you click on HACS on the left, you should then see a choice of integrations/ frontend/ add-ons. Under Integrations, you should see any repos that you've added (HACS.png attachment). Every time you load this page, it'll show a bunch of new things, I always hit dismiss to see what I have instead of what's new. If you've just installed the JRiver integration, HACS will give you some red banner that says you need to reboot. Once you've done that, then you should be able to add the intrgration using the main HA integration page (Settings > Devices & Services > Add Integration > JRiver).
I've carefully followed the instructions. Added HACS. It's in the left bar. Most of the time the integration tab doesn't even show up. I've uninstalled, reinstalled, rebooted each time. Not really any luck.
I do the upper right ... and add the custom repo https://github.com/3ll3d00d/jriver_homeassistant.git as Integration. It shows up there but nothing else changes. If I reboot it's gone again.
-
What version of HA? And HACS?
Anything in the logs?
Does it actually download the repo into the custom_components dir?
-
What version of HA? And HACS?
Anything in the logs?
Does it actually download the repo into the custom_components dir?
Version info attached.
I don't see anything other than hacs in custom_components.
-
FWIW - I'm the same as Bob. I've tried a half dozen times over the last month and this integration is not added to the custom_compenents dir (and I already have a couple).
-
I run HA core only via docker so I created a new VM to run it as HA OS with a fresh HACS installation, followed the instructions in my readme (i.e. add custom repo, download it,
restart, add integration) and everything shows up as expected. I suppose you need to increase the log level to try to see what is going on and why it's not working for you as there's just not enough info provided to comment further, it seems like a HACS problem to me anyway.
-
Got it by installing the custom_components/jriver and associated manually.
-
Have you noticed that the media_player entity goes to unavailable somewhat regularly, mid-song? I've noticed this because I have a tablet with Fully Kiosk on it. I made an automation that when the track changes, turn the display on for 30 seconds. This happens well, but then consistently a minute 30 into a track, it will turn on again with a blank screen (because the player is unavailable). In the attachment, you can see that it flips from Playing to Unavailable to Playing.
-
anything in the logs at that time?
-
I have seen some sort of jitter myself, looking at the network log in the browser then I can see that every now and again, it loses a particular piece of info which would cause this. I'm not sure if this causes your problem but will look at fixing this.
if you're able to gather some info locally to see if it's the same then that would be useful (albeit not sure how easy that will be) otherwise perhaps just retry after I fix this as I guess it probably has same root cause
-
anything in the logs at that time?
That would have been useful to check... I was going to replicate it and watch the logs, but then I saw this:
Logger: homeassistant.setup
Source: setup.py:221
First occurred: 9:09:56 AM (1 occurrences)
Last logged: 9:09:56 AM
Setup failed for custom integration 'jriver': Requirements for jriver not found: ['hamcws==0.1.29'].
I rebooted HA, but same issue after restart. So I re-downloaded via HACS, disabled then re-enabled the integration, followed by another HA reboot. Any additional suggestions? Not sure what changed that caused this, but I did upgrade HA to 2024.2.1 recently.
-
seems strange, 0.1.29 is available https://pypi.org/project/hamcws/0.1.29/ & I haven't made a new release for a week or two anyway
I'm also on 2024.2.1 btw
-
seems strange, 0.1.29 is available https://pypi.org/project/hamcws/0.1.29/ & I haven't made a new release for a week or two anyway
I'm also on 2024.2.1 btw
When I search the logs for hamcws, I'm seeing this:
Logger: homeassistant.util.package
Source: util/package.py:122
First occurred: 12:13:21 PM (3 occurrences)
Last logged: 12:13:48 PM
Unable to install package hamcws==0.1.29: ERROR: Ignored the following versions that require a different python version: 0.0.10 Requires-Python >=3.11,<3.12; 0.0.11 Requires-Python >=3.11,<3.12; 0.0.12 Requires-Python >=3.11,<3.12; 0.0.13 Requires-Python >=3.11,<3.12; 0.0.14 Requires-Python >=3.11,<3.12; 0.0.15 Requires-Python >=3.11,<3.12; 0.0.16 Requires-Python >=3.11,<3.12; 0.0.17 Requires-Python >=3.11,<3.12; 0.0.18 Requires-Python >=3.11,<3.12; 0.0.19 Requires-Python >=3.11,<3.12; 0.0.20 Requires-Python >=3.11,<3.12; 0.0.21 Requires-Python >=3.11,<3.12; 0.0.22 Requires-Python >=3.11,<3.12; 0.0.23 Requires-Python >=3.11,<3.12; 0.0.24 Requires-Python >=3.11,<3.12; 0.0.25 Requires-Python >=3.11,<3.12; 0.0.26 Requires-Python >=3.11,<3.12; 0.0.27 Requires-Python >=3.11,<3.12; 0.0.28 Requires-Python >=3.11,<3.12; 0.0.29 Requires-Python >=3.11,<3.12; 0.0.30 Requires-Python >=3.11,<3.12; 0.0.31 Requires-Python >=3.11,<3.12; 0.0.32 Requires-Python >=3.11,<3.12; 0.0.33 Requires-Python >=3.11,<3.12; 0.0.34 Requires-Python >=3.11,<3.12; 0.0.35 Requires-Python >=3.11,<3.12; 0.0.36 Requires-Python >=3.11,<3.12; 0.0.37 Requires-Python >=3.11,<3.12; 0.0.38 Requires-Python >=3.11,<3.12; 0.0.39 Requires-Python >=3.11,<3.12; 0.0.4 Requires-Python >=3.11,<3.12; 0.0.40 Requires-Python >=3.11,<3.12; 0.0.5 Requires-Python >=3.11,<3.12; 0.0.6 Requires-Python >=3.11,<3.12; 0.0.7 Requires-Python >=3.11,<3.12; 0.0.8 Requires-Python >=3.11,<3.12; 0.0.9 Requires-Python >=3.11,<3.12; 0.1.0 Requires-Python >=3.11,<3.12; 0.1.1 Requires-Python >=3.11,<3.12; 0.1.10 Requires-Python >=3.11,<3.12; 0.1.11 Requires-Python >=3.11,<3.12; 0.1.12 Requires-Python >=3.11,<3.12; 0.1.13 Requires-Python >=3.11,<3.12; 0.1.14 Requires-Python >=3.11,<3.12; 0.1.15 Requires-Python >=3.11,<3.12; 0.1.16 Requires-Python >=3.11,<3.12; 0.1.17 Requires-Python >=3.11,<3.12; 0.1.18 Requires-Python >=3.11,<3.12; 0.1.2 Requires-Python >=3.11,<3.12; 0.1.20 Requires-Python >=3.11,<3.12; 0.1.21 Requires-Python >=3.11,<3.12; 0.1.22 Requires-Python >=3.11,<3.12; 0.1.23 Requires-Python >=3.11,<3.12; 0.1.25 Requires-Python >=3.11,<3.12; 0.1.27 Requires-Python >=3.11,<3.12; 0.1.28 Requires-Python >=3.11,<3.12; 0.1.29 Requires-Python >=3.11,<3.12; 0.1.3 Requires-Python >=3.11,<3.12; 0.1.4 Requires-Python >=3.11,<3.12; 0.1.5 Requires-Python >=3.11,<3.12; 0.1.6 Requires-Python >=3.11,<3.12; 0.1.7 Requires-Python >=3.11,<3.12; 0.1.8 Requires-Python >=3.11,<3.12; 0.1.9 Requires-Python >=3.11,<3.12 ERROR: Could not find a version that satisfies the requirement hamcws==0.1.29 (from versions: none) ERROR: No matching distribution found for hamcws==0.1.29
One fo the changed for 2024.2 lists moving to Python 3.12. Could this be why?
https://github.com/home-assistant/core/pull/107175
-
ah yes, thanks
I pushed a new build, it also adds a little bit of debug logging which, if you activate debug logging, may help diagnose that flickering issue
-
I have realised that the way the WOL service is implemented is useless because the service targets an entity and HA simply ignores you if you call a service on an unavailable entity (which is not exactly helpful behaviour but anyway). I'll have to implement that service in some different way.
-
latest build has the above change, had to refactor a number of things so some chance of side effects, seems ok in my setup though
-
latest build has the above change, had to refactor a number of things so some chance of side effects, seems ok in my setup though
I took the latest build, it resolved the issue with hamcws dependencies, so that's great! I am still seeing the player flipping to Unavailable somewhat regularly. I do see more in the logs though, so perhaps this will help:
This error originated from a custom integration.
Logger: custom_components.jriver.coordinator
Source: helpers/update_coordinator.py:313
Integration: JRiver Media Center (documentation, issues)
First occurred: 11:38:30 AM (8 occurrences)
Last logged: 12:43:39 PM
Unexpected error fetching jriver data: unhandled errors in a TaskGroup (1 sub-exception)
+ Exception Group Traceback (most recent call last):
| File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh
| self.data = await self._async_update_data()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/config/custom_components/jriver/coordinator.py", line 142, in _async_update_data
| async with asyncio.TaskGroup() as tg:
| File "/usr/local/lib/python3.12/asyncio/taskgroups.py", line 145, in __aexit__
| raise me from None
| ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "/usr/local/lib/python3.12/site-packages/hamcws/hamcws.py", line 527, in get_playback_info
| ok, resp = await self._conn.get_as_dict("Playback/Info", params=params)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/local/lib/python3.12/site-packages/hamcws/hamcws.py", line 380, in get_as_dict
| return await _get(self._session, self.get_mcws_url(path), _to_dict, lambda r: r.text(), params,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/local/lib/python3.12/site-packages/hamcws/hamcws.py", line 315, in _get
| async with session.get(url, params=params, timeout=timeout, auth=auth) as resp:
| File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 1194, in __aenter__
| self._resp = await self._coro
| ^^^^^^^^^^^^^^^^
| File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 605, in _request
| await resp.start(conn)
| File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 961, in start
| with self._timer:
| File "/usr/local/lib/python3.12/site-packages/aiohttp/helpers.py", line 735, in __exit__
| raise asyncio.TimeoutError from None
| TimeoutError
+------------------------------------
It looks like this popped up in the logs 7 seconds after the player went unavailable.
Nevermind, at the same time, then again.
2024-02-12 12:43:32.511 ERROR (MainThread) [custom_components.jriver.coordinator] Unexpected error fetching jriver data: unhandled errors in a TaskGroup (1 sub-exception)
serv01b - House Speakers (dlna) became unavailable
12:43:32 PM - 26 minutes ago
-
The error just says the call to MCWS timed out, ie MC doesn't respond. The timeout is 5s which is a pretty long time so I guess it suggests either a network issue or a problem in MC. Anything in MC logs?
I could add some tolerance to this, like give it a few retries before falling or make the timeout longer though that may have other side effects.
-
btw the other key point is how long it takes to recover, I think the ideal solution for working around that will vary on whether it's a brief hiccup or a prolonged one
-
in my case, the flickering is in https://github.com/kalkih/mini-media-player and really seems like a bug in HA itself (when fresh data arrives, if the media player position hasn't updated then it tells the frontend that there's no such field so the component above reacts by removing the progress bar). I have made a change that avoids that in the latest build (0.2.2).
-
The error just says the call to MCWS timed out, ie MC doesn't respond. The timeout is 5s which is a pretty long time so I guess it suggests either a network issue or a problem in MC. Anything in MC logs?
I could add some tolerance to this, like give it a few retries before falling or make the timeout longer though that may have other side effects.
Hmm, I'll do some more testing, but this morning, I used the core_ssh addon and did a wget loop to pull the MCWS/Alive. Then I watched the Media Player entity. At one point the media_player went to Not Available, but the wget loop was still getting responses back from MC within 0.1 s.
The only thing I see in the JRiver logs is potentially this, though that IP address is the IP of the client that was playing, not the MC or HA instance:
0055644: 4152: General: CDLNADeviceServiceCaller::CallServiceFunction: DLNA function call failed or timeout! url = http://192.168.6.227:52101/AVTransport/control function = GetPositionInfo execution time = 6036.03 ms of 6000 ms.
-
FWIW HA uses https://docs.aiohttp.org/en/stable/ as the basis for http comms with an asyncio event loop underneath. I'm not familiar with the internals of exactly how asyncio is implemented but it does open up the possibility that contention with something else going on in HA causes the timeout (NB: given the size of the connection pool used in HA, this seems fairly unlikely tbh). It's also worth noting that I have to hit MC with multiple requests to gather all the info required (Alive, UserInterface/Info, Playback/Zones and 1 Playback/Info per zone) so it's also possible that this causes some contention somewhere (in HA or in MC is hard to tell). At least these are reasons why a single hit in a loop with a separate process each time is not exactly equivalent to how HA behaves though it might suggest the problem is in HA somewhere.
It's not obviously something I can influence at my end though given it's a timeout, not sure what else I can add to debug it either.
-
It's not obviously something I can influence at my end though given it's a timeout, not sure what else I can add to debug it either.
I think you were right before when you indicated that it's probably something not in the HA integration, but within MC/ my server. I just happened to be interacting with the client, or my interaction with the client made it happen. I went to change the volume on the client (MC, not the HA integration), the client hung for a second and I got the Mac pinwheel. At that moment, the integration went to not-available. I had just cleared the logs, so I'm looking through now to see if I can figure out what's going on. Appreciate the help!
-
it would be interesting to know exactly how the webserver in MC operates and whether that operates in a non blocking mode, aka I have no clue how MC is threaded. For example, is MCWS serving the view of state available to the current thread or is it actively acquiring (via 1 or more locks) that state on demand?
-
I've seen JRiver (30 I believe) lock up because of HTTP requests sent to it. When I was having my client devices poll JRiver directly I'd every once in a while end up with an actual playback hiccup. I decided to log when every client polled, and sure enough, when a couple client's interval synced up *really* close, it had a chance of the 'hang' / interruption. Strangest thing. It convinced me to essentially make a single service for polling that the client devices could talk to.
-
I've seen JRiver (30 I believe) lock up because of HTTP requests sent to it. When I was having my client devices poll JRiver directly I'd every once in a while end up with an actual playback hiccup. I decided to log when every client polled, and sure enough, when a couple client's interval synced up *really* close, it had a chance of the 'hang' / interruption. Strangest thing. It convinced me to essentially make a single service for polling that the client devices could talk to.
What data were you polling for in your requests? Anything specifically regarding remote zones?
-
What data were you polling for in your requests? Anything specifically regarding remote zones?
Just playback state and playback info (before playback state let you choose fields, or at least before I knew about that, IIRC). This was on a per system basis. I don't really use JRiver for its library / db anymore.
-
small update to add a new service - https://github.com/3ll3d00d/jriver_homeassistant/issues/17 - for direct setting of the volume
-
Thanks a lot, maybe I don't understand the "additional services" quite right, but is it correct that in the "browse media" one can't choose playlists? Is there a way to play playlists via HA? I have a very large library so this is usually the easiest way to do it.
-
Thanks a lot, maybe I don't understand the "additional services" quite right, but is it correct that in the "browse media" one can't choose playlists? Is there a way to play playlists via HA? I have a very large library so this is usually the easiest way to do it.
do you mean using the HA UI and a media player card or do you mean via one of the provided services?
if you mean the latter then it would be something like the attached example from the developer screen
for the former, if you have playlists as an entry in the remote views then it should be possible to browse them and play them (just as panel does).
https://github.com/3ll3d00d/jriver_homeassistant/blob/main/README.md#browse-paths
-
actually looks like a bug, added https://github.com/3ll3d00d/jriver_homeassistant/issues/18
-
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
-
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?
-
Not via browsing no, I have to add a workaround as MC won't change their api
-
finally got round to this, I think latest version (0.2.7) should allow playlist selection
-
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/ (https://www.mklibrary.com/how-to-install-home-assistant-on-synology/) has some useful info that could help with the initial setup.
-
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.
-
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?
-
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?
-
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
-
here's a snippet of my ui
- 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)
-
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.
-
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.
-
What version of MC are you using?
-
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
-
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.
-
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.
-
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.
-
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.
-
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
-
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.
-
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.
-
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?
-
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.
-
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:
- 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.
hifiaudiopath:
url: http://[yourip]:52199/MCWS/v1/Playback/AudioPath?Zone=-1&ZoneType=ID
method: GET
And then the automations follow the form of:
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.
-
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.
-
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.
-
why do you need a sensor for each track?
-
If there are MCWS functions we could add to make this easier for you, please let us know the details. Thanks.
-
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).
-
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)
-
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.
-
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?
-
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).
-
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.
-
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)
-
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
-
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.
-
I am adding that in the next release
-
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?
-
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.
-
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
-
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).
-
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!
-
What do you see happening in MC? Logs from either ha or MC will help
MC 32 on Raspberry pi4
-
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
-
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
-
I pushed that update in a new build, should work now
-
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
-
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
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
-
If we can get https://yabb.jriver.com/interact/index.php/topic,139872.0.html implemented then it will be possible to include images like so
https://community.home-assistant.io/t/flex-table-card/461173/45
-
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
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
Thanks mattkhan - this looks great - my only suggestion would be to try to add a play icon in a separate column where the track/item is playing now. I've tried doing this with a few different cards, including this one and unfortunately haven't been able to figure it out. (In response to your next post - agree it would be great to have access to the image file somehow)
-
Perhaps, you could probably do that yourself by creating an extra column formatted as appropriate
-
another way to handle this playing now situation is via https://yabb.jriver.com/interact/index.php/topic,139901.0.html if that gets implemented
-
latest version adds ImageURL as an attribute on each entry (which gives a url to get a small thumbnail so you can include the pic in the playlist if you want to)
-
another update to support Playing Now in the remote view definitions (though it doesn't work properly yet due to a bug on the MC side) requires 33.0.37 to have this option available
-
I've developed a new playlist card. Playing now track is bold and current time elapsed displays in brackets. This is based on the new playlist sensor. You can also add a player entity at the top (generic HA one). If anyone's interested please let me know and I'll share the code. This uses custom:hui-element with a markdown card
-
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.
Did this get added? Sorry, I'm a little behind in the updates.
-
Hi mattkhan - I'm not sure if this is feasible, but it would be great to have either a search or filter function. Eg a filter function that could be applied to the 'browse media' popup when it opens. I've tried crafting my own with a variety of different custom cards and javascript, but it's proven quite difficult to get working. Just a thought.
That's probably the last thing I can think of from a usability perspective. The HA integration is certainly now my preferred way of interacting with MC and my library. Thanks for all of your work on this.
-
Did this get added? Sorry, I'm a little behind in the updates.
the data is there, you need to configure some view yourself to display that
-
Hi mattkhan - I'm not sure if this is feasible, but it would be great to have either a search or filter function. Eg a filter function that could be applied to the 'browse media' popup when it opens. I've tried crafting my own with a variety of different custom cards and javascript, but it's proven quite difficult to get working. Just a thought.
yes definitely, this is a big gap in the media browse feature in the HA UI (along with the ability to customise what information is shown) and the main thing missing from my old custom UI. It's a moderately sized undertaking to create such a custom card though and I don't like javascript very much so haven't been inclined to make one yet.
-
the data is there, you need to configure some view yourself to display that
Hopefully, someone could share what they've done. I'm still relatively new to HomeAssistant and have no idea how to accomplish this.
-
Hopefully, someone could share what they've done. I'm still relatively new to HomeAssistant and have no idea how to accomplish this.
there was a basic example in https://yabb.jriver.com/interact/index.php/topic,137808.msg969917.html#msg969917
sjhilton's version looks nicer (I made no attempt to format mine, it was just to illustrate)
-
Here is the code for mine. The square bracketed sections need to be completed with your player entity/custom text and the comments are for further explanation. Any questions please let me know.
(This should have the odd formatting fixed as well, which I fixed using https://onlineyamltools.com/minify-yaml and removing additional \n entries. I think this is a quirk of the YAML editor in HA.)
type: entities
entities:
- entity: media_player.[entity] # this bit is optional if you wanted to have a player function integrated. I didn't include this in mine as I use mini media player. It could be improved.
name: [insert text]
- type: custom:hui-element # this custom card needs to be installed using HACS or manually
card_type: markdown
content: >
## [Your title]
{% for track in state_attr('sensor.[name]_playlist',
'entries') %} {% if is_state_attr('media_player.[name]',
'media_title', track.Name) %} **{{ track.Name }}** <span
style="margin-left: 10px; font-size: smaller; display: block; margin-top:
-8px;">
{{ track["Track #"] }} - {{ track.Artist }} - {{ track.Album }} - {{ '%02d:%02d' % (track.Duration // 60, track.Duration % 60) }} ({{ '%02d:%02d' % (state_attr('media_player.[name]', 'media_position') // 60, state_attr('media_player.[name]', 'media_position') % 60) }})
</span> {% else %} {{ track.Name }} <span style="margin-left: 10px;
font-size: smaller; display: block; margin-top: -8px;">
{{ track["Track #"] }} - {{ track.Artist }} - {{ track.Album }} - {{ '%02d:%02d' % (track.Duration // 60, track.Duration % 60) }}
</span> {% endif %} <br> {% endfor %}
visibility: # Completely optional - I made my playlist disappear if media isn't playing. Delete these lines if you don't want to do this.
- condition: state
entity: media_player.[name]
state: playing
-
Home Assistant MC version 0.3.3
Media Center Windows 32.0.58
Since today the following error message
Setup failed, will try again: unhandled errors in a TaskGroup (1 sub-exception)
no devices and no entities.
Home Assistant log as attachment
Reinhard
-
looks like it is timing out when trying to talk to MC, implies problem at MC end
every error is during a call to MCWS/v1/Playback/Info
in your log you can see the timeout as
2024-10-31 11:23:26.054 DEBUG (MainThread) [custom_components.jriver.coordinator] Finished fetching jriver data in 5.638 seconds (success: False)
so it's sitting there blocked by jriver not responding
in my log, you can see a normal response time for comparison
2024-10-31 10:47:56.725 DEBUG (MainThread) [custom_components.jriver.coordinator] Finished fetching jriver data in 0.047 seconds (success: True)
-
looks like it is timing out when trying to talk to MC, implies problem at MC end
every error is during a call to MCWS/v1/Playback/Info
in your log you can see the timeout as
2024-10-31 11:23:26.054 DEBUG (MainThread) [custom_components.jriver.coordinator] Finished fetching jriver data in 5.638 seconds (success: False)
so it's sitting there blocked by jriver not responding
in my log, you can see a normal response time for comparison
2024-10-31 10:47:56.725 DEBUG (MainThread) [custom_components.jriver.coordinator] Finished fetching jriver data in 0.047 seconds (success: True)
I restarted MC, the configuration in HA was completed without errors.
But:
The PC with MC has been running for a week without restarting, MC too.
The PC only restarts when updates have been installed.
The error will then appear again at some point, right?
Reinhard
-
I restarted MC, the configuration in HA was completed without errors.
But:
The PC with MC has been running for a week without restarting, MC too.
The PC only restarts when updates have been installed.
The error will then appear again at some point, right?
Reinhard
Why doesn't the error occur with jremote?
The DLNA connection is the same.
-
Why doesn't the error occur with jremote?
The DLNA connection is the same.
There's no dlna connection, I have no idea how jremote is implemented so can't comment on similarities or differences. I have never seen such an error so can't say if it will recur. MC logs can be hard to read but probably you need to look there for further clues.
-
There's no dlna connection, I have no idea how jremote is implemented so can't comment on similarities or differences. I have never seen such an error so can't say if it will recur. MC logs can be hard to read but probably you need to look there for further clues.
JRemote uses MCWS calls, not DLNA.
-
Media Center Windows 32.0.58
mattkahn,
Should that version of MC work?
-
mattkahn,
Should that version of MC work?
yes it should work ok
-
If I had a hand installed version of JRiver (0.2.7) how should I switch to the new HACS integration?
-
just overwrite with latest files from the repo as per https://github.com/3ll3d00d/jriver_homeassistant?tab=readme-ov-file#manual-installation
-
Hi mattkhan,
I have this error pop-up consistently for one of my albums. Could it be a meta-data or file length issue? The album otherwise plays OK in MC.
Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:245
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 2:11:04 PM (1 occurrences)
Last logged: 2:11:04 PM
[140465782858384] Unexpected exception
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/config/custom_components/jriver/entity.py", line 59, in wrapper
await func(obj, *args, **kwargs)
File "/config/custom_components/jriver/media_player.py", line 548, in async_play_media
await _play_jriver_item()
File "/config/custom_components/jriver/media_player.py", line 519, in _play_jriver_item
_, node_id, _ = media_id.split("|", 3)
^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 3)
-
it's likely some unexpected format in the browse tree, perhaps a media type it don't understand?
not sure there's an easier way to debug than using chrome dev tools when using the browse function, go to the network tab, filter to WS only and type media_player as the filter, reload the page and you'll see a websocket entry, navigate through the browse tree till you get to the offending entry and you should see messages like in the pic going up for each one you click on
you'll see that I have to pack 3 pieces of info into a single string which is the id in the browse tree and the name
from your error, something is showing up there that does not have 3 tokens so need to find out where that comes from
-
Thanks mattkhan - I figured it out - it was the '|' (pipe) in the album title that was the problem.
-
Ah thanks, I picked | on "surely that won't be in any names" grounds :)
-
I want to try integrating JRiver into Home Assistant again today. I failed a quarter of a year ago. I was able to integrate JRiver and set up the Play module, but I always failed to display the Playing Now list.
Cheerful for a new one.
Hier die erste Frage.
"Specify additional library fields to expose as attributes on the playing now sensor(s)"
What does that mean???
Greetings, Reinhard
-
It's optional, it does exactly what it says, grabs those extra fields to add to those sensors
-
My status: JRiver set up as a media player.
I can select the views for DLNA Web JRemote and play music.
Now I have the same old problem again, no matter what I do I can't display the playing now list
Reinhard
-
Hard to comment further, probably need browser console logs and/or backend logs to take a guess at the cause
-
hi, is there anyway when browsing the media player on jriver to not show images and video as options?
-
Not that I know of though that's a HA feature rather than anything to do with this integration so you may want to ask on their forum. The browse UI is not the best unfortunately.
-
got it, thanks for the quick response
-
small fix pushed, the add_to_playlist service was broken
-
added another sensor (sensor.<server name>_ui_mode) which shows the current UI state as returned from MCWS/v1/UserInterface/Info
-
Hi guys,
I moved house a while ago and in the new place I haven't run MC for some three years or so for various reasons I won't bore you with. I am however seriously considering a Gen 11 NUC PC on which to run an HA dedicated instance and "obviously" this is an opportunity to re-instate my MC library full time as opposed to part time at the moment with the HA integration.
Here is my question. I had a big investment in Gizmo views which were presented onto my iPad(s) via the DNLA server interface. I only ever used MC as a server to distribute via the iPad to Sonos devices in various rooms.
What I want to know is, is there any way to port those views into a HACS installed MC instance ?
I do have a textual version of the views stored in my Microsoft One note JRiver notes page - but it's not clear to me from the notes on Github and this thread whether this is possible or not.
Apologies if I have missed something obvious!
Thanks in advance.
-
If you have a library backup, try installing MC33 on any PC and then restoring the backup. You can restore settings.
The wiki has details.
-
If you have a library backup, try installing MC33 on any PC and then restoring the backup. You can restore settings.
The wiki has details.
Hi Jim, thanks for your guidance. I do actually have MC instances [configured how I want it] instantiated and active on two PC's - albeit versions which will need newer licences when the time comes. However, and I might be missing something silly or overthinking this, I am imagining the MC interface installed via HACS on HA is not the same as the PC and so might not support [in Gizmo] what the PC code based instances do?
Perhaps they do and it will be very clear how to do it. But, I wanted to check with the forum here before I commit to the HA hardware platform purchase. The usability of the MC interface is a critical consideration. So before I sink a few hundred pounds I wanted to check that my views will work as before on a linux based HA MC HACS integration.
It's not a problem if they will not work, as it then becomes an alternate approach driver.
Thanks in advance for the support as always.
Every watt costs us over here so we have to be careful about always on devices. I would have preferred a Rasbperry but it will be just below the power I need for streaming movies and dynamic mobile transcodes to MP3 via MC.
Thanks again.
Anthony
-
if you use the HA media player widget then it provides a browse widget which is configured, using this integration, to navigate through the same views as those shown to any remote client (inc gizmo) so, in terms of navigation, it should be the same. Obviously the UI is a little different (imv it's not v good but ymmv).
however, from the wording of your post, I'm not sure if you think this is something it isn't. i.e. this is essentially just another remote which means you need an MC server running somewhere to be able to use it.
-
if you use the HA media player widget then it provides a browse widget which is configured, using this integration, to navigate through the same views as those shown to any remote client (inc gizmo) so, in terms of navigation, it should be the same. Obviously the UI is a little different (imv it's not v good but ymmv).
however, from the wording of your post, I'm not sure if you think this is something it isn't. i.e. this is essentially just another remote which means you need an MC server running somewhere to be able to use it.
God bless you !
Yes you have understood my confusion correctly thank you so much.
The HA integration IIUC is a media renderer which isn't what hoped / thought / comprehended / be / is / was intended [take your pick]. :)
Where would be the right place to post a question about the lowest compute unit possible on which to run MC [ and HA combined although not really a JRiver issue] - do you think ? I have read up on the Raspberry PI, but I know that is very low powered and there are attached storage considerations with that device [ even assuming I haven't misunderstood how that works too! ]