elsmandino
Posts: 35
Joined: Mon Dec 17, 2012 8:38 pm

Using the Pi to cut power to TV and amp when not used.

Thu Jan 26, 2017 1:45 pm

I have been struggling with this problem for ages and would be really grateful for any pointers.

At the moment, I have a Raspberry Pi2 (running LibreElec) connected to an a/v amp and then into my TV.

Ideally, I would like to have it whereby whenever the Pi goes into screen saver mode (which is about 3 minutes of non-use), it cuts the power to both the TV and the amp.

Is there any hardware/software way I can accomplish this?

Something like this would not work with the Pi, because its wattage is too low to begin with:

https://www.amazon.co.uk/d/Uninterrupte ... B003WK62WU

Any help would be appreciated.

epoch1970
Posts: 4444
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Using the Pi to cut power to TV and amp when not used.

Thu Jan 26, 2017 4:00 pm

Energenie (Gembird) sells power strips that are controllable via USB or LAN. Not overly efficient (price, power consumption) I think, but it works.
AFAIK even the basic USB version can store short programs via a script tool like sispmctl, so you could even get your Pi to reboot with something like : socket 1 on for 2 minutes (giving enough time to shutdown) / off for X seconds (Pi complete power off) / socket 1 on (causing the Pi to boot again)
More interesting perhaps, that brand has started developing products that are compatible with a Pi.
There may be better and/or cheaper solutions. But I've used sispmctl in the past and it does work.

BTW, don't cut power immediately after screen blanking. Wait for some delay and then power off. Even like this, you'll meet cases where your activity makes the devices bounce from power off, which is none too good.

I have wished for a long time someone would come up with a power manager based on bayesian filtering to predict the times at which it is most likely a system should be running (or stopped)... I think it makes sense, esp. with machines that have so many sensors like a Pi. But I suck at maths, so I could never resolve to try and see for myself.

EDIT: sispmctl, not "syspm". -- http://sispmctl.sourceforge.net Probably obsoleted by newer CLI tools you can find on GitHub.
Last edited by epoch1970 on Thu Jan 26, 2017 7:04 pm, edited 1 time in total.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

elsmandino
Posts: 35
Joined: Mon Dec 17, 2012 8:38 pm

Re: Using the Pi to cut power to TV and amp when not used.

Thu Jan 26, 2017 5:09 pm

Thank you.

https://energenie4u.co.uk/catalogue/product/ENER002-2PI

This definitely looks like a workable solution.

If I plug my amp and TV into the socket, it should be possible to have turn the socket off after, say, a minute of the screen dimming and then to turn it back on whenever an input is received by the Pi. How difficult would the coding for this be - considering I am running LibreElec on the Pi, rather than a full blown operating system like Raspbian?

One solution that I did look into was cutting the HDMI input to my TV (which could be plugged into the smart power strip mentioned above), which I hoped would then go into standby eventually but, irritatingly, my TV just says "no signal" and won't go into standby.

I also wondered whether there were any smart power strips that somehow worked on HDMI signals but nothing like that exists.

I note that you have had success with "syspm" in the past. What exactly is that?
Last edited by elsmandino on Thu Jan 26, 2017 5:10 pm, edited 1 time in total.

User avatar
CarlRJ
Posts: 599
Joined: Thu Feb 20, 2014 4:00 am
Location: San Diego, California

Re: Using the Pi to cut power to TV and amp when not used.

Thu Jan 26, 2017 5:10 pm

Would something like this help?

Controllable Four Outlet Power Relay Module

Plug your TV/etc. into it, wire it up to GPIO pins on the Pi, and write any script you like on the Pi to turn the outlet on and off.

Edit: ah, I see you need those "funny" sockets. Sorry, right idea, wrong flavor.

User avatar
Douglas6
Posts: 4826
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Using the Pi to cut power to TV and amp when not used.

Thu Jan 26, 2017 5:40 pm

Cutting power to a TV/amp is pretty drastic, and would prevent you from, say, turning it back on with the remote. If it's newer equipment, it may talk CEC, and you could program the Pi to tell it (them) to turn themselves off.

-=mindhunter=-
Posts: 2
Joined: Thu Jan 26, 2017 6:00 pm

Re: Using the Pi to cut power to TV and amp when not used.

Thu Jan 26, 2017 6:08 pm

i found your answer: Raspberry Pi 2, 3 Remote control on/off power switch
https://youtu.be/JqsvbBb8YL0

epoch1970
Posts: 4444
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Using the Pi to cut power to TV and amp when not used.

Thu Jan 26, 2017 7:09 pm

elsmandino wrote:I note that you have had success with "syspm" in the past. What exactly is that?
It's a mistake. I corrected my post above.
sispmctl is a nice C utility you can compile and use to control the power strip over USB. It's what I've used.
More recently it looks like other utilities have appeared. I think I also remember of a web control interface, but I never had use for that.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “General discussion”