Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Idea: Energy Saving Option
#1
I am currently looking for energy saving option on all my devices. On my 4 RasPi's I have installed a Shelly Plug with the RasPi power supplies. While a single power supply only uses around 5 VA, 4 RasPi's already summing up to nearly 20 VA. and this is wasted energy , when I am not using MoOde. Last couple of years I have ignored this energy waste, but nowadays I think I need to do more to save energy. So the Shelly Plugs could be used to startup the MoOde player ( System boot ) and I could also use the MoOde menu to shutdown the RasPi - where I modified the system to tell the Shelly Plug to turn off the power after 2 min. Now long story short: often I or family member forget to do the shutdown and a direct switch off through the shelly app might destroy the MoOde SD-Card. So I would need an automatic shutdown from within MoOde.

I am currently testing the use of the built-in "MoOde Sleep Timer", which could shutdown the App at an exact time - so like a last chance before the day finished.

To make a finer tuning I think it would be nice to have a special energy saving feature:

When MoOde doesn't play any track for a period of time (e.g.2h ) it could start a shutdown sequence. I think this could be a third Option in the clock radio: Wake up, sleep & energy timer. It would be simliar like the two first, but enabled it will start a sort of watch dog timer after each track. When the watch dog timer will not restarted with a new track play, it will initiate the shutdown sequence as energy saving.

What do you think ? Does this sound feasible ?
Reply
#2
(03-14-2025, 02:05 PM)UpsiUps Wrote: I am currently looking for energy saving option on all my devices. On my 4 RasPi's I have installed a Shelly Plug with the RasPi power supplies. While a single power supply only uses around 5 VA, 4 RasPi's already summing up to nearly 20 VA. and this is wasted energy , when I am not using MoOde. Last couple of years I have ignored this energy waste, but nowadays I think I need to do more to save energy. So the Shelly Plugs could be used to startup the MoOde player ( System boot ) and I could also use the MoOde menu to shutdown the RasPi - where I modified the system to tell the Shelly Plug to turn off the power after 2 min. Now long story short: often I or family member forget to do the shutdown and a direct switch off through the shelly app might destroy the MoOde SD-Card. So I would need an automatic shutdown from within MoOde.

I am currently testing the use of the built-in "MoOde Sleep Timer", which could shutdown the App at an exact time - so like a last chance before the day finished.

To make a finer tuning I think it would be nice to have a special energy saving feature:

When MoOde doesn't play any track for a period of time (e.g.2h ) it could start a shutdown sequence. I think this could be a third Option in the clock radio: Wake up, sleep & energy timer. It would be simliar like the two first, but enabled it will start a sort of watch dog timer after each track. When the watch dog timer will not restarted with a new track play, it will initiate the shutdown sequence as energy saving.

What do you think ? Does this sound feasible ?

Some thoughts:
  • Killing moOde without shutting it down does no harm.  I have a player that's had the power killed twice a day every day for over four years, never once has the SD corrupted.  Now that moOde logs to RAM the risk is even lower.
  • Just a shut down without some external hardware to cut the power wouldn't save much.
  • Having moOde know what to say to hardware would be troublesome, so many different devices all wanting different signals.
  • A command to tell moOde to shutdown that devices could send, more realistic perhaps.
----------------
Robert
Reply
#3
The main challenge with a feature is this is that it seems to be niche and so while it might be doable it's not going to get priority, at least on my TODO list. Another dev though might take an interest and contribute a PR :-)
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#4
(03-14-2025, 04:09 PM)the_bertrum Wrote:
(03-14-2025, 02:05 PM)UpsiUps Wrote: I am currently looking for energy saving option on all my devices. On my 4 RasPi's I have installed a Shelly Plug with the RasPi power supplies. While a single power supply only uses around 5 VA, 4 RasPi's already summing up to nearly 20 VA. and this is wasted energy , when I am not using MoOde. Last couple of years I have ignored this energy waste, but nowadays I think I need to do more to save energy. So the Shelly Plugs could be used to startup the MoOde player ( System boot ) and I could also use the MoOde menu to shutdown the RasPi - where I modified the system to tell the Shelly Plug to turn off the power after 2 min. Now long story short: often I or family member forget to do the shutdown and a direct switch off through the shelly app might destroy the MoOde SD-Card. So I would need an automatic shutdown from within MoOde.

I am currently testing the use of the built-in "MoOde Sleep Timer", which could shutdown the App at an exact time - so like a last chance before the day finished.

To make a finer tuning I think it would be nice to have a special energy saving feature:

When MoOde doesn't play any track for a period of time (e.g.2h ) it could start a shutdown sequence. I think this could be a third Option in the clock radio: Wake up, sleep & energy timer. It would be simliar like the two first, but enabled it will start a sort of watch dog timer after each track. When the watch dog timer will not restarted with a new track play, it will initiate the shutdown sequence as energy saving.

What do you think ? Does this sound feasible ?

Some thoughts:
  • Killing moOde without shutting it down does no harm.  I have a player that's had the power killed twice a day every day for over four years, never once has the SD corrupted.  Now that moOde logs to RAM the risk is even lower.
  • Just a shut down without some external hardware to cut the power wouldn't save much.
  • Having moOde know what to say to hardware would be troublesome, so many different devices all wanting different signals.
  • A command to tell moOde to shutdown that devices could send, more realistic perhaps.

Thanks for your thoughts.

I had a defect SD-Card due to hard power off multiple times. So it might be today more rare, but it could still happen and is from my point of view not a good practice as long as you use SD-Cards. Yes, you would need that is informed during the shutdown to power off. I already have that solution in place. BTW: it is easy to implement the signal with systemd to send a signal to an URI. I am not expecting that MoOde is doing this interface. This hook and the custom uri is an individual solution.

I was expecting, that MoOde implent a watch dog timer to shutdown the system after the timeout is reached. So as an addition to the "clock radio" function with "wake up" and "sleep timer" which are executed at a special time. I would expect that a third function just observe if a track is still played and if not for a period, it will start the shutdown.

I think it is not such a difficult task to implement this. Maybe I will scroll through the source to find a possible hook place ..
Reply
#5
(03-14-2025, 04:37 PM)Tim Curtis Wrote: The main challenge with a feature is this is that it seems to be niche and so while it might be doable it's not going to get priority, at least on my TODO list. Another dev though might take an interest and contribute a PR :-)

LOL - I understand. I will have a look to my old implementation to visible the current track on an external display. This might be the place to get the information whether a track has been played "long time ago" to initiate a shutdown.

I will also look at the clock radio code of MoOde to understand how an UI might be implemented as a third option. 

But now as winter is gone, this is also not on my priority list. I may live with the sleep timer of the clock radio that will ensure to shutdown the device every evening if it is still on.

Thanks for your open feedback and the review of this niche idea Big Grin
Reply
#6
Ok, first result - the "sleep timer" from the clock radio is doing a shutdown which also then signals to the device to power off the power supply. So the small solution already works.

Maybe I do a bit scripting with the
Code:
cat /var/local/currentsong.txt  | grep state
result to start the shutdown
Reply
#7
A more universal test would be to check the ALSA output since it covers both MPD and any of the renderers.

Code:
pi@moode:~ $ moodeutl --hwparams | grep closed
closed
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: