Save setting without input()?

Hi,
I’m working on some changes to an existing DTH for an Inovelli dimmer. The dimmer has an LED indicator that can be configured through the device configuration page, and offers 8 standard colors. The default is blue.
For my installation, I wanted to set the LED color dynamically through webCoRE, so I created a new method to do that which works.
My issue is that once I set the LED color in my new method to say red, the device configuration page still shows blue. I’ve done some research and know that the settings are normally set through the input() function. Is there a way through my new method where I can update the device configuration so that it will show red after I’ve updated it through the code?
Thank you!

Try -

# update (smartapp)
app.updateSetting(name, value)
settings[name] = value

# delete (smartapp)
app.deleteSetting(name)

# update (device)
device.updateSetting(name, value)
settings[name] = value

# delete (device)
device.deleteSetting(name)
1 Like

Hello,
I wasn’t able to return to this right away, but when I’m trying it, I get this error while using the device.updateSetting method:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: physicalgraph.device.Device.preferences, no session or session was closed

With the settings[name] = value syntax, I don’t get an error but the values aren’t updating.

This is within a new method that I’m trying to create and then call from webCoRE, not an event if that matters.

Does it work when you call it within the app or device (not from webcore)?

I tried directly from the device and received the same error. Can’t even seem to find any info about this error in the ST documentation.