PDA

View Full Version : Power Control Plugin



Apesbrain
2015-10-28, 14:56
Looking for a plugin that would enable "Turn all Squeeze players off" from web GUI, any player, or smartphone. Does anybody know of one? Thanks.

d6jg
2015-10-28, 17:29
I'm looking for a Plugin that will switch my Touch (and amp) off and remove my headphones when I have fallen asleep listening in bed. Anyone?

epoch1970
2015-10-29, 05:48
I'm looking for a Plugin that will switch my Touch (and amp) off and remove my headphones when I have fallen asleep listening in bed. Anyone?

AFAIK nobody has ever harnessed the microphone within the Touch. Otherwise it would have been a simple matter of developing a snore detection app :)

Julf
2015-10-29, 08:18
AFAIK nobody has ever harnessed the microphone within the Touch.

The one that is reserved for NSA use? :)

Apesbrain
2015-10-29, 09:46
I'm laughing at this thread and not sure how to reply. I did find the CLI "power" command but it doesn't seem able to address a group of players.

If you want to disable that internal microphone, I'm pretty sure I was able to do it with soundcheck's "Toolbox". (WARNING: I'm kidding.)

Julf
2015-10-29, 09:55
If you want to disable that internal microphone, I'm pretty sure I was able to do it with soundcheck's "Toolbox". (WARNING: I'm kidding.)

Ah, yes, because the varying input signal from the microphone causes extra CPU load, jitter and entropy, all dramatically affecting sound quality. (WARNING: I'm kidding too!)

epoch1970
2015-10-29, 10:36
I did find the CLI "power" command but it doesn't seem able to address a group of players.
There is an LMS pref regarding power state synching in a group (Prefs>Player_name>Synchronize>"Synchronize power")
If set to yes, then powering on/off one player will power on/off all players in the sync group.

I never use power sync, I use the powersave plugin instead --ServerPowerControl can work to that effect too.
I just tested though -LMS 7.9, recent enough-, and power off in a sync group doesn't seem to work well with players that use IR Blaster (the "slave" SB3 did power off, but the amp did not.)

Personally I would loop among the players list and power off each one separately, and keep power states sync off in LMS prefs. Won't be any slower, and would probably be more robust.

Don't forget to make your script resistant to zombie players. If you use more than 1 LMS server, or mySB.com, players that have moved to another server tend to linger in the list of attached players for a few seconds/minutes. Sending a command to a zombie player will throw an error.

dettofatto
2015-10-29, 10:37
Looking for a plugin that would enable "Turn all Squeeze players off" from web GUI, any player, or smartphone. Does anybody know of one? Thanks.
If you have an android you can use Tasker with autosqueeze plugin. If you want also switch off your lights, tv, video, pc, music, you can use harmony hub and always tasker with harmony plugin...
If you have enabled "ok Google", you can say "switch off" and then everything will switch off..
It's not so difficult...

d6jg
2015-10-29, 11:18
If you have an android you can use Tasker with autosqueeze plugin. If you want also switch off your lights, tv, video, pc, music, you can use harmony hub and always tasker with harmony plugin...
If you have enabled "ok Google", you can say "switch off" and then everything will switch off..
It's not so difficult...

How will that remove my headphones? :)

Jeff07971
2015-10-29, 12:01
I'm looking for a Plugin that will switch my Touch (and amp) off and remove my headphones when I have fallen asleep listening in bed. Anyone?

You can use the powersave plugin, use either PowerSwitchIII or my method desribed elsewhere to power a SSR supplying the AC for your amp.
In parallel with the amp use the AC to power an electromagnet, this electromagnet holds a 1 Kilo steel block to the ceiling with pulleys.
Attach the cord from the block to your headphones.

When the system powers down the block wil be released pulling your headphones off and allowing a relaxing nights sleep !

With carefull positioning of the steel block this could also be used as an "instant sleep" system for those who have insomnia :)

d6jg
2015-10-29, 12:31
Where do I order?

DJanGo
2015-10-29, 13:24
I'm laughing at this thread and not sure how to reply. I did find the CLI "power" command but it doesn't seem able to address a group of players.

under tux that looks like:


##vars
port=9090
server=ip.from.lms.server

# get number of known players
players=$(printf "player count ?\nexit\n" | nc $server $port | cut -d ' ' -f 3)

## check all known players
for((i=0; i<$players; i++))
do
playerID=$(printf "player id $i ?\nexit\n" | nc $server $port | cut -d ' ' -f 4 | sed 's/%/%%/g')
printf "$playerID power 0 \nexit\n" | nc $server $port
done

Jeff07971
2015-10-29, 14:30
under tux that looks like:


##vars
port=9090
server=ip.from.lms.server

# get number of known players
players=$(printf "player count ?\nexit\n" | nc $server $port | cut -d ' ' -f 3)

## check all known players
for((i=0; i<$players; i++))
do
playerID=$(printf "player id $i ?\nexit\n" | nc $server $port | cut -d ' ' -f 4 | sed 's/%/%%/g')
printf "$playerID power 0 \nexit\n" | nc $server $port
done


Thanks for that, works under Centos7 / LMS 7.9.0 - Added to my script bank !

Apesbrain
2015-10-29, 17:13
Is it possible to run this script on Win version of LMS 7.9?

karlek
2015-10-29, 22:58
That I don't know but think that you have to adapt it.
In the meanwhile take a look at the KidsPlayer Plugin. With that you can configure a button to switch off all players for instance.

DJanGo
2015-10-30, 00:17
Is it possible to run this script on Win version of LMS 7.9?

Not This script cause it uses nc (thats a telnet tool) and all the other commands are made for *ux.

You have to use another telnet tool for windows (that allows scripting inside) like eg. http://support.moonpoint.com/downloads/windows/network/Telnet/tst10.php
and the script itself must be written for *blows.

So no you cant use this script, but you can use the mimik from that.

1. get the number of known players
2. get the mac adress of each player
3. power the player off

edit
to be clear: that script must run under *ux, but the telnetpart from it can handle all OS Versions of LMS.
/edit

dettofatto
2015-10-30, 01:15
How will that remove my headphones? :)
With tasker you can make a call... So... you must call a beatiful girl for a few euros, and she'll removes your headphones.... and also, if you pay more euros, you 'll have more jobs...
It's not so difficult...

d6jg
2015-10-30, 01:55
With tasker you can make a call... So... you must call a beatiful girl for a few euros, and she'll removes your headphones.... and also, if you pay more euros, you 'll have more jobs...
It's not so difficult...

😀

reinholdk
2015-10-30, 05:47
Is it possible to run this script on Win version of LMS 7.9?

Under Windows netcat can be used to send CLI commands to LMS. See how to use it in a batch file at the end of the example in this (http://forums.slimdevices.com/showthread.php?104146-Command-Line-Interface-basics-(Windows-box)&p=827802&viewfull=1#post827802) post.

Apesbrain
2015-10-30, 07:16
Under Windows netcat can be used to send CLI commands to LMS. See how to use it in a batch file at the end of the example in this (http://forums.slimdevices.com/showthread.php?104146-Command-Line-Interface-basics-(Windows-box)&p=827802&viewfull=1#post827802) post.
Thank you! Got that to work.