Page 1 of 2

Interface graphic symbols (Dead horse beating)

PostPosted: Fri Nov 08, 2013 1:00 pm
by berkinet
Sorry to re-visit this topic, but after spending some frustrating time trying to implement a graphic signal (state column icon) for an alarm zone, I have run into the following problem.

Using the status icon status state scheme released in API v1.11, I cannot display text and a graphic. This, as Jay pints out, is contrary to GUI usability guidelines. If Indigo sees one of the keywords or values as the state value (lookup table defined in the API release notes) it replaces the keyword with the icon. I tried using uiValue in updateStateOnServer to add the text, but that value also overrides the state value used to determine which, if any icon to display.
For example: If I set state to 'faulted' I get only a red dot displayed. If I then add uiValue=u'Fault' I get 'Fault' displayed as the state, and no red dot - I would like both: Fault.

And, there is still the issue of how to graphically (color) identify alarm zone states. I would like to have a faulted zone show a red dot (red = something not Ok - I.e. the alarm cannot be set because this zone is faulted. Or, the alarm went off because this zone was faulted). Conversely, I would like to use green to indicate a zone that is clear, or ready to arm (green = go). But, the only values I can use to display a green dot are "active", "enabled", "open", "connected" and "available." None of which convey the semantic I want. (Open is the closest, but, in fact, from a electric sense, the circuit is actually closed.)

Ok, so why bring this up again… I know you want to re-work/expand this whole area and was hoping, just maybe, the priority might get bumped up if enough wheels squeaked.

Thanks.

Re: Interface graphic symbols (Dead horse beating)

PostPosted: Fri Nov 08, 2013 4:40 pm
by jay (support)
It should be showing both - I just checked and it's showing both for iTunes devices, timers, and Vera Bridge devices. Are you setting uiValue to "" rather than None (or just leaving it out)? That would cause the problem.

Re: Interface graphic symbols (Dead horse beating)

PostPosted: Fri Nov 08, 2013 5:02 pm
by berkinet
I was using…
    indigoDevice.updateStateOnServer(key='zoneState', value='faulted', uiValue=u'Fault')
which I would expect to show |Fault |
But, it just displayed 'Fault'.

I'll try again.

I also had a very odd problem. The ui-state display became frozen on the device I was testing with. That is, it got stuck on 'Fault.' I made sure the code wasn't erring, thus missing the clear, but it executed lines before and after the update. I finally deleted the device and created it again and all was well. If it happens again I'll copy the device from the db for you.

Re: Interface graphic symbols (Dead horse beating)

PostPosted: Fri Nov 08, 2013 5:25 pm
by berkinet
Ok. Definitely something odd happening here. Here is the code to 'fault' the device
    indigoDevice.updateStateOnServer(key='zoneState', value='Fault', uiValue=u'faulted')
And, here is the Indigo display
ss.png
ss.png (36.84 KiB) Viewed 7884 times


Now, if I change the code to:
    indigoDevice.updateStateOnServer(key='zoneState', value='faulted', uiValue=u'Fault')
I see this
ss2.png
ss2.png (31.24 KiB) Viewed 7884 times


In summary, in both cases, the uiValue was used to select the icon and as the displayed value.
In the first case, I get the icon, because faulted is a valid value in the icon lookup table. In the second case, I do not get the icon because Fault is not a valid icon lookup value.

BTW. I resolved the 'stuck' state display issue. Seems if you use uiValue to set a state, you also have to use it to unset/change that state. Seems like a bug to me?

Re: Interface graphic symbols (Dead horse beating)

PostPosted: Mon Nov 11, 2013 12:46 pm
by jay (support)
"fault" != "faulted" - as specified in the release notes it's looking for "faulted", not "fault".

And, yes, the stuck state display issue is a bug that Matt had already fixed which will be in 6.0.5.

We've also agreed to change the heuristics to look at the raw state value, not the UI value passed in. This change will also be in 6.0.5.

Re: Interface graphic symbols (Dead horse beating)

PostPosted: Mon Nov 11, 2013 12:58 pm
by berkinet
jay (support) wrote:
"fault" != "faulted" - as specified in the release notes it's looking for "faulted", not "fault".

That was clear. The question is: which value is being used for the icon lookup? value or uiValue? It appears uiValue is being used. If that is the case, then I am back to the original question… How to I add text to the icon?

Re: Interface graphic symbols (Dead horse beating)

PostPosted: Mon Nov 11, 2013 1:11 pm
by matt (support)
berkinet wrote:
jay (support) wrote:
"fault" != "faulted" - as specified in the release notes it's looking for "faulted", not "fault".

That was clear. The question is: which value is being used for the icon lookup? value or uiValue? It appears uiValue is being used. If that is the case, then I am back to the original question… How to I add text to the icon?

