Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyzer view does not show anything if stateDescription metadata set for Dimmer Item #1523

Closed
NikolayKash opened this issue Oct 10, 2022 · 4 comments · Fixed by #1527
Closed
Labels
bug Something isn't working main ui Main UI

Comments

@NikolayKash
Copy link

I have a Dimmer item where I set state description metadata like

value: " "
config:
  options: 16=1,32=2,48=3,64=4,80=5,100=6
  step: "16"
  min: "16"
  max: "100"

Values are stored in DynamoDB

When I try to analyze this item, Analyzer view does not show anything

like:
image

When I remove stateDescription metadata, it shows raw values as expected

image

Expected behavior

Analyzer should show values as defined in stateDescription or raw values

Steps to reproduce

  1. Create dimmer item and add storing values to some persistence provider like DynamoDB
  2. Add stateDescription metadata as mentioned above
  3. Press Analyze button

Your environment

runtimeInfo:
  version: 3.4.0.M2
  buildString: Milestone Build
locale: en-RU
systemInfo:
  javaVersion: 11.0.13
  javaVendor: Azul Systems, Inc.
  javaVendorVersion: Zulu11.52+13-CA

clientInfo:
  device:
    ios: false
    android: false
    androidChrome: false
    desktop: true
    iphone: false
    ipod: false
    ipad: false
    edge: false
    ie: false
    firefox: false
    macos: false
    windows: true
    cordova: false
    phonegap: false
    electron: false
    nwjs: false
    webView: false
    webview: false
    standalone: false
    os: windows
    pixelRatio: 1.25
    prefersColorScheme: dark
  isSecureContext: false
  locationbarVisible: true
  menubarVisible: true
  navigator:
    cookieEnabled: true
    deviceMemory: N/A
    hardwareConcurrency: 4
    language: en-US
    languages:
      - en-US
      - en
      - ru
    onLine: true
    platform: Win32
  screen:
    width: 1536
    height: 864
    colorDepth: 24
  support:
    touch: false
    pointerEvents: true
    observer: true
    passiveListener: true
    gestures: false
    intersectionObserver: true
  themeOptions:
    dark: dark
    filled: true
    pageTransitionAnimation: default
    bars: light
    homeNavbar: default
    homeBackground: default
    expandableCardAnimation: default
  userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,
    like Gecko) Chrome/105.0.0.0 Safari/537.36
timestamp: 2022-10-10T19:32:53.111Z

Browser console

As I see it retrives item info as well data from persistence correctly.

{"link":"xxxx:xxxxxx:xxxx/rest/items/xxxxxx_FanSpeed","state":"16","stateDescription":{"minimum":16,"maximum":100,"step":16,"readOnly":false,"options":[{"value":"16","label":"1"},{"value":"32","label":"2"},{"value":"48","label":"3"},{"value":"64","label":"4"},{"value":"80","label":"5"},{"value":"100","label":"6"}]},"commandDescription":{"commandOptions":[{"command":"16","label":"1"},{"command":"32","label":"2"},{"command":"48","label":"3"},{"command":"64","label":"4"},{"command":"80","label":"5"},{"command":"100","label":"6"}]},"editable":true,"type":"Dimmer","name":"xxxxxx_FanSpeed","label":"xxxxxx_FanSpeed","category":"DimmableLight","tags":["Point"],"groupNames":["xxxxxxx"]}
{"name":"xxxxxxx_FanSpeed","datapoints":"34","data":[{"time":1665389576886,"state":"0"},{"time":1665413806289,"state":"16"},{"time":1665413836135,"state":"48"},{"time":1665413836192,"state":"16"},{"time":1665413836259,"state":"48"},{"time":1665414377802,"state":"16"},{"time":1665414377858,"state":"48"},{"time":1665414377937,"state":"16"},{"time":1665423580526,"state":"48"},{"time":1665423580595,"state":"16"},{"time":1665423580659,"state":"48"},{"time":1665424121897,"state":"16"},{"time":1665424121995,"state":"48"},{"time":1665424122072,"state":"16"},{"time":1665424181910,"state":"48"},{"time":1665424181977,"state":"16"},{"time":1665424182058,"state":"48"},{"time":1665424723618,"state":"16"},{"time":1665424723709,"state":"48"},{"time":1665424723785,"state":"16"},{"time":1665427791730,"state":"48"},{"time":1665427791793,"state":"16"},{"time":1665427791863,"state":"48"},{"time":1665427827556,"state":"16"},{"time":1665427841463,"state":"48"},{"time":1665428332777,"state":"16"},{"time":1665428332822,"state":"48"},{"time":1665428332954,"state":"16"},{"time":1665428392719,"state":"48"},{"time":1665428392787,"state":"16"},{"time":1665428392852,"state":"48"},{"time":1665428935799,"state":"16"},{"time":1665428935872,"state":"48"},{"time":1665428935937,"state":"16"}]}

Browser network traffic

Additional information

@NikolayKash NikolayKash added bug Something isn't working main ui Main UI labels Oct 10, 2022
@NikolayKash NikolayKash changed the title Analyzer view does not show anything if stateDesciption metadata set Analyzer view does not show anything if stateDescription metadata set Oct 10, 2022
@NikolayKash
Copy link
Author

@ghys, could you please take a look on this?

@ghys
Copy link
Member

ghys commented Oct 14, 2022

This is the relevant code, when an item has state options the series is considered "discrete":

if ((item.type.indexOf('Number') !== 0 && item.type.indexOf('Dimmer') !== 0) || (item.stateDescription && item.stateDescription.options.length > 0)) seriesOptions.discrete = true

The idea was that it would be represented as colored areas on the chart, one color by value, but this ended only implemented for "ON" and "OPEN" states being rendered as an area, not generic states.

@NikolayKash
Copy link
Author

@ghys, thanks! is there any plan to change it for dimmer type?

@NikolayKash NikolayKash changed the title Analyzer view does not show anything if stateDescription metadata set Analyzer view does not show anything if stateDescription metadata set for Dimmer Item Oct 14, 2022
@ghys
Copy link
Member

ghys commented Oct 14, 2022

I wouldn't mind having the options ignored for now, but only while the "discrete" graphs are not implemented (would resemble something like https://echarts.apache.org/examples/en/editor.html?c=custom-profile&reset=1&edit=1 somehow merged with the usual line charts). Ultimately defining options should mean that you expect such a chart with colored rectangles, each color representing a different option.

ghys added a commit that referenced this issue Oct 14, 2022
Close #1523.

Signed-off-by: Yannick Schaus <github@schaus.net>
ghys added a commit that referenced this issue Oct 14, 2022
Close #1523.

Signed-off-by: Yannick Schaus <github@schaus.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working main ui Main UI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants