Skip to content

Variable definaitions not working in the Widget Editor #4253

@Mark-VG

Description

@Mark-VG

The problem

The was an issue introudced in M1 that stopped variables definitions from being applied as per the following issue:
#3939

This was fixed, however I now see that the defintion does not seem to be aplied in the Widget Editor, though does still work when implemented for example on teh Overview Page etc.

Expected behavior

The variable definition to work in the Widget Editor in teh same way as it does when implemented on a page etc.

Steps to reproduce

The following test widget demonstrates the issue:

version: 1
widgets:
  Tes_VariableAction_SNAPSHOT:
    tags: []
    props:
      parameters:
        - description: A text prop
          label: Prop 1
          name: prop1
          required: false
          type: TEXT
        - context: item
          description: An item to control
          label: Item
          name: item
          required: false
          type: TEXT
      parameterGroups: []
    component: f7-card
    config:
      defineVars:
        testVariable: true
      footer: =props.prop1
      title: Test of Variable Action
    slots:
      default:
        - component: f7-block
          config:
            style:
              left: 0px
              margin: 0
              padding: 0
              position: absolute
              top: 45px
              width: 100%
          slots:
            default:
              - component: oh-button
                config:
                  action: variable
                  actionVariable: testVariable
                  actionVariableValue: '=(vars.testVariable == "null") ? true : !(vars.testVariable)'
                  style:
                    height: 100%
                    width: 100%
                  text: OPEN
        - component: Label
          config:
            style:
              color: black
              font-size: 10px
              left: 20px
              position: absolute
              top: 78px
            text: ="Value testVariable - " + [vars.testVariable]

On initial display the widget editior should show the defined "value" of the variable:

Image

As can be seen the variable is undefined even though the definition sets the "value" to true.

Your environment

runtimeInfo:
version: 5.2.0
buildString: "Build #5410"
locale: en-ZA
systemInfo:
configFolder: C:\openHAB\conf
userdataFolder: C:\openHAB\userdata
logFolder: C:\openHAB\userdata\logs
javaVersion: 21.0.6
javaVendor: Eclipse Adoptium
javaVendorVersion: Temurin-21.0.6+7
osName: Windows 10
osVersion: "10.0"
osArchitecture: amd64
availableProcessors: 8
freeMemory: 68882776
totalMemory: 446693376
uptime: 23126
startLevel: 100
addons:

  • automation-jsscripting
  • binding-astro
  • binding-chromecast
  • binding-gpstracker
  • binding-harmonyhub
  • binding-http
  • binding-hue
  • binding-lgwebos
  • binding-modbus
  • binding-ntp
  • binding-openweathermap
  • binding-paradoxalarm
  • binding-shelly
  • binding-systeminfo
  • binding-tuya
  • misc-homekit
  • misc-openhabcloud
  • persistence-influxdb
  • persistence-mapdb
  • transformation-map
  • transformation-regex
  • transformation-scale
  • voice-googletts
    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
    electron: false
    capacitor: false
    nwjs: false
    webView: false
    webview: false
    standalone: false
    os: windows
    pixelRatio: 1
    prefersColorScheme: light
    isSecureContext: true
    locationbarVisible: true
    menubarVisible: true
    navigator:
    cookieEnabled: true
    deviceMemory: 16
    hardwareConcurrency: 8
    language: en-US
    languages:
    • en-US
    • en
      onLine: true
      platform: Win32
      screen:
      width: 1920
      height: 1080
      colorDepth: 32
      support:
      touch: false
      pointerEvents: true
      passiveListener: true
      intersectionObserver: true
      themeOptions:
      dark: light
      autoDarkMode: true
      bars: light
      homeNavBar: default
      homeBackground: default
      disableExpandableCardAnimation: false
      blocklyRenderer: null
      disablePageTransitionAnimation: false
      hideChatInput: false
      webAudio: false
      visibleBreakpointDisabled: false
      userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,
      like Gecko) Chrome/148.0.0.0 Safari/537.36
      timestamp: 2026-06-03T12:14:24.662Z

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmain uiMain UI

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions