This QA is designed for room Motion detection.
Input the sensor and light device ID's in the variables section.
Adjust the ON times and OFF times which are offset times based on Sunset and Sunrise respectivley.
If the light is dimmable then you can enable that option and set the brightness.
The duration is set, thats how long after last detected motion the lights will switch off.
As with all my QA you can install this as many rooms as you need and just remember to update the variables with the ID.
See YouTube channel for install instructions HERE