Logitech Media Server

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.
User avatar
EdwinK
Posts: 1378
Joined: Sunday 22 January 2017 22:46
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Logitech Media Server

Post by EdwinK » Thursday 27 September 2018 10:19

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) | RFxcom | Dashticz V2

Nautilus
Posts: 780
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi
Domoticz version: beta
Location: Finland
Contact:

Re: Logitech Media Server

Post by Nautilus » Thursday 27 September 2018 10:54

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 371 times
Does it look similar?

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

Re: Logitech Media Server

Post by EdwinK » Monday 01 October 2018 11:03

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 343 times
This is all.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | RFxcom | Dashticz V2

Nautilus
Posts: 780
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi
Domoticz version: beta
Location: Finland
Contact:

Re: Logitech Media Server

Post by Nautilus » Monday 01 October 2018 23:23

Just to double-check - you've allowed new devices?

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

Re: Logitech Media Server

Post by EdwinK » Tuesday 02 October 2018 11:02

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) | RFxcom | Dashticz V2

Nautilus
Posts: 780
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi
Domoticz version: beta
Location: Finland
Contact:

Re: Logitech Media Server

Post by Nautilus » Tuesday 02 October 2018 23:35

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: 1378
Joined: Sunday 22 January 2017 22:46
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Logitech Media Server

Post by EdwinK » Wednesday 03 October 2018 9:57

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) | RFxcom | Dashticz V2

PaulWebster
Posts: 9
Joined: Saturday 06 May 2017 18:32
Target OS: Raspberry Pi
Domoticz version:
Location: London, UK
Contact:

Re: Logitech Media Server

Post by PaulWebster » Friday 12 October 2018 16:21

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: 144
Joined: Sunday 23 February 2014 22:40
Target OS: Raspberry Pi
Domoticz version: V3.5613
Location: Netherlands
Contact:

Re: Logitech Media Server

Post by mschut » Tuesday 06 November 2018 0:44

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: 228
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Logitech Media Server

Post by philchillbill » Tuesday 06 November 2018 10:53

mschut wrote:
Tuesday 06 November 2018 0: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
NUC/Ubuntu, Evohome Heating + HGI80, Evohome Security, 4x HikVision IP cams, Aeotec, Neo & Fibaro Z-Wave, Logitech Media Server (on Synology DS916+), 10x SqueezeBox, Kodi, Harmony Hub, 5x Amazon Echo, HA-Bridge, Hue.

mschut
Posts: 144
Joined: Sunday 23 February 2014 22:40
Target OS: Raspberry Pi
Domoticz version: V3.5613
Location: Netherlands
Contact:

Re: Logitech Media Server

Post by mschut » Tuesday 06 November 2018 22:28

philchillbill wrote:
Tuesday 06 November 2018 10: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: 228
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Logitech Media Server

Post by philchillbill » Wednesday 07 November 2018 0:27

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?
NUC/Ubuntu, Evohome Heating + HGI80, Evohome Security, 4x HikVision IP cams, Aeotec, Neo & Fibaro Z-Wave, Logitech Media Server (on Synology DS916+), 10x SqueezeBox, Kodi, Harmony Hub, 5x Amazon Echo, HA-Bridge, Hue.

mschut
Posts: 144
Joined: Sunday 23 February 2014 22:40
Target OS: Raspberry Pi
Domoticz version: V3.5613
Location: Netherlands
Contact:

Re: Logitech Media Server

Post by mschut » Wednesday 07 November 2018 14:50

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: 144
Joined: Sunday 23 February 2014 22:40
Target OS: Raspberry Pi
Domoticz version: V3.5613
Location: Netherlands
Contact:

Re: Logitech Media Server

Post by mschut » Wednesday 07 November 2018 15:11

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: 228
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Logitech Media Server

Post by philchillbill » Wednesday 07 November 2018 16:04

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
NUC/Ubuntu, Evohome Heating + HGI80, Evohome Security, 4x HikVision IP cams, Aeotec, Neo & Fibaro Z-Wave, Logitech Media Server (on Synology DS916+), 10x SqueezeBox, Kodi, Harmony Hub, 5x Amazon Echo, HA-Bridge, Hue.

mschut
Posts: 144
Joined: Sunday 23 February 2014 22:40
Target OS: Raspberry Pi
Domoticz version: V3.5613
Location: Netherlands
Contact:

Re: Logitech Media Server

Post by mschut » Wednesday 07 November 2018 22:57

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: 228
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Logitech Media Server

Post by philchillbill » Wednesday 07 November 2018 23:46

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
NUC/Ubuntu, Evohome Heating + HGI80, Evohome Security, 4x HikVision IP cams, Aeotec, Neo & Fibaro Z-Wave, Logitech Media Server (on Synology DS916+), 10x SqueezeBox, Kodi, Harmony Hub, 5x Amazon Echo, HA-Bridge, Hue.

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

Re: Logitech Media Server

Post by EdwinK » Thursday 08 November 2018 13:02

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) | RFxcom | Dashticz V2

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests