App for night mode / smart actions

I use Mute Pro (Auto Silent Ringer)
pretty sure it's free, and does what you want, by calendar, by set times or location.
 
I used to have a Moto phone, but could never get Smart Actions to behave properly, so I just installed Llama, which I still use on my S5. While not the easiest app to use, once you have it set up, it's pretty flawless.