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

Widget - wrong switch state shown #2532

Open
ifs-net opened this issue Apr 12, 2024 · 0 comments
Open

Widget - wrong switch state shown #2532

ifs-net opened this issue Apr 12, 2024 · 0 comments
Labels
bug Something isn't working main ui Main UI

Comments

@ifs-net
Copy link

ifs-net commented Apr 12, 2024

The problem

There seems to be a bug in UI / widgets.

I have a widget (see in video "Angeschaltene Lampen") that shows lamps that are switched on. And it is also possible to switch off the lamps.
Whenever a lamp is switched of via this UI / widget, the item is no longer shown in the widget (thats correkt)
But now openhab tries to show the switch state as off - but applies this state for the wrong item. You can see it in the video - after switching off a lamp the next lamp gets the wrong state (but it still is switched on as you can see after reloading the ui view ion the browser)

I recorded a video to show the problem: http://ifs-net.asuscomm.com/temp/oh-widget.mp4

My widget code:

`uid: lights_on_switches_dimmer
tags:

  • card
  • lights
    props:
    parameters:
    • description: Title
      label: Text as title
      name: prop1
      required: false
      type: TEXT
    • context: item
      description: Group to show for Switches
      label: Group Item
      name: groupToShowSwitches
      required: false
      type: TEXT
    • context: item
      description: Group to show for Dimmer
      label: Group Item
      name: groupToShowDimmer
      required: false
      type: TEXT
    • description: Footer
      label: Text as footer
      name: propFooter
      required: false
      type: TEXT
      parameterGroups: []
      timestamp: Apr 7, 2023, 4:56:51 PM
      component: f7-card
      config:
      footer: =props.propFooter
      style:
      border-radius: var(--f7-card-expandable-border-radius)
      box-shadow: var(--f7-card-expandable-box-shadow)
      title: =props.prop1
      slots:
      default:
    • component: oh-list
      slots:
      default:
      - component: oh-repeater
      config:
      filter: items[loop.switchitem.name].state == "ON"
      for: switchitem
      fragment: true
      groupItem: =props.groupToShowSwitches
      sourceType: itemsInGroup
      slots:
      default:
      - component: oh-toggle-item
      config:
      color: '=(items[loop.switchitem.name].state == "ON") ? "green" : "red"'
      icon: oh:light
      iconColor: '=(items[loop.switchitem.name].state == "ON") ? "green" : "red"'
      item: =loop.switchitem.name
      title: =loop.switchitem.label
      - component: oh-repeater
      config:
      filter: items[loop.dimmeritem.name].state > 0
      for: dimmeritem
      fragment: true
      groupItem: =props.groupToShowDimmer
      sourceType: itemsInGroup
      slots:
      default:
      - component: oh-slider-item
      config:
      color: '=(items[loop.dimmeritem.name].state > 0) ? "green" : "red"'
      icon: oh:light
      iconColor: '=(items[loop.dimmeritem.name].state > 0) ? "green" : "red"'
      item: =loop.dimmeritem.name
      title: =loop.dimmeritem.label
      `

Widget inclusion at overview page:

component: widget:lights_on_switches_dimmer config: groupToShowDimmer: gruppeLichtAlleDimmer groupToShowSwitches: gruppeLichtAlleSwitch prop1: Angeschaltene Lampen

Expected behavior

The state of items is shown correctly

Steps to reproduce

See code snipets

Your environment

runtimeInfo:
version: 4.1.1
buildString: Release Build
locale: de-DE
systemInfo:
configFolder: /openhab/conf
userdataFolder: /openhab/userdata
logFolder: /openhab/userdata/logs
javaVersion: 17.0.9
javaVendor: Debian
osName: Linux
osVersion: 4.4.302+
osArchitecture: amd64
availableProcessors: 4
freeMemory: 240741336
totalMemory: 1098907648
uptime: 2125674
startLevel: 70
addons:

  • binding-amazonechocontrol
  • binding-astro
  • binding-daikin
  • binding-denonmarantz
  • binding-fineoffsetweatherstation
  • binding-goecharger
  • binding-heos
  • binding-homematic
  • binding-http
  • binding-lgwebos
  • binding-mqtt
  • binding-openweathermap
  • binding-shelly
  • binding-telegram
  • misc-openhabcloud
  • persistence-influxdb
    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
    prefersColorScheme: light
    isSecureContext: false
    locationbarVisible: true
    menubarVisible: true
    navigator:
    cookieEnabled: true
    deviceMemory: N/A
    hardwareConcurrency: 16
    language: de-DE
    languages:
    • de-DE
    • de
    • en-US
    • en
      onLine: true
      platform: Win32
      screen:
      width: 1920
      height: 1200
      colorDepth: 24
      support:
      touch: false
      pointerEvents: true
      observer: true
      passiveListener: true
      gestures: false
      intersectionObserver: true
      themeOptions:
      dark: light
      filled: true
      pageTransitionAnimation: default
      bars: filled
      homeNavbar: default
      homeBackground: default
      expandableCardAnimation: default
      userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,
      like Gecko) Chrome/123.0.0.0 Safari/537.36
      timestamp: 2024-04-12T07:00:22.948Z
@ifs-net ifs-net added bug Something isn't working main ui Main UI labels Apr 12, 2024
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

No branches or pull requests

1 participant