Lamp run by Zooz 4 in 1 sensor

Hello all newbie here. I need some help with the code to have a lamp turn on between 6:00 am and 12:00 am when lux is <= 8 and turn off when lux is >8, then from 12:00 am - 6:00 am have the lamp off unless motion is detected then turn on with a 10 minute delay before turning back off once no more motion is detected, and finally turn the lamp off when away.
Thanks for any assistance.