Just a few random searches.
htc one m8 add widget to lock screen lolipop
Pretty easy answer to this one. You can’t as Lollipop doesn’t support that, there is no lock screen widgets.
htc one m8 on body detection
Did recently a guide on it, read it HERE.
smart lock htc one m8
You have a complete coverage of that HERE.