I think i used this page I lately ran into this youtube video with a nice explanation on writing groovy code for hubitat. Hope it helps. Good luck