Is it possible to edit remotely the "settings" attributes?

(J-F) #1

Hi there,

I’m wondering if it is possible to modify the settings attributes that are defined in the Preferences section (remotely).

Right now, I have the following working:
I configure a setting in the preference section of my device handler and have it sent to my physical device.

Now, I want to do the opposite:
I want to configure the setting on the physical device and have it updated in the preferences section in my device handler

Does anyone know a way of doing this?

( co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #2

Generally, no. There are architectural and security reasons / limitations.

But explain what you need with a little more detail and perhaps a concrete example, and we might come up with a known or possible workaround.

(J-F) #3

Is it possible to change the settings in the preferences section without a user action?

See the following use case:

  1.   The device handler has a keypad lock/unlock setting in the preference section in the device handler.
  2.   The user sets the setting to “Unlock” from the device handler.
  3.   A message is then send to the device to have the keypad unlocked
  4.   The user set the setting to Lock from the device.
  5.   The device sends a message to the device handler to change the settings to Unlock
  6.   I would expect the setting to change in the preferences section, but that does not seem to be the case so far.

Is there a way to achieve what I want?

( co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #4

locked” and “unlocked” are state values of the Attribute for Lock (with Commands lock() and unlock().

These are not “preferences” … they are states.

Thus, you definitely can do this in a Device Type Handler using any type of Sub-Tile that can display and/or control a state …such as standardTile().

Make sense??

(J-F) #5

“locked” and “unlocked” are state values of the Attribute for Lock (with Commands lock() and unlock().

These are not “preferences” … they are states.

In this particular device handler, I created a lock preference for the thermostat keypad lock feature.
I do not want to create a tile for it, since it is considered an “advanced feature”.
I do understand that I could create a tile for it, but I would prefer not.

I will use another example:
The thermostat can display the temperature on its LCD in Celsius or Fahrenheit.
This setting can modified locally on the thermostat and also in the preference section in my device handler.
If I change it from °C to °F from the device handler, the thermostat changes its display format.
If I change the setting locally on the thermostat, I would like the device handler to update the preference section to the new display format.
Once again, I know that I could set another tile to control the unit format, but since it is unlikely that this setting will be ever changed again, I would prefer to have it located in the preference section.

My question is simple: Is there any way to have settings defined in the preferences section modified by a message received from the device?

(Scott G) #6

Unfortunately the answer is no. The preferences section is part of the metadata of the device handler. The only way to “modify” or interact with the metadata section is via Events and to my knowledge Events can only affect tile behavior.

It really sounds like both of these advanced features would be better served as extra tiles at the bottom of the device handler. Maybe even cordon them off with a blank row of tiles or one long tile with “Advanced Features Below” label.

At least until we get more dynamic device handler options.

(J-F) #7

Thanks @Sticks18, I will see what I can do from here.

( co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #8

The Docs for “SmartApp Dynamic (Preferences) Pages” imply that the values can be updated by “external inputs such as a web services call”.

Unfortunately, I am unaware of Dynamic Pages for Device Type Handlers.

(J-F) #9

You are right.
I found the following in the Device Handler > Preferences section:

Device preferences are limited to input elements, and do not support multiple pages or sections.