sensor devices and displayed states

Posted on
Thu Nov 14, 2013 12:02 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

sensor devices and displayed states

I have been toying with changing the ad2usb zone and panel device type from custom to sensor. Since alarm devices are essentially read-only (I can't think of a function to map to a user entered On or Off yet) the sensor type seems well suited for the task. In particular, the benefit of having the device display in Indigo-Touch is quite attractive.

However, I have run into a couple issue. When the device type is set to sensor, Indigo seems to ignore the device's UiDisplayStateId tag. Instead, it displays the onOffState in the DEVICES state column. Also, the uValue option in updateStateOnServer seems to be ignored for the onOffState.

The first issue (displaying onOffState) is probably not a real problem. In fact, that points to a possible solution for the icon display issue I have discussed elsewhere. If I stick with a custom device type, I can create a custom state, displayState, that is used as the UiDisplayStateId and can contain values selected to get the icon display I want. The user can still trigger off of the zoneState custom state to which I can assign meaningful values (clear, fault, trouble, alarm), while the displayState drives the icon/state column display.

Still, I think I would prefer to change to the sensor type if I could use uiValue. So, is uiValue ignored by design, or is that a bug?

Posted on
Thu Nov 14, 2013 12:50 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: sensor devices and displayed states

berkinet wrote:
When the device type is set to sensor, Indigo seems to ignore the device's UiDisplayStateId tag

That part is as-designed. Only custom device types can use UiDisplayStateId.

berkinet wrote:
Also, the uValue option in updateStateOnServer seems to be ignored for the onOffState

That might just be a bug. I know that for sensor types that have SupportsSensorValue set (so non-binary sensors, like an energy meter) uiValue can be used. So if there is a bug it would only be when SupportsSensorValue is False or not defined. We'll look into it.

Image

Posted on
Thu Nov 14, 2013 12:55 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: sensor devices and displayed states

matt (support) wrote:
berkinet wrote:
Also, the uiValue option in updateStateOnServer seems to be ignored for the onOffState

That might just be a bug. I know that for sensor types that have SupportsSensorValue set (so non-binary sensors, like an energy meter) uiValue can be used. So if there is a bug it would only be when SupportsSensorValue is False or not defined. We'll look into it.

UiDisplayStateId being ignored makes sense, thanks for confirming. Regarding SupportsSensorValue, it was undefined in my device.

Posted on
Thu Nov 14, 2013 1:30 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: sensor devices and displayed states

A follow-up question on onOffState in a sensor device. Is the state always interpreted as a boolean, regardless of what I set as the value in updateStateOnServer?

I am assuming it is. In which case… Is the icon heuristic applied before or after the boolean interpretation takes place?

Posted on
Fri Nov 15, 2013 12:05 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: sensor devices and displayed states

The next release (v6.0.6) will use (show in the UI) the uiValue argument for relay/dimmer/sensor devices.

berkinet wrote:
A follow-up question on onOffState in a sensor device. Is the state always interpreted as a boolean, regardless of what I set as the value in updateStateOnServer?


The icon selection heuristic is only used on custom device types. Senor/dimmer/relay/thermostat/etc. use a specific immutable icon selection technique. For the sensor that is: gray dot for false, green dot for true, red dot if an error has been set. The raw state value for a sensor is always "on" or "off". You can call the updateDeviceState API with any standard bool string (0, 1, true, false, yes, no, on, off) but those will always be translated into the "on" or "off" value equivalents in the actual raw value.

Image

Posted on
Fri Nov 15, 2013 2:44 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: sensor devices and displayed states

Thanks for the explanation. Now I can decide whether I want visibility (custom device with better icon control) or accessibility. (Sensor device with Indigo Touch presence).

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 28 guests