Changes

From Amahi Wiki
Jump to: navigation, search
{{MessageBox|backgroundcolor = #FBB|
image =Warning.png|
heading =WARNING|
message = This is no longer supported on Amahi 6 or greater.}}
 
[[Image:Amahi-Energy-Saver_Logo.png|150px]]<br>
This is in solid beta stage. Installation requires a little Linux knowledge.
If you like it, like it on facebook: <br>http://www.facebook.com/pages/Amahi-Energy-Saver/218015224890441?sk=wall 
==Introduction==
When the system is to be used again, simply wake it up with WOL (ref. http://en.wikipedia.org/wiki/Wake-on-LAN). There are many tools to generate WOL packets, and it is even possible to wake your server over the internet (good link: http://www.wakeonlan.me/).
==One Click installationInstallation==
The easiest way is to install Amahi Energy Saver via the Amahi ===One Click installation. Please see here: http://www.amahi.org/apps/amahi-energy-saver===
==Manual installation==Alternatively you can The easiest way is to install manually[http://www.amahi.org/apps/amahi-energy-saver Amahi Energy Saver] via the Amahi One Click installation.
===Manual installation - NOT SUPPORTED ANYMORE, BUT MAY STILL WORK===
Download the latest tested and released version here: http://code.google.com/p/amahienergysaver/downloads/list
 
Latest untested sources are available at Git:
https://github.com/jayrockk/Amahi-Energy-Saver
* Initial installation
1. Copy the tar.gz file from the download page to some folder and unpack it with
{{Code|Code= tar -zxf filename}}
2. Open a terminal, change to that folder and get superuser rights by running <code>su</code>
3. As root, run
{{Code|Code= cd installfiles}}{{Code|Code= ./aes-install.sh}}
4. When the installation is finished, reboot the computer. The config app is accessible at
{{Code|Code= <nowiki>http://hda:6500}} </nowiki>
==Integration with Amahi calendar==
==Integration with Amahi calendar=Step-by-step guide===
1. In the config app, select ical in the Calendar field.
*===Example: Set up Mozilla Sunbird for use with Amahi Energy Saver calendar===
The following description was created based on Sunbird 1.0b1 running on Windows 7.
Please note that MythTV installation itself is non-trivial. The above assumes that MythTV is correctly installed and working.
 
==Let other apps control Amahi Energy Saver (version 0.8.12 and later)==
Sometimes you may wish to prevent Amahi Energy Saver from suspending the HDA while some other action is ongoing. There are two simple interfaces to achieve that.
1. ===Script interface===
Amahi Energy Saver regularly checks the directory /usr/share/aes-lock for scripts and executes them. If any of the scripts returns an errorlevel of 1, the HDA will not be suspended. Both Bash (*.sh) and Ruby (*.rb) are supported.
The scripts can be extremely simple. In pseudocode a script looks like this:
{{Code|Code=<pre>
if (condition)
exit 1
exit 0
end
}}</pre>
2For a collection of scripts, please see this thread: http://forums. amahi.org/viewtopic.php?f=15&t=3320&p=16486#p16486 ===Lock files===
Amahi Energy Saver regularly checks the directory /usr/share/aes-lock for files with suffix '.lock'. As long as any such file exists, Amahi Energy Saver will not suspend the HDA. This is useful for other applications that support events. One Event may trigger the creation of the lock file, and another one may delete the lock file.
E.g., the event that shall cause the HDA to stay awake no matter what can call
{{Code|Code= touch /usr/share/aes-lock/some.lock}}
When the job is finished, the respective event should call
{{Code|Code= rm -f /usr/share/aes-lock/some.lock}}
Make sure to use individual names for the lock files, so that you don't accidentally delete the lock file of another application.
WakeOnLan is a freeware application provided by Readpixel which offers a very comfortable way to wake up your HDA directly from your Mac OS X desktop (ref. http://www.readpixel.com/wakeonlan/index.html).
 
==Sources==
Latest untested sources are available at Git:
https://github.com/jayrockk/Amahi-Energy-Saver
==OBSELETE: Command Line Interface==
*Note: Root privileges are required to execute the CLI command. Navigate to /usr/share/aes to use the CLI correctly.
{{Code|Code= ./aes.rb --shownetworkhosts}}
Lists the hosts found in the network, ie, all devices connected to the network. Gives the user the choice to add hosts to the monitored host list.
{{Code|Code= ./aes.rb --showmonitoredhosts}}
Show a list of all hosts which are monitored by AES (i.e. the monitored host list), and also allows to delete hosts from the list. If these hosts are up and running (and respond to ping), the server does not suspend.
{{Code|Code= ./aes.rb --addhost macadress}}
Manually add a host to the monitored host list. Observe the MAC address format, which has to be XX:XX:XX:XX:XX:XX. Example is <br> <code>./aes.rb --addhost 12:34:56:78:90:ab</code>
{{Code|Code= ./aes.rb --calendar [off, internal, ical, debug]}}
<code>./aes.rb --calendar</code> shows the current setting.
<code>./aes.rb --calendar off</code> turns the calendar off,
<code>./aes.rb --calendar ical</code> activates the Amahi calendar integration. To show diag information use <code>./aes.rb --calendar debug</code>
{{Code|Code= ./aes.rb --showcalendar}}
Lists the current entries of the internal calendar. Calendar entries define times when the server does not suspend. Also, the server will be woken up at the beginning of a calendar entry.
{{Code|Code= ./aes.rb --addcalendar startdate starttime stopdate stoptime}}
Use this command to add an entry to the internal calendar. Format of startdate/stopdate: YYYY-MM-DD Format of starttime/stoptime: hhm:mm. Eg.
<br><code>./aes.rb --addcalendar 2010-12-20 15:00 2010-12-20 16:00</code> <br>
will keep the server awake on Dec 20th, 2010 from 15 to 16 hrs (3 to 4 pm). The server will also wake up at 15 hrs if it is suspended.
{{Code|Code= ./aes.rb --shutdowntype}}
Show and modifiy the type of shutdown. NOTE: Not all shutdown types may be supported on your system, or may work correctly. Therefore, test that your machine is suspending and coming up correctly before deciding for a setting. Poweroff is safest type.
{{Code|Code= ./aes.rb --sbs [on, off, debug]}}
<code>./aes.rb --sbs</code> shows the current setting. <code>./aes.rb --sbs on</code> and <code>./aes.rb --sbs off</code> switch monitoring of Squeezeboxserver on or off, respectively. The command <code>./aes.rb --sbs debug</code> displays diagnostic information
{{Code|Code= ./aes.rb --interval}}
aes checks regularly if the system can be suspended or shut down. This parameter specifies the time in seconds between two such checks. Normally should be left untouched.
{{Code|Code= ./aes.rb --showenergybalance}}
View the energy savings in kWh due to the use of Amahi Energy Saver.
{{Code|Code= ./aes.rb --setpowerconsumption pc_on pc_standby}}
Set the average power consumption when working ("pc_on") and powered off ("pc_standby"). Values given in Watts. pc_on must be greater than pc_standby.
{{Code|Code= ./aes.rb --help}}
Displays command line help
 
 
[[Category:Apps]]
12,424

edits