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

dgonneau
Posts: 7
Joined: Tuesday 16 February 2016 15:01
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Logitech Media Server

Post by dgonneau »

Nautilus wrote:
This would be very nice but I doubt there is much interest for anyone to start the development.
I sure have some interest, especially in regards to the new plugin api ;). Sadly I lack time on my own :)
Nautilus wrote: I have though about hacking something together with izsynth (search the forum) which I already have running and e.g. https://www.domoticz.com/forum/viewtopic.php?t=15188 so that first the tts audio file would be copied to the location where LMS will pick it up and play it. But haven't yet done anything to actually piece these together...:)
How did you make izsynth work on your syno ? At first glance, with the list of dependencies required, I didn't find everything on my optware-ng bootstrapped syno.

I guess it shouldn't be too hard to generate an mp3 and pass it to the LMS with the script you mentioned.
I also harvested some ressources to help with starting a script for that matter. Will look into this and will eventually make my own script or even a plugin.

Nicest integration would also mean that a notification plays well with an already playing song on lms (resuming previously playing song with the correct volume). Some people already tried to make it work with several script commands.

Wonder how Sonos behaves.
Another solution is to use an Android tablet running Imperihome.

For what it's worth, I believe Jeedom has tts on its lms plugin :roll:
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 »

Sorry, should have mentioned I'm not running this from a Syno but RPi2. But maybe there are some hints in the izsynth thread on how to make it work on Syno as well. The perl script I referenced should already take care of resuming the power status / playlist / song position etc. though as mentioned I haven't tried it myself.

If you google a bit, you'll find several home automation platforms with tts on lms :D Not a developer myself but in case you or someone else has interest I'm sure there are good examples available from those :)

Edit. curiosity got the best of me, the perl script works well on RPi at least. For now I just manually copied the file from /dev/shm to a place where the lms can play it. Announcement starts in less than a second from running the script (I'd say) and player resumes to original status. I didn't notice first there's a place to set the announcement volume and startled myself by playing the announcement at volume level 65 while I was listening to radio at level 15...:)
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 »

Would it be possible to store more information out of the 'Now playing data' ?
I would like to have the artwork URL in Domoticz. Goal is to use this in the Dashticz 2.0 dashboard

I assume something like this is used?
(part of my previous PHP scripting)

Code: Select all

	$url = 'http://192.168.1.2:9002/jsonrpc.js';

	$ch = curl_init($url);
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, '{"id": 1,"method": "slim.request", "params": ["b8:27:eb:37:64:93", ["status","-",1,"tags:gABbehldiqtyrSuoKLN"]]}');
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

	$response = curl_exec($ch);
	curl_close($ch);
    
	//return JSON data
	echo $response;
this response also gives album art for spotify:

Code: Select all

{"params":["b8:27:eb:37:64:93",["status","-",1,"tags:gABbehldiqtyrSuoKLN"]],"result":{"player_ip":"192.168.1.201:34500","playlist_loop":[{"playlist index":0,"id":"-197226104","title":"Me & Mr Jones","artist":"Amy Winehouse","album":"Back To Black (Deluxe Edition)","duration":"153","year":"0","bitrate":"320k VBR","url":"spotify://track:0RfzQhbvtn5lOaKdhpAni7","type":"Ogg Vorbis (Spotify)","artwork_url":"https://i.scdn.co/image/5c8d379181d18fa3d95d024426fe6cfc2d29cffa","info_link":"plugins/spotifylogi/trackinfo.html"}],"remote":1,"power":1,"mode":"play","playlist shuffle":0,"playlist_timestamp":1492959201.02607,"player_connected":1,"can_seek":1,"seq_no":0,"playlist_tracks":1,"playlist repeat":0,"mixer volume":20,"time":81.4347388267517,"player_name":"Keuken","remoteMeta":{"id":"-197226104","title":"Me & Mr Jones","artist":"Amy Winehouse","album":"Back To Black (Deluxe Edition)","duration":"153","year":"0","bitrate":"320k VBR","url":"spotify://track:0RfzQhbvtn5lOaKdhpAni7","type":"Ogg Vorbis (Spotify)","artwork_url":"https://i.scdn.co/image/5c8d379181d18fa3d95d024426fe6cfc2d29cffa","info_link":"plugins/spotifylogi/trackinfo.html"},"signalstrength":0,"playlist_cur_index":"0","current_title":"Me & Mr Jones by Amy Winehouse from Back To Black (Deluxe Edition)","rate":1,"playlist mode":"off"},"id":1,"method":"slim.request"}
The artwork is stored in result.remoteMeta.artwork_url, it is a direct url to the image

response for local audio:

Code: Select all

{"params":["b8:27:eb:37:64:93",["status","-",1,"tags:gABbehldiqtyrSuoKLN"]],"method":"slim.request","id":1,"result":{"playlist mode":"off","rate":1,"signalstrength":0,"playlist_cur_index":"0","player_name":"Keuken","mixer volume":20,"time":15.008100467419,"duration":228.136,"playlist repeat":0,"seq_no":0,"playlist_tracks":15,"playlist_timestamp":1492959432.65667,"player_connected":1,"can_seek":1,"mode":"play","playlist shuffle":0,"playlist_loop":[{"playlist index":0,"id":88,"title":"Rolling in the Deep","genre":"Soul and R&B","albumartist":"Adele","composer":"Adele Adkins, Paul Epworth","trackartist":"Adele","album_id":7,"album":"21","duration":228.136,"disc":1,"disccount":1,"tracknum":1,"year":2011,"bitrate":"1412kbps VBR","albumartist_ids":"7","composer_ids":"8, 9","trackartist_ids":"7","url":"file:///volume1/Music/FLAC/Adele/21/01%20-%20Adele%20-%20Rolling%20In%20the%20Deep.flac","type":"flc"}],"power":1,"player_ip":"192.168.1.201:34508"}}
The artwork is not in? somehow the LMS browser client can show album art however....
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
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 »

I have just installed Domoticz to experiment with basic controls of LMS players via Siri/Apple Home.

Route is Siri/Homekit etc-> Homebridge -> eDemoticz -> Demoticz -> LMS

I can soft power off/on the players via this route
However, I cannot control the volume (as light brightness) except for setting it to 0 which does a Power Off.

I am able to change the volume via the Domoticz web UI remote control that pops up for the LMS plugin.

In the Domoticz logs I see numbers appearing when I change the brightness (range 0-15) - with no discernible change in the audio volume or the volume slider on the player.
However, if I change via the Domoticz web remote control I do not see numbers appearing the the log.

Do I need to find a way to make the numbers go from 0-100 rather than 0-15 - or is this simply something that cannot work without more significant software changes?

LMS 7.9
User avatar
capman
Posts: 153
Joined: Friday 12 July 2013 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Belgium
Contact:

Re: Logitech Media Server

Post by capman »

pvm wrote:Would it be possible to store more information out of the 'Now playing data' ?
I would like to have the artwork URL in Domoticz. Goal is to use this in the Dashticz 2.0 dashboard

I assume something like this is used?
(part of my previous PHP scripting)
-- cut --
The artwork is not in? somehow the LMS browser client can show album art however....
A want also some artwork on my dashticz dashboard. See my request http://www.domoticz.com/forum/viewtopic ... 67&t=17424.
Can you explain your script ,what it does , how it works , where to put it , ...

Thanks.
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 »

Capman, an old post of mine on that subject : http://www.domoticz.com/forum/viewtopic ... ipt#p39828
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
User avatar
capman
Posts: 153
Joined: Friday 12 July 2013 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Belgium
Contact:

Re: Logitech Media Server

Post by capman »

pvm wrote:Capman, an old post of mine on that subject : http://www.domoticz.com/forum/viewtopic ... ipt#p39828
Yes a already found that, but how do you do this ? Also the tabs on the bottom ?
It's verry nice and a searching for some solution to view the covers from whats playing on my dashboard for ages :roll:
Now a installed jivelite to control and view my music but than a have none domoticz control (+info). So a want both of them ;) .
Hope you can put me in the right direction ...what to do with the homecentral files ...
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 »

The homecentral files are php files. They need to be on a server with PHP support.
This 'dashboard' (Logitech part) runs independently from Domoticz and the other tabs are not filled. If I remember correctly the temperature data comes from Domoticz.
This development is not plug-and-play (and was not finished).
If you have more questions I might be able to help (I do not have this running at the moment)
Maybe we can get this integrated into dashticz
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
User avatar
capman
Posts: 153
Joined: Friday 12 July 2013 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Belgium
Contact:

Re: Logitech Media Server

Post by capman »

pvm wrote:The homecentral files are php files. They need to be on a server with PHP support.
This 'dashboard' (Logitech part) runs independently from Domoticz and the other tabs are not filled. If I remember correctly the temperature data comes from Domoticz.
This development is not plug-and-play (and was not finished).
If you have more questions I might be able to help (I do not have this running at the moment)
Maybe we can get this integrated into dashticz
That was my goal , to integrate it in some frontpage like dashticz.
A running domoticz on my synology nas. I gonna see if a can do something with your python files. Otherwise a ask it in the dashticz forum how to integrate it :) . Hope someone can and will do this. My coding is limit to copy / paste :D . Thanks 4 helping so far ;)
User avatar
capman
Posts: 153
Joined: Friday 12 July 2013 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Belgium
Contact:

Re: Logitech Media Server

Post by capman »

I have ask the question in the dahticz request forum (http://www.domoticz.com/forum/viewtopic ... 89#p134389).
Hopefully there are some who can integrate it in dashticz. Thanks for your help :)
burton666
Posts: 85
Joined: Monday 17 August 2015 21:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Logitech Media Server

Post by burton666 »

This is probably a stupid question but I have installed LMS on a raspberry pi and added some plugins like chromecast and spotify but how do I send/play audio to the 3.5mm audio plug on the raspberry pi? Or should I install LMS like a controller and install squeezeplug from https://www.max2play.com on every pi that I want to be able to play audio from?
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 »

burton666 wrote:how do I send/play audio to the 3.5mm audio plug on the raspberry pi?
Install Squeezelite as your player and if you have RPi official display as well then install JiveLite as well for a Squeezebox Touch-like experience.

I use piCorePlayer as the starting point for my RPi installations - includes option to install LMS.
User avatar
philchillbill
Posts: 396
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Logitech Media Server

Post by philchillbill »

For anybody interested in playing alert sounds or TTS messages from Domoticz on a Squeezebox, I've edited the wiki and added a section with a working perl script to do this. Enjoy !

https://www.domoticz.com/wiki/Logitech_ ... ox_Players
Last edited by philchillbill on Monday 24 July 2017 15:04, edited 2 times in total.
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
tottka
Posts: 19
Joined: Wednesday 19 July 2017 19:50
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: US
Contact:

Re: Logitech Media Server

Post by tottka »

I've just started out with Domoticz and trying to implement the LMS Alerts feature. I have never used Perl but understand the code well enough to understand what the script is doing. I've had to add the following:
sudo apt-get install libjson-perl
sudo apt-get install libwww-perl
sudo apt-get install libjson-RPC-perl

At this point I get an error message: Can't locate JSON/RPC/Client.pm in @INC (you may need to install the JSON::RPC::Client module) (@INC contains: /etc/perl /usr/local/lib/arm-linux-gnueabihf/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/arm-linux-gnueabihf/perl5/5.20 /usr/share/perl5 /usr/lib/arm-linux-gnueabihf/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at squeeze.pl line 7.

Now I see a similar situation documented here:
http://forums.slimdevices.com/showthrea ... -CLI/page3
Post #22 thru #26

Not really knowing what I'm doing now, Is this the correct procedure to follow for Domoticz. Or does the script need changed in the documentation?
thanks
User avatar
philchillbill
Posts: 396
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Logitech Media Server

Post by philchillbill »

Coincidentally, I just updated the perl version on my lesser-used laptop to 5.24 and also got an error installing the json rpc module. I got around it by typing 'cpan install JSON::RPC::Client' to install it instead of doing apt-get. No real idea why it doesn't work but that module is an older one and might not have been updated to work with the latest perl greatness. This is purely about getting the correct prerequisite modules on your machine - the script itself is still fine.
Last edited by philchillbill on Monday 24 July 2017 15:04, edited 1 time in total.
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
tottka
Posts: 19
Joined: Wednesday 19 July 2017 19:50
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: US
Contact:

Re: Logitech Media Server

Post by tottka »

Thank you so much for your quick response, it's gotten me a little further. I am now getting the following error message: No such file or directory at squeeze.pl line 82. When I watch the LMS server I see it bring up my Alert, play the Alert and then shows empty on the playlist panel. I tried this while playing both music from TIDAL & myMusic, same result.

The Domoticz Log is showing:
2017-07-24 05:35:55.851 SQUEEZEALERT: played alert 'file:///mnt/share/Music/wz1976-10-13trk03.flac' on player livingroom
2017-07-24 05:36:04.499 Logitech Media Server: (max2play3) Playing - 'Warren Zevon - Simple Man, Simple Dream (1976)'
2017-07-24 05:36:34.572 Logitech Media Server: (max2play3) Stopped - '(empty playlist)'

For testing purposes I choose Warren Zevon song as alert, that works but no restore.
Thanks
User avatar
philchillbill
Posts: 396
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Logitech Media Server

Post by philchillbill »

That error/warning you are getting around line 82 is coming from the statement

unlink('/play/curplayer.m3u') or warn $!; # delete the temp playlist

which just deletes the temporary playlist as a cleanup measure (it's a hygiene factor so is not critical). I have '/play' defined as a symbolic link to where all my playlists are stored so you can either also do that or else replace /play with the full path to where your LMS stores playlists (the temp file is called 'curplayer.m3u'). If you don't mind leaving that playlist there among your 'real' playlists then you can even just comment out that line of perl by adding a # in front to suppress the message. Anyway, it's just a warning so it's not blocking the rest of the script in any way.

Were you actually playing music when you sent the alert? If not then the playlist to be restored after the alert is finished may actually be empty. In that case the player just stays in stop mode with an empty playlist and you are seeing correct behaviour. Try it while playing something and you should see it all restores correctly to whatever was playing. I tested it thoroughly with 6 players in my house for a few days before I put this script online so I know it works ok.
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
tottka
Posts: 19
Joined: Wednesday 19 July 2017 19:50
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: US
Contact:

Re: Logitech Media Server

Post by tottka »

Yes I am actually playing music and it doesn't restore, just leaves an empty playlist.
I tired this while playing music on Tidal & my own music and I get the same result.
Thanks
User avatar
philchillbill
Posts: 396
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's in the curplayer.m3u file that's created for you? Do you have a playlists folder defined in LMS?
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
tottka
Posts: 19
Joined: Wednesday 19 July 2017 19:50
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: US
Contact:

Re: Logitech Media Server

Post by tottka »

I do now, and of course it works! Thank You!

I notice it restarts the song I was playing at the beginning, is that by design?

Thank you for getting me this far.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests