Page 14 of 21

Re: Logitech Media Server

Posted: Monday 24 July 2017 17:06
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?

Re: Logitech Media Server

Posted: Thursday 27 July 2017 18:24
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 4366 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?

Re: Logitech Media Server

Posted: Thursday 17 August 2017 13:40
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

Re: Logitech Media Server

Posted: Wednesday 04 October 2017 11:42
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

Re: Logitech Media Server

Posted: Monday 16 October 2017 16:09
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.

Re: Logitech Media Server

Posted: Monday 16 October 2017 17:12
by DutchHans
Me too...

Re: Logitech Media Server

Posted: Saturday 21 October 2017 12:37
by gijsje
Me 3
Any solution for an empty remote??

Re: Logitech Media Server

Posted: Wednesday 25 October 2017 14:10
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!

Re: Logitech Media Server

Posted: Wednesday 25 October 2017 14:33
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).

Re: Logitech Media Server

Posted: Saturday 11 November 2017 16:20
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'.

Re: Logitech Media Server

Posted: Tuesday 14 November 2017 9:58
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 3813 times
Time and date seems to update.

Re: Logitech Media Server

Posted: Thursday 16 November 2017 20:46
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.

Re: Logitech Media Server

Posted: Thursday 07 December 2017 19:47
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.

Re: Logitech Media Server

Posted: Thursday 21 December 2017 12:22
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 3520 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!

Re: Logitech Media Server

Posted: Friday 29 December 2017 13:02
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

Re: Logitech Media Server

Posted: Saturday 30 December 2017 23:50
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...

Re: Logitech Media Server

Posted: Sunday 31 December 2017 0:40
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.

Re: Logitech Media Server

Posted: Sunday 31 December 2017 17:09
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!

Re: Logitech Media Server

Posted: Monday 01 January 2018 0:08
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

Re: Logitech Media Server

Posted: Monday 01 January 2018 22:31
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};