Logitech Media Server

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Logitech Media Server

Post by EdwinK »

pvm wrote: Thursday 20 September 2018 11:08 I do use 2 PiCoreplayers (and have added them to wiki as compatible). PiCoreplayer is using squeezelite under-the-hood)
The only thing not working is the remote control, but that hasn't been working for a long time.

Does your player function from within domoticz? Show 'now-playing' title?

Sorry been absent for some days. Domoticz was not playing nice to me. Yes, I do see some titles in the log.

Code: Select all

2018-09-27 10:14:09.350 Status: Logitech Media Server: Worker stopped...
2018-09-27 10:14:11.801 Status: Logitech Media Server: Worker started...
2018-09-27 10:14:11.801 Status: Logitech Media Server: 1 player-switch(es) found.
2018-09-27 10:14:11.871 Status: Logitech Media Server: 4 playlist(s) found.
2018-09-27 10:14:12.922 Logitech Media Server: (piCorePlayerHSK) Playing - 'Lipps Inc - Funky Town 2003 (Original Mix'
2018-09-27 10:14:12.893 Status: Logitech Media Server: 1 connected player(s) found.
2018-09-27 10:14:12.923 Error: EventSystem: Could not determine switch type for event device piCorePlayerHSK
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: Logitech Media Server

Post by Nautilus »

If you look at the devices table, can you see any switches under the LMS hardware? Anything strange with those?
LMS.JPG
LMS.JPG (94.5 KiB) Viewed 3157 times
Does it look similar?
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Logitech Media Server

Post by EdwinK »

Nope, no switches at all.

But on the hardware tab:
Screen Shot 2018-10-01 at 11.01.48.png
Screen Shot 2018-10-01 at 11.01.48.png (61.41 KiB) Viewed 3128 times
This is all.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: Logitech Media Server

Post by Nautilus »

Just to double-check - you've allowed new devices?
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Logitech Media Server

Post by EdwinK »

Yup.

Even done with disabling and re-enabling the hardware while Domoticz was looking for new switches

2018-10-02 11:03:21.370 Status: Logitech Media Server: 2 player-switch(es) found.
2018-10-02 11:03:21.450 Status: Logitech Media Server: 4 playlist(s) found.
2018-10-02 11:03:22.515 Logitech Media Server: (piCorePlayerHSK) Playing - 'Deniece Williams - Let's Hear It For The Boy'
2018-10-02 11:03:22.543 Logitech Media Server: (huiskamer TV) Stopped - ' - Radio10 - 80's Hits (Nederland)'
2018-10-02 11:03:22.468 Status: Logitech Media Server: 2 connected player(s) found.
2018-10-02 11:03:22.516 Error: EventSystem: Could not determine switch type for event device piCorePlayerHSK
2018-10-02 11:03:22.544 Error: EventSystem: Could not determine switch type for event device piCorePlayerHSK
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: Logitech Media Server

Post by Nautilus »

Then I guess the only option is to go back here: https://github.com/domoticz/domoticz/bl ... .cpp#L1502 and try to determine the reason for the error message to see if it would help in finding the root cause for the problems.

If I understand it correctly, the sql query returns as empty which then throws the error in question. Even though it refers to "switch type" I guess the reason for an empty query would be the fact that it is missing from the db (Name == '%q' -> does not exist). If you check the database, can you see anything there related to this hardware, for example in this DeviceStatus table? In any case, I'm afraid someone who has worked with this plugin would be needed to help you here...
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Logitech Media Server

Post by EdwinK »

Yes... Well.. I guess I just have be patient then. I'm not really confident enough to work in the database. :)
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
PaulWebster
Posts: 9
Joined: Saturday 06 May 2017 18:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: London, UK
Contact:

Re: Logitech Media Server

Post by PaulWebster »

Possible bug - deleted devices continue to be queried against LMS.

I was seeing entries in LMS logs saying something like:

Code: Select all

[18-10-12 14:58:02.5874] Slim::Web::JSONRPC::requestMethod (455) 00:11:22:33:44:55: request not dispatchable!
(edited the MAC address)
This means that LMS was not able to find the requested player.
In my case this is because those particular players no longer exist.
So - I used Domoticz web UI to delete the likely candidates (UI does not show MAC address) - via
Setup/Devices/checkbox on left/Delete at top of column
(incidentally the checkbox does not appear on my Chrome on Windows 10 - but does in MS Edge)
Queries continued to be sent to LMS.
Restarted Domoticz and rebooted server (RPi) but queries still sent to LMS.
So - looks like the Logitech Media Server type hardware either has its own tables or is not seeing a "deleted" flag in the main tables.

I removed the LMS type Hardware - and the polling to LMS stopped.
I then added it back in again and it discovered the players attached to LMS and did not poll for the deleted devices any more ... so I suspect that deleting the hardware is what made the entries really disappear from the database.
mschut
Posts: 108
Joined: Sunday 23 February 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.5613
Location: Netherlands
Contact:

Re: Logitech Media Server

Post by mschut »

xavier1306 wrote: Sunday 09 September 2018 8:55 Hi guys,

I am using the "SB audio alerts script" from here https://www.domoticz.com/wiki/Logitech_ ... ox_Players
Me too. At least, am really looking forward to. I already have the script in place, it is working, yeah. One limitation though, I am almost only using my LMS with Spotty for Spotify. And now the playlist is replaced by the chime and message, but the previously used Spotty playlist is not being resumed. Would this also be possible with the script?
User avatar
philchillbill
Posts: 399
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Logitech Media Server

Post by philchillbill »

mschut wrote: Monday 05 November 2018 23:44 ... but the previously used Spotty playlist is not being resumed. Would this also be possible with the script?
I checked it just now with Spotty (I had actually never used Spotify before myself) and after playing an alert it continued just fine with the current song from the correct position in the song. The now-playing _path is just something like spotify://track:2kLI2XQQaRjj5Xo4zAlHZn and the script handles that fine.

Do you have a playlists folder defined? The problem is that in LMS you still need to have a playlists folder defined, even if you are not using local music files. This needs to be defined in your LMS settings through the web-interface settings --> basic settings --> playlists folder. This requirement is hard-coded into LMS - when I save the current playlist in order to restore it again after the alert, the JSON RPC underpinnings need to have a directory to save that file in. Add a directory name and you should be good to go !

Note: The wiki entry did actually mention that the playlists folder needs to be defined but it was mentioned towards the end after the scripts and was easily overlooked. I've edited the wiki and moved it up under setup process and it now also specifically mentions Spotty
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
mschut
Posts: 108
Joined: Sunday 23 February 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.5613
Location: Netherlands
Contact:

Re: Logitech Media Server

Post by mschut »

philchillbill wrote: Tuesday 06 November 2018 9:53 Do you have a playlists folder defined? The problem is that in LMS you still need to have a playlists folder defined, even if you are not using local music files.
And of course, I remember reading that. However, I was thinking it should be something caused by the fact that the LMS and the Domoticz server are on 2 separate Pi's. Only to find out it does work properly now after only adding a playlist directory. Thanks a bunch. Starting to enjoy this feature now.

This succes leads me to my next question. I am using the first option (threading). However, if I use alerting on 1 device it works just fine. If I use 2 ("device1, device2"), the LMS server only shows the prechime name (and not the ttsfile name), and nothing is heard at all (also not the prechime). It does return nicely to the previous playlist though. What could be going wrong here?
User avatar
philchillbill
Posts: 399
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Logitech Media Server

Post by philchillbill »

Good to hear you solved the issue with the correct playlist resuming. The issue with listing multiple players is probably some kind of parsing error. To debug that, add the following lines to the perl script towards the very end:

Code: Select all

($players, $prechime, $ttsfile, $avol)=@ARGV;
@players=split(/,\s?/, $players);
becomes

Code: Select all

($players, $prechime, $ttsfile, $avol)=@ARGV;
@players=split(/,\s?/, $players);
print "Debug: @players\n$prechime\n$ttsfile\n$avol\n";

Go to the directory containing the perl script and run it directly from the command line (not via the bash script this time, as it will go to background and not display the debug info):

./sqalert.pl "livingroom, kitchen" Ring06.wav garageDoorOpen.mp3 60

but using the names of two of your players, your chime file, and your tts file. What gets printed?
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
mschut
Posts: 108
Joined: Sunday 23 February 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.5613
Location: Netherlands
Contact:

Re: Logitech Media Server

Post by mschut »

Hmm (thanks again for the quick response). However, it doesn't print anything, not with 2 devices, not with one...

I am on a Pi, connected through a SSH terminal.
mschut
Posts: 108
Joined: Sunday 23 February 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.5613
Location: Netherlands
Contact:

Re: Logitech Media Server

Post by mschut »

I also quickly tried the other script option (with sync). With one device this is working too, with more, same behaviour. I assume it has something to do with the " character.
User avatar
philchillbill
Posts: 399
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Logitech Media Server

Post by philchillbill »

Are you sure you ran the Perl script directly and not the bash? With the bash it’s logical that output is suppressed but the Perl is printing directly to your screen...


Sent from my iPhone using Tapatalk
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
mschut
Posts: 108
Joined: Sunday 23 February 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.5613
Location: Netherlands
Contact:

Re: Logitech Media Server

Post by mschut »

Ok, sharp this time. Direct perl

perl ./squeezealert.pl "Aanrecht, Woon" chimes.wav Door.mp3 50

results in:

Code: Select all

Debug: Aanrecht Woon
chimes.wav
Door.mp3
50
And it works as supposed.

Next, when I perform the script in Domoticz (scripts://sqalert.sh "Aanrecht, Woon" chimes.wav Door.mp3 50), the LMS only shows the prechime name, not the alert, and nothing is heard. The playlist is nicely returned though.
User avatar
philchillbill
Posts: 399
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Logitech Media Server

Post by philchillbill »

What does your sqalert.sh look like? How many parameters get passed to the Perl (the $1 $2 $3 etc)?


Sent from my iPhone using Tapatalk
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Logitech Media Server

Post by EdwinK »

pvm wrote: Thursday 20 September 2018 11:08 I do use 2 PiCoreplayers (and have added them to wiki as compatible). PiCoreplayer is using squeezelite under-the-hood)
The only thing not working is the remote control, but that hasn't been working for a long time.

Does your player function from within domoticz? Show 'now-playing' title?

After deleting. reinstalling, deleting and reinstalling again, suddenly the LMS is back in domoticz. So, now I'm making a backup of this setting to be sure it is there to stay ")
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
User avatar
philchillbill
Posts: 399
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Logitech Media Server

Post by philchillbill »

I've been playing around with sending json to the LMS server via the Domoticz UI instead of via JSON RPC calls to the LMS URL directly. I see that commands like:

Code: Select all

/json.htm?type=command&param=lmsmediacommand&idx=562&action=VolumeDown
work, as do VolumeUp, Forward, Rewind, etc. Looking in the CPP source file, I see that there's also an action 'SetVolume' but I've no idea how to specify the value for that. Same is true of 'PlayPlaylist'. Can somebody give an example (non-LUA) of how to define these values from a json URL?
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

Re: Logitech Media Server

Post by pvm »

EdwinK wrote: Friday 07 September 2018 23:22 Now I get this error:
2018-09-07 23:20:11.091 Logitech Media Server: (piCorePlayerHSK)'
2018-09-07 23:20:11.066 Status: Logitech Media Server: 1 connected player(s) found.
2018-09-07 23:20:11.093 Error: EventSystem: Could not determine switch type for event device piCorePlayerHSK
How to fix?
EdwinK, I think I've found the issue. I reinstalled my complete domoticz setup and after a couple of days I got the same error, complaining about 'somename' .
  • My player, in the logitech media server hardware screen, was called 'somename')
  • My player, in the 'switch' screen was called, 'somenameLMS'.
When I changed the device name (in switch screen) back to 'somename' the error disappeared.
(I'm running beta 4.10394 on synology nas)
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest