Controller design - Dynamic Tariffs Time-of-Use optimization

I would like to learn how to use the Time-of-Use tariff controller. Could someone please point me towards a tutorial on how to implement it or give me some instruction on how to implement/simulate it?

We are very near to needing this for our Battery system.
See here for a description of our system.

Thanks,
James