Basic thumb rule, be there for these kind of activities.
in order to achieve that, you need to determine which server you will use as a launching pad for those commands? (I had used NIM a couple of years ago, but for an entirely different purpose).
Once you sort out which server you will use (say NIM server using your own userID), now you have to do exchange the ssh keys between NIM server and HMC (anyone HMC is fine).
Say for example on NIM you want to use your userID to connect to hscroot at HMC, you need to generate a ssh-key pair for your user ID on NIM. (It's a little tricky to set up SSH keys on HMC, search it you will find a procedure from IBM).
Test the connection from you NIM server.
I am not writing the entire script, but giving you the exact commands to stop and start the LPAR.
to stop a LPAR run,
ssh <username>@hmcX "chsysstate -r lpar -m <Manage System Name> -n <LPAR Name> -o shutdown"
Where, username is user on HMC (could be hscroot, you etc..,). Remember to enclose the actual command in quotation ("), same with start command.
If you don't do a ssh-key exchange it will ask for user password on HMC (it is not always required that you have hscroot access, some shops go by individual names and don't disclose hscroot password). This will nullify your automation.
Say you have 2 or 3 systems, I recommend you add 'sleep' of atleast for 3-4 minutes between each shutdown.
To start the LPAR run this
ssh <username>@hmcX "chsysstate -r lpar -m <Manage System Name> -n <LPAR Name> -f <LPAR_profile> -o on"
Here we add the LPAR_profile, because you need to know which profile it has to boot from (generally it will be LPARname_default) but make sure you use the correct profile.
You can write a simple script or a complex script to achieve the above and tune it to death, upto you.
Note: I don't recommend you using the automation process, imagine while adding a cronjob you miss'up with month to week or day or worst minute and it goes down every three minutes.
Also, the worst case scenario, because of some weird reason, the system isn't going down smoothly.
Many factors to ponder upon, and if you use it, use at your sole discretion.