Initializing values in device type

How does one initialize values in the device to some pre-set settings? There doesn’t seem to be a ‘constructor’ or anything, and the parse() method never seems to get called for non-zigbee/non-zwave devices.

I too am looking for a solution to this problem. I want to setup my device to operate before launching the device. I need to setup my input output variables.

Anyone… anyone? Bueler… bueler

Not following you, are you talking about setting hardware device parameters?
Not getting what you’re trying to do.

Thanks Mike-

I am setting up my raspberry pi. It has several input/output ports which you can set for input or output. I was trying to do it in the device type definition but there was no initialize method like there is in a SmartApp defnintion.

I ended up setting the default settings in the raspberry pi instead. It uses a REST API through webiopi which runs a python script when it loads the webiopi service so I set my port defaults there.

Ah, I see. Device types do have an initialize section.

def configure() {

Add this in if it’s not there, it’s called each time anything setup in the preferences panel is changed.

1 Like

Great, where did you find the documentation on that? So far I’ve found it to be quite sparse.

In an existing device type unforch…
Figured out how and when it worked with log.debug…

Gave you the wrong one
Configure is called when the device pairs.
updated is called on preference changes, sorry about that

Merci Beaucoup Monsieur