As Jay said above, in 6.0.4 (current release) it performs the heuristic on the UI value, but in 6.0.5 it will perform it on the raw value instead. So you'll be able to use the raw value to select the icon you want, then use the UI value to show whatever state text you want.

Re: Interface graphic symbols (Dead horse beating)

PostPosted: Mon Nov 11, 2013 1:24 pm
by berkinet
matt (support) wrote:
...As Jay said above, in 6.0.4 (current release) it performs the heuristic on the UI value, but in 6.0.5 it will perform it on the raw value instead. So you'll be able to use the raw value to select the icon you want, then use the UI value to show whatever state text you want.

Thanks for making that clear. The actual impact was not clear to me after reading Jay's post.

Re: Interface graphic symbols (Dead horse beating)

PostPosted: Wed Nov 13, 2013 7:10 pm
by berkinet
after a lot of hard work, Support wrote:
6.0.5 is now available for download.


Developer API Changes:
Status column image is now selected based on the raw state value, not any passed in UI value.

Thank you, thank you. Works as expected…

Now, after 10 minutes of elation, can I get back to the old horse I've been beating.

For an alarm zone or panel, I am now using the state name faulted and the uiValue Fault and am getting just what I wanted: Fault

But, I have no good option for the Clear state. I would prefer a green dot, but gray would be Ok. However, to use either of those colors I must choose between a limited list of state, none of which, IMO, are appropriate:
    ["inactive", "disabled", "closed", "disconnected", "unavailable"] or if the state value is a boolean and false show a gray dot
    ["active", "enabled", "open", "connected", "available"] or if the state value is a boolean and true show a green dot
I know I can hide the value in the state column with uiValue. However, the canonical value remains one of the ones noted above and that is still displayed in the states window and is used for triggers, and control pages.

I know there are different opinions as to what alarm device states mean, but please, can we come up with some term to allow a device to show a meaningful icon in, what I call, the clear (I.e. not: faulted, alarmed or trouble) state.

Re: Interface graphic symbols (Dead horse beating)

PostPosted: Thu Nov 14, 2013 7:07 am
by matt (support)
At this time we do not want to extend the terms used in the icon choice heuristics. We do plan on providing a more flexible mechanism in the future.

Re: Interface graphic symbols (Dead horse beating)

PostPosted: Thu Nov 14, 2013 3:40 pm
by berkinet
So, until a more flexible mechanism is available, I have come up with a work-around that gives me what I was looking for.

I created a new custom state, displayState for my device. I then set displayState as the UiDisplayStateId. Now, all I have to do is updateStateOnServer for displayState with a value* needed to select the appropriate icon as the value and the label I wish displayed along with the icon as the uiValue.

The only, minor, issue is that the new state shows in the Custom States table. Here is what the DEVICES table looks like…
ss.png
ss.png (38.62 KiB) Viewed 7665 times

Thanks Matt and Jay for your help, and patience, while I worked through this issue.

One caveat to anyone else trying this approach, you need Indigo 6.0.5. Previous versions of I6 used the uiValue rather than the value for selecting the state column icon.

* as defined in the icon heuristic table

Re: Interface graphic symbols (Dead horse beating)

PostPosted: Sun Nov 19, 2017 1:59 pm
by berkinet
matt (support) wrote:
... We do plan on providing a more flexible mechanism in the future.

I was just wondering if this ever happened. I have searched the Indigodomo web site and all I can find is the discussion on status icons in the API v1.1.1 release notes..

What I am trying to do is support a graphic notation of Bypassed zones in the device list for alarm zones.
I currently have the UI displayState set to Clear/Fault with a corresponding green or red dot displayed.
Ideally, I would like to have 4 states per zone:
    Clear:not_bypassed
    Clear:bypassed
    Fault:not bypassed
    Fault:bypassed
However, I could get by with three states: Clear (green), Fault (red), Bypassed (yellow). For the time being, I am working with "bypass" as text since it is not recognized b y the icon heuristic.

In any case, this falls under the "nice to have" heading and is by no means critical. But, since it's been 4 years since I last checked on this, I though I'd check to see if there have been any changes..

Re: Interface graphic symbols (Dead horse beating)

PostPosted: Sun Nov 19, 2017 5:08 pm
by matt (support)

Re: Interface graphic symbols (Dead horse beating)

PostPosted: Sun Nov 19, 2017 5:51 pm
by berkinet
matt (support) wrote:

Thanks Matt. I had missed that change. Do you plan to also maintain support for the v1.1.1 heuristic and uiValue attribute, or, will they be blended into updateStateImageOnServer() at some point ?

Also, is the custom image icon still on the list for future development? That is what I would really ,like to see.

Re: Interface graphic symbols (Dead horse beating)

PostPosted: Sun Nov 19, 2017 5:52 pm
by matt (support)
uiValue and the heuristic will be maintained and separate from the updateStateImageOnServer() API.

Custom state images are definitely still on the list, but you know us – no ETA. ;-)