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

Add other item as source for dynamic icon state in sitemap #2147

Closed
1 of 4 tasks
tylla opened this issue Oct 21, 2023 · 4 comments
Closed
1 of 4 tasks

Add other item as source for dynamic icon state in sitemap #2147

tylla opened this issue Oct 21, 2023 · 4 comments
Labels
basic ui Basic UI enhancement New feature or request

Comments

@tylla
Copy link

tylla commented Oct 21, 2023

Which UI are you reporting an issue for?

  • Basic UI
  • HABPanel
  • HABot
  • CometVisu

The problem

Currently the dynamic icon feature in the sitemap is restricted to use the state of the item in question. While this is perfect for simple cases, and some can be solved with the visibility property, but there are lots of complex situations that cannot be satisfied.

Your suggestion

I would suggest another parameter - e.g. icon_item or something like this - to be able to specify the origin of the state to be used for the icon.
So for example something like follows could be used:

Text item=custom_combined_rain_and_wind "Last rainfall and current wind [%s]" icon="windrose" icon_item=custom_wind_direction

where

custom_combined_rain_and_wind="Rain: 4 mm Wind: 13 km/h (270°)"    //generated via rules from other three items
custom_wind_direction=75    //created via rules from other item, normalized to the 0-99 range

This would display an entry with a variable text and an icon showing the current wind direction.
OTOH it would deliver a really flexible solution to be used in several other cases where compact interfaces need to be created.

Your environment

runtimeInfo:
  version: 4.0.0
  buildString: Release Build
locale: en-HU
systemInfo:
  configFolder: /etc/openhab
  userdataFolder: /var/lib/openhab
  logFolder: /var/log/openhab
  javaVersion: 17.0.6
  javaVendor: Debian
  osName: Linux
  osVersion: 5.10.0-22-amd64
  osArchitecture: amd64
  availableProcessors: 6
  freeMemory: 224257640
  totalMemory: 880803840
  startLevel: 100
bindings: null
clientInfo:
  device:
    ios: false
    android: false
    androidChrome: false
    desktop: true
    iphone: false
    ipod: false
    ipad: false
    edge: false
    ie: false
    firefox: true
    macos: false
    windows: false
    cordova: false
    phonegap: false
    electron: false
    nwjs: false
    webView: false
    webview: false
    standalone: false
    pixelRatio: 1
    prefersColorScheme: dark
  isSecureContext: false
  locationbarVisible: true
  menubarVisible: true
  navigator:
    cookieEnabled: true
    deviceMemory: N/A
    hardwareConcurrency: 8
    language: en
    languages:
      - en
      - en-US
      - en-GB
      - hu
      - hu-HU
      - de-DE
      - de
      - fr-FR
      - fr
    onLine: true
    platform: Linux x86_64
  screen:
    width: 1920
    height: 1080
    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 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0
timestamp: 2023-10-21T23:09:08.983Z

Additional information

I hope that I did not misplaced this feature request, and I did not slipped over an already existing one - I tried to search thoroughly.
If any questions arise I'm more than happy to elaborate further.

@tylla tylla added the enhancement New feature or request label Oct 21, 2023
@lolodomo
Copy link
Contributor

lolodomo commented Oct 22, 2023

Look at openhab/openhab-core#3820
You can now define icon rules depending on any item state.

Change in Basic UI is proposed but not yet merged: #2020

@lolodomo lolodomo added the basic ui Basic UI label Oct 22, 2023
@tylla
Copy link
Author

tylla commented Oct 22, 2023

Wow, thanks!
And I thought I searched at length. I should have found that. :(

Although, does this pull request handle the "Number State Matching Rule" kind of dynamic icons? I couldn't exactly relate the description of the pull requests to this case.

@lolodomo
Copy link
Contributor

lolodomo commented Nov 3, 2023

Although, does this pull request handle the "Number State Matching Rule" kind of dynamic icons? I couldn't exactly relate the description of the pull requests to this case.

In fact, no because it replaces it. You can redefine the matching rules you like, and you are no more limited by the 0-100 range.

@lolodomo
Copy link
Contributor

I do not expect more extensions now that we have openhab/openhab-core#3820 + #2020 merged. Your use case can be covered, even if not in the way you would expect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
basic ui Basic UI enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants