Can WebCoRE Edit Device Preferences?

I’m talking about the custom device ‘Preferences’ which some devices get from their device handler. Can webcore access those somehow?
For example, my Inovelli dimmer has a ‘default level’ parameter which sets the dimmer % whenever you turn the switch on. Could I edit that setting from WebCoRE so that at night if I turn on the lights they’re not as bright?

If the DTH is set up for that, then absolutely.

How do I find out? I’m very new to WebCoRE, is there maybe some custom commands or variables to access those things? Because I’m not seeing anything standing out in any of the main lists of actions for the device.

If you look at your device in the ST IDE, and your desired device parameter is listed, then you should be able to select that parameter within webcore.

Yeah I can see the settings I want to edit in the ST IDE, there’s all these and some more parameters.
So you’re saying I can somehow directly edit these values from within WebCoRE? Could you summarize the way I go about accessing and editing them, or maybe point me to a guide?

I just noticed that you are asking about “preferences.” Not sure if you can manipulate “preferences” within webcore.

Preferences of this type are usually parameter values stored in the firmware of the device itself during a configuration command.

Most devices, for security reasons, require that you physically manipulate the device in someway in order to cause it to accept a configuration change. Usually a tap pattern.

That cannot normally be done just by network commands. I don’t know if there’s something different about those models.

@Eric_Inovelli

I mean I can edit them from the ST IDE and from either app. I guess the custom DH sends the configuration command each time I hit ‘Save’ after making changes. I see a ‘device Configure’ action available in WebCoRE, but there’s no further parameters to provide for it.

I’ll tag @erocm1231 here – above my pay grade lol!

1 Like

‘Configure’ is a device capability that announces that the handler has a configure() command. Said command gets run automatically when the device is installed or when it is updated in the IDE (if there are changes). It is really intended for sending configuration commands to the hardware rather than configuring the device handler.

When you change the settings/preferences (I wish they’d chosen one term and stuck with it) in the app or IDE it is the updated() command that gets called in the device handler. The new app calls it whenever you change something rather than wait until you’ve finished, which I find really irritating.

As far as I am aware, access to these settings isn’t exposed to custom apps like webCoRE, although there is nothing to stop the device handler using custom commands or attributes to do so itself.

I believe there is no reason why the setLevel() command should actually send a hardware command that results in the light coming on. It could just as easily set a variable and only send a hardware command if the light is already on or when it is switched on.

So you’re saying I could theoretically edit the DH to expose these preferences to WebCoRE with some custom functions?
The preference I’m looking to access doesn’t make the lights come on, but it does affect the hardware since the switch needs to know what % it should be when it’s turned on physically.

Ignoring custom capabilities for the moment, as those are still in preview, there is nothing to stop you defining your own attributes and commands. Apps need to have been written to work with them and webCoRE is one that can.

So you can set the attribute to the current value of the setting so webCoRE can see it, and define a command function that webCoRE can call to set it. You can update the device handler settings in code if you wish but I don’t know if that also triggers the call to updated().

Just FYI, the device handler has an option (toward the bottom) that lets you create a child device called “Default Level”. This child device can be used in any automation (including webcore) that supports the “level” capability. Adjusting the level of this child device changes the parameter you are referring to.

3 Likes

Oh wow thank you that should work perfectly! You guys are the best.

3 Likes