Sample dimmer code for Cree bulb?

New to groovy; looking for a snippet that shows how to set the brightness level on a cree bulb. Attempting to write an app that will trigger by motion detected; then set a level with no motion detected.
tks

Thanks for the example and I’ll check into CoRE. I am using SmartLighting to turn on/off, but I want the dimming functions to occur between these events. Motion detected brighten to level and no motion dim to level. SmartLighting has on/off/on+level, but no seperate level. Perhaps I can re-use the on+level but I decide to try an app.

The groovy code is cut off, and when clicked on, the site or that specific code has been taken down. Please re-post in it’s entirety or send via a private message.

Thanks so much!

@anon36505037 what is DMCA takedown?