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

It shouldn't restart the song but should continue from the time index that was playing (it's deliberately saved). Do the line-endings in your script match your operating system? They can be <CR>, <LF> or both. I had this issue myself at some stage while testing the script but forget how I resolved it in the end and what was causing it. It was related to the noplay:0 and noplay:1 somehow. What version of LMS are you running?
Last edited by philchillbill on Thursday 03 August 2017 19:55, edited 1 time in total.
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
freakshock
Posts: 64
Joined: Friday 14 April 2017 13:39
Target OS: NAS (Synology & others)
Domoticz version:
Location: The Netherlands
Contact:

Re: Logitech Media Server

Post by freakshock »

I just started using LMS.
I added it to Domoticz succesfully and am able to power player (chromecast) on/off and pause playing via blockly.
The remote in the Domoticz GUI however does not work and looks like this:
domremotegray.jpg
domremotegray.jpg (18.22 KiB) Viewed 4148 times
I tried updating my domoticz but that does not help. I'm on version 3.8434 right now.
Does anyone know how to solve this?
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 »

I've updated the alerts-playing perl script in the LMS wiki entry to auto-delete the temporary playlist and to play a pre-chime sound before the actual audio message is played. The overall code is tidier now also.

https://www.domoticz.com/wiki/Logitech_ ... ox_Players
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
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 »

I've added a new section to the LMS wiki about reading out the internal light-sensor in the SB Radio and SB Touch with Domoticz. You can find it here:

https://www.domoticz.com/wiki/Logitech_ ... d_SB-Touch
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
chatainsim
Posts: 101
Joined: Wednesday 25 March 2015 10:46
Target OS: Linux
Domoticz version: v4.11307
Location: France
Contact:

Re: Logitech Media Server

Post by chatainsim »

freakshock wrote: Thursday 27 July 2017 18:24 I just started using LMS.
I added it to Domoticz succesfully and am able to power player (chromecast) on/off and pause playing via blockly.
The remote in the Domoticz GUI however does not work and looks like this:
domremotegray.jpg
I tried updating my domoticz but that does not help. I'm on version 3.8434 right now.
Does anyone know how to solve this?
I have the same issue.
DutchHans
Posts: 229
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Logitech Media Server

Post by DutchHans »

Me too...
User avatar
gijsje
Posts: 132
Joined: Saturday 19 August 2017 14:28
Target OS: NAS (Synology & others)
Domoticz version: Stable
Location: Berkel Enschot, NL
Contact:

Re: Logitech Media Server

Post by gijsje »

Me 3
Any solution for an empty remote??
Synology DS218+ - RFXtrx433 - Aeotec Z-Stick Gen5 - Toon Thermostat - Neo CoolCam plug - Neo CoolCam PIR - FIBARO PIR - Heiman Smart Smoke Senso - Neo CoolCam Leakage Detector - BeNext Tag Reader - P1 and S0 USB - many Mi-Light lights - KAKU switches
kllngtme
Posts: 47
Joined: Tuesday 14 June 2016 16:56
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: East Coast, USA
Contact:

Re: Logitech Media Server

Post by kllngtme »

philchillbill wrote: Wednesday 04 October 2017 11:42 I've added a new section to the LMS wiki about reading out the internal light-sensor in the SB Radio and SB Touch with Domoticz. You can find it here:

https://www.domoticz.com/wiki/Logitech_ ... d_SB-Touch
Nicely done!
MsbS
Posts: 35
Joined: Friday 19 May 2017 14:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Logitech Media Server

Post by MsbS »

gijsje wrote: Saturday 21 October 2017 12:37 Me 3
Any solution for an empty remote??
Same here, Win10 Firefox, but I noticed the buttons appear correctly when you hover over them (then disappear again).
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 »

philchillbill wrote: Thursday 06 July 2017 20:37 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
How can I install this with domoticz running on my synology ? Perl is also installed. It's like I can't install the perl modules with 'cpan'.
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 »

Since some time I notice that the Logitech Media Server is shown as disconnected on the domoticz tiles. I don't get any song titles or anything at all. When I'm using the Dashticz frontpage, the mediaplayer is shown, and can be used to stop/play/forward music, but still not titles are shown.

When looking at the 'current states':
Screen Shot 2017-11-14 at 09.57.06.png
Screen Shot 2017-11-14 at 09.57.06.png (16.27 KiB) Viewed 3595 times
Time and date seems to update.
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: 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 »

capman wrote: Saturday 11 November 2017 16:20 How can I install this with domoticz running on my synology ? Perl is also installed. It's like I can't install the perl modules with 'cpan'.
CPAN on Synology is not easy to configure. I love my Synology (and have a big and fast one), but it's not a great machine to play on because its BusyBox Linux is pretty lame. That's why I run my Domoticz on a NUC under Ubuntu where I have much more flexibility. So sorry, I can't help you on that.
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
kllngtme
Posts: 47
Joined: Tuesday 14 June 2016 16:56
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: East Coast, USA
Contact:

Re: Logitech Media Server

Post by kllngtme »

qwerk wrote: Friday 14 October 2016 12:41 Logitech is working fine from Domoticz.

I am trying to control my players from blockly, On, Off, is working fine. But playing a playlist or setting a volume level is not working.
1.JPG

2.JPG

What should I change?
Did you end up figuring this out? I'm trying to setup a blockly event to play a playlist as well but can't get it going.
User avatar
havnegata
Posts: 114
Joined: Wednesday 10 September 2014 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10162
Location: Norway
Contact:

Re: Logitech Media Server

Post by havnegata »

kllngtme wrote: Thursday 07 December 2017 19:47
qwerk wrote: Friday 14 October 2016 12:41 Logitech is working fine from Domoticz.

I am trying to control my players from blockly, On, Off, is working fine. But playing a playlist or setting a volume level is not working.
1.JPG

2.JPG

What should I change?
Did you end up figuring this out? I'm trying to setup a blockly event to play a playlist as well but can't get it going.
I am not sure, but setting volume I think you need LUA for, but playing playlists you should use:
Screen Shot 12-21-17 at 12.12 PM.PNG
Screen Shot 12-21-17 at 12.12 PM.PNG (6.58 KiB) Viewed 3302 times
This is the url:
http://192.168.1.107:9000/status.html?p ... 2.168.1.15
The first ip-address and port is for your LMS. My playlist is named "test" and yhe last ip-address is for your Squeezebox

This is my LUA for setting volume. It pretty much does the same as the blockly apart from the volume-thing:

Code: Select all

commandArray = {}

time = os.date("*t")
--mellom kl 05 og 10
if (time.hour >= 5) or (time.hour <= 11) then
if ((otherdevices['JUL'] == 'On') and (otherdevices['Squeezebox Radio'] ~= 'On') and (uservariables ['Squeezebox'] == 0) and (devicechanged['StueNord_bevegelse'] == 'Motion')) then
print('Det er julaften!')
commandArray[1]={['Squeezebox Radio']='On'}
print('Radioen er påslått')
commandArray[2]={['OpenURL']='http://192.168.1.107:9000/status.html?p0=playlist&p1=play&p2=jul2&p3=192.168.1.15'}
print('Radioen spiller')
--commandArray[3]={['Squeezebox Radio']='Play'}
commandArray[4]={['Squeezebox Radio']='Set Volume 75'}
print('Høyere volum')
commandArray[5]={['Variable:Squeezebox']='1 AFTER 5'}
end
elseif (devicechanged['SomeoneHome'] == 'Off') then
commandArray['Variable:Squeezebox']='0 AFTER 20'
end

return commandArray
I'm no coder so the elseif part is not working, but playing the playlist works!
User avatar
havnegata
Posts: 114
Joined: Wednesday 10 September 2014 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10162
Location: Norway
Contact:

Re: Logitech Media Server

Post by havnegata »

Nautilus wrote: Friday 04 December 2015 9:47
Eduard wrote:* Added state 'Disconnected' when device (or App) is unavailable
This is a great plugin for Domoticz, thank you! I have a situation where a couple of my players get disconnected from LMS and the only way to connect them again to LMS is to power cycle them. I'd like to automate this process with the help of Domoticz and power switches. However, if I look at Blocky, the status of the disconnected player is shown as "Stopped". Do I need to / can I use Lua instead to act on only disconnected players? Having never done anything with Lua, any pointers on where to start? :) Thanks again!

edit: that was easy enough (not sure how elegant the solution but it works :))

Code: Select all

commandArray = {}
if (devicechanged['Squeezebox Radio'] == 'Disconnected') then
        print('Squeezebox Radio detected as disconnected - power cycling')
        os.execute('/home/pi/domoticz/scripts/[script to set "SB Radio Power" off via Telldus Live]')
        commandArray['SB Radio Power'] = 'On'
end
return commandArray
I've set on delay of 20 seconds for "SB Radio Power" so it does not turn it back on immeadiately after, I guess even a few seconds would be enough. Furthermore I assumed I cannot execute both Off and On for the same device in same command array, thus calling the script directly first.
@Nautilus, Would you care to share the script for turning the radio off? I have the same problem
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 »

havnegata wrote: Friday 29 December 2017 13:02 @Nautilus, Would you care to share the script for turning the radio off? I have the same problem
Hi,

the "script" I was pointing to in the text you quoted was for my 433Mhz power plug that at the time I was controlling via Tellstick Net. So that part was to switch the power of completely, not just turn it off. Since then I've gotten RFLink so I can control the plugs directly from Domoticz and also improved the network at our home so actually I don't suffer from the disconnect problems anymore.

But if you clarify a bit more what it is that you want to achieve (as I guess it is not about controlling 433Mhz plugs via Tellstick Net? :)) I can try to help...
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 »

You can turn off a player via a HTTP command using this syntax:

http://192.168.1.1:9000/status.html?p0= ... 0:18:e8:3c

power_on /power_toggle will also work in place of power_off.

However, Logitech recommends using the JSON RPC construct instead of HTTP. You can look at the wiki on LMS at my entry on playing alerts to see how this can be done from perl. Should be trivial to rewrite to Lua or Bash.
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
User avatar
havnegata
Posts: 114
Joined: Wednesday 10 September 2014 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10162
Location: Norway
Contact:

Re: Logitech Media Server

Post by havnegata »

philchillbill wrote:You can turn off a player via a HTTP command using this syntax:

http://192.168.1.1:9000/status.html?p0= ... 0:18:e8:3c

power_on /power_toggle will also work in place of power_off.

However, Logitech recommends using the JSON RPC construct instead of HTTP. You can look at the wiki on LMS at my entry on playing alerts to see how this can be done from perl. Should be trivial to rewrite to Lua or Bash.
Thanks!
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 »

havnegata wrote: Sunday 31 December 2017 17:09
philchillbill wrote:You can turn off a player via a HTTP command using this syntax:

http://192.168.1.1:9000/status.html?p0= ... 0:18:e8:3c

power_on /power_toggle will also work in place of power_off.

However, Logitech recommends using the JSON RPC construct instead of HTTP. You can look at the wiki on LMS at my entry on playing alerts to see how this can be done from perl. Should be trivial to rewrite to Lua or Bash.
Thanks!
A good overview of the http api for LMS: http://tutoriels.domotique-store.fr/con ... -http.html
User avatar
havnegata
Posts: 114
Joined: Wednesday 10 September 2014 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10162
Location: Norway
Contact:

Re: Logitech Media Server

Post by havnegata »

philchillbill wrote: Sunday 31 December 2017 0:40 ...
However, Logitech recommends using the JSON RPC construct instead of HTTP. You can look at the wiki on LMS at my entry on playing alerts to see how this can be done from perl. Should be trivial to rewrite to Lua or Bash.
No coder, but trying to read your perl script, is this portion related to rebooting my Squeezebox somehow?:

sub checkOnOffline {
my ($idx, $checkfor)=@_;
$ua=LWP::UserAgent->new; $ua->timeout(5);
$retrieve=$ua->get($url{domo}.'/json.htm?type=devices&rid='.$idx);
$res=$retrieve->decoded_content;
if ($retrieve->is_success) { $jres = decode_json $res } else { warn "checkOnOffline: ", $retrieve->status_line };
$state=$$jres{result}[0]->{Status}; # 'On', 'Off', 'Open', 'Closed', 'Disconnected' etc
if ($state=~m/\b$checkfor\b/) { $status=1 } else { $status=0 };
return $status;
}

sub squeezeAlert {
my ($player, $prechime, $tts)=@_;
$client=new JSON::RPC::Client;
$playerid=$players{$player}{mac}; $idx=$players{$player}{idx};
$offline=&checkOnOffline($idx, 'Disconnected'); if ($offline) { return };
&logMessage("SQUEEZEALERT: played alert '$tts' on player $player");
# Get current player state so it can be restored when alert is finished
$res = $client->call( $url{lms}, { method => 'slim.request', params => [ $playerid, ['power', '?'] ] });
if ($res->is_error) { warn "squeezeAlert:", $client->status_line; return };
$jres = $res->jsontext; $jdata=decode_json $jres; $power=$$jdata{result}{_power};
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest