Hi all, and thanks in advance for your help with this!
I have a rpi 3 with piCorePlayer and 7" touchscreen with Jivelite. it accesses music files on my Synology NAS and sends it out to a Logitech Transporter, serving as a preamp, and on to my amp. I've rigged a TP-Link wifi Smartplug to the power plugs for the Transporter and amp, and at the moment I can say "Alexa, turn on the stereo" to turn them on/off. But I always feel silly saying this, and I'd like to streamline the process.
Ideally: is there a IFTTT option, so when the Jivelite/piCorePlayer is active it turns on the smartplug?
Next best: can I add a menu option on the Jivelite menu that will active the smartplug?
I hope this makes sense. Help?
Andrew
ps. I should add, I can handle the GUI for the pcp, but for any Unix coding you'll have to hold my hand.
Results 1 to 10 of 32
-
2018-10-24, 05:05 #1
- Join Date
- Oct 2018
- Posts
- 11
Turning on stereo from piCorePlayer
Last edited by andrewhess; 2018-10-24 at 05:07.
-
2018-10-24, 05:17 #2
- Join Date
- Sep 2005
- Posts
- 2,854
Hi,
i have no clue about picoreplayer, but Jivelite is just a gui frontend - you may have some squeezelite session to run the audiostream.
squeezelite supports the -S Parameter that runs a script when you power on/off that player.
Now you only need a scripted way to do the same like telling alexa audio on/off.
Search for squeezelite -S
-
2018-10-24, 05:33 #3
- Join Date
- Jan 2011
- Location
- Staffordshire. UK
- Posts
- 4,239
Squeezelite can start playback when the pi is powered on.
You can select what you want to hear on the Squeezelite Tab in pCP.
You just then need to control the power supplied to the pi.
I used this feature with a rpi into pre-amp connecting to Active speakers, all plugged into the same power strip.
ronnie
-
2018-10-24, 05:49 #4
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 20,325
Some TP-Link smart plugs have been "hacked" so that you can control them with a local python program.
See https://github.com/softScheck/tplink-smartplug
-
2018-10-24, 14:40 #5
- Join Date
- Oct 2018
- Posts
- 11
-
2018-10-24, 15:47 #6
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 20,325
If you're playing audio on the rpi - then Squeezelite is there in the background. The script could then be run from squeezelite.
For player that are not on the rpi - you'd need the script to communicate with LMS through CLI. However I recall there used to be a plugin called somehting like svrPowerControl which might be able to run the script - however I don't know if it is currently supported/documented.
edit:
Old long thread for plugin but last post is in 2018.
https://forums.slimdevices.com/showt...vrPowerControlLast edited by bpa; 2018-10-24 at 16:02.
-
2018-10-24, 19:20 #7
Squeezelite can run a script directly, based on the Power Status of the player.
Look at the -S option.......or -G if you want to use direct control of the rpi gpio.piCorePlayer a small player for the Raspberry Pi in RAM.
Homepage: https://www.picoreplayer.org
Please donate if you like the piCorePlayer
-
2018-10-25, 04:51 #8
- Join Date
- Oct 2018
- Posts
- 11
Sorry, too many acronyms on this forum (does everyone really understand all this? I feel old and dim.). What CLI? The svrPowerContol looks potentially perfect--I'll start researching it. One possible issue is that I want it to control the power supply to my stereo via the TP-Link smart plug (the Transporter has tubes that don't turn off when you turn off the Transporter--it's a mod). Can this plugin do that?
Thanks,
A
edit: Wait...CLI....command line interface!Last edited by andrewhess; 2018-10-25 at 05:03.
-
2018-10-25, 05:37 #9
- Join Date
- Apr 2005
- Location
- UK/London
- Posts
- 3,976
If things have not changed with the top-link Smart plug then ... you could use the Python script from https://www.softscheck.com/en/revers...tp-link-hs110/ and use set_relay_state to make it turn the device off/on.
First thing would be to get it working from a script ... and if it does ... then get that script called from whichever mechanism you end up using to determine that a switch on/off is needed.Paul Webster
http://dabdig.blogspot.com
Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland
-
2018-10-25, 07:14 #10
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 20,325
CLI = command line interface. LMS has an interface which text based command can begiven to control LMS / player and get status. If you have done any programming it is a bit cryptic as IIRC it is aimed at programs not humans.
In LMS world - when players are turned off - they are not off - just the display is blank - SB players are only really off when power is removed. When you turn on a player by applying power (e.g. via smart socket) - you will need to allow time for player to power up, get on network and then for LMS to recognise player is on network.
This looks to be the same script only I referenced github.
The advice is right - don't waste time on LMS plugins etc until you have checked from a shell prompt that the script runs on rpi and that it can control the smart plug.