Base code and adding configuration

Very new here, but not to coding. Two basic questions:

  1. Is there some place you get base code for a device or did someone simply create these from scratch? For example, there are a number of modified door sensor device handlers that all look very similar. I was wondering if that meant they were from some common source that people were pulling from (ie, one of the device handlers listed in the developer interface).

  2. If a device has a number of configurations available and they aren’t exposed via the device handler available for it, how do you add configurations to a device handler? Note: I’m leaving this question in even though I see it in the developer documentation, just in case it is not as simple as it may sound.

Have a look at the samsung motion sensor device, it has a preference option to change the temp offset, that should get you started on the how to change a device config via the dth.

Is that this one?

Incidentally, I obviously figured out where all the “base” code is too. :slight_smile:

Additional question…is it possible to change the status/messages based on a configuration? For example, if a device can be multiple things can the status it reports (open/closed, clear/alarm, etc) change based on it’s configuration parameter?

don’t see why not, you’ll have to override the built in sendEvent for each device message that’s parsed based on your preference settings.