Auto off light after dynamic values on each lamp

So I had in my old home automation system a routine that was running every 5 seconds, that scanned thru all lamps (z-wave switches and dimmers) and either a) turned them off after preset time after them beeing turned on or b) dimmed them to calculated value based on outside luminance (what I called sliding scene). For this to be possible I would need extra fields of informationon on each z-wave device, which contained all parameters like for how long a lamp light would be turned on after say motion detection, or how much a light needs to be dimmed in reference to outside luminence…

So how do I add more fields to a z-wave entity?

Or does something like I just briefly described already exist? I would prefer to no reinvent the wheel…