Openhab 3.4 - strange display issue on Overview Page

…moved from Android App forums…

Hi,

a few days ago, my modded overview page started to display unexpected data. It seems like the displayed data is the state of an item or something like that.

here’s a screenshot:

the overview page was acting like expected for the last year,
but now there’s a “5000” displayed behind every entry…

It occurs to the label tag of the oh-label-item

I don’t know if my changes to my rule files could have caused this??
But I made no changes to the overview page itself.

here’s the yaml:

config:
  label: Übersicht
  layoutType: responsive
blocks:
  - component: oh-block
    config: {}
    slots:
      default:
        - component: oh-grid-row
          config: {}
          slots:
            default:
              - component: oh-grid-col
                config: {}
                slots:
                  default:
                    - component: oh-list-card
                      config: {}
                      slots:
                        default:
                          - component: oh-label-item
                            config:
                              action: popup
                              actionModal: widget:weatherPopup
                              actionModalConfig:
                                forecastDays: "3"
                                itemPrefix: OneCallAPIweatherandforecast_
                                itemPrefix2: Localweatherandforecast_
                                locationTitle: Niendorf
                                timestampFormat: HH:mm
                                timestampSuffix: Uhr
                                wordingFeel: gefühlt
                                wordingHumidity: Luftfeuchtigkeit
                                wordingPrecipitation: Niederschlagswahrscheinlichkeit
                              icon: f7:cloud
                              title: Weather
                          - component: oh-label-item
                            config:
                              action: options
                              actionItem: HQHub_CurrentActivity
                              color: purple
                              expandable: false
                              f7icon: speaker
                              fontSize: "-6"
                              icon: f7:wand_stars_inverse
                              title: =items["HQHub_CurrentActivity"].state
                          - component: oh-label-item
                            config:
                              action: navigate
                              actionPage: ="page:"+items["HQHub_CurrentActivity"].state
                              actionPageTransition: f7-fade
                              color: blue
                              expandable: false
                              fontSize: "-6"
                              icon: f7:table_fill
                              title: Harmony Remote
                          - component: oh-label-item
                            config:
                              action: navigate
                              actionPage: page:SqueezeControl
                              actionPageTransition: f7-fade
                              icon: f7:hifispeaker
                              title: Squeeze Player
                          - component: oh-label-item
                            config:
                              action: navigate
                              actionPage: page:Actions
                              actionPageTransition: f7-fade
                              icon: f7:arrowshape_turn_up_right
                              title: Actions
                          - component: oh-label-item
                            config:
                              action: navigate
                              actionPage: page:LightControl
                              actionPageTransition: f7-fade
                              icon: f7:lightbulb
                              title: Lights
                          - component: oh-label-item
                            config:
                              action: navigate
                              actionPage: page:Sensors
                              actionPageTransition: f7-fade
                              icon: f7:radiowaves_right
                              title: Sensors
                          - component: oh-label-item
                            config:
                              action: navigate
                              actionPage: page:System
                              actionPageTransition: f7-fade
                              icon: f7:graph_square_fill
                              title: System
  - component: oh-block
    config: {}
    slots:
      default: []
masonry: null
grid: null
canvas: null

has anyone an idea what’s happening here? I have no clue…

Update:

I have cleared the cache and restarted OH but no change…
Logs after startup also showing no exceptional entries.

I don’t know what to do next - nothing changed - same strange behavior…

Look into the developer tools of your browser (Chrome: strg+shift+i) and identify the element which brings up the value

1 Like

thanks for that Oliver… Good idea!

here are some news… actually the displayed text changed from “5000” to “invalid date” :rofl: :rofl: :rofl:

I also followed Oliver’s advice to see in which <div> the content is shown…
here’s a screenshot:

I think I don’t get any further here :pleading_face: maybe this is some kind of bug

it’s very strange that this text is shown behind every component entry - I think I’m not experienced enough to understand the underlying problem, because I know nearly nothing about the functions of the UI…

Here’s what I see: That part of the oh-label-item gets populated in only one of two ways. If you have the after configuration set (which you do not for any of the components), or if the item configuration for that component is set to the name of an item (which it appears is not the case). My suspicion is that somehow, somewhere, you have instantiated an item with a name of empty string '' (I wouldn’t have thought this possible, but it does seem to be where the evidence points). This means that when the UI takes the empty item property and tries to extract the state of that item, instead of getting an undefined response, it gets the name of this ghost item.

Here’s a test. Add this to the same list as the other oh-label-items:

- component: oh-label-item
  config:
    title: Test
    after: =items[''].state

That should just show a - in the after slot of the item. If it also shows Invalid Date then that’s an indication that we’re on the right track.

If this is the case then it’s worth taking the time to track down this mysterious ghost item because there’s no telling what other issues it may be causing (not to mention knowing how it happened in the first place would be important to prevent this in the future). However, you can eliminate the problem in the UI easily enough. As you are not using either the after or the item configurations, there’s actually no reason for you to be using the oh-label-item components here. Replace them all with oh-list-item instead and you’ll remove the offending text.

1 Like

thanks for your informative reply Justin,

I added your component to my overview page, and it only shows the “-” you mentioned.
when I change your definition to

- component: oh-label-item
  config:
    title: Test
    after: {}

it returns undefined insted of “-

when I remove the after tag completely I get the Invalid Date

do you think changing from label-item to list-item will help anyway?? I haven’t quite understood if this is only an option when the Invalid Date is shown with your initial test component config?!?? :wink:

thanks a lot - I’ll test where I can get with changing the component type…

cheers, Dan

Update:
when using the list-item instead of the label item everthing is working like expected… but It makes me a little unhappy to have not resolved the underlying problem - I don’t even understand what could be the exact cause… anyway, it’s solved now somehow :wink:

thanks again!

Well, that’s a good sign…I think.

Right, that’s just the same situation as all your other list items.

Yeah, I would advocate still trying to hunt this down. The next couple of tests I would run are

  1. check to see if you’re getting the same issue in the widget editor window. I assume you are, but it’s important to test. Just open up the widget editor and paste this:
uid: widget_test
props:
  parameterGroups: []
  parameters: []
tags: []
component: oh-list-card
config:
  title: Test
slots:
  default:
    - component: oh-label-item
      config:
        title: Test
  1. Make a quick script to see if you can find a item which currently has a state of Invalid Date. A JSscripting version would look like this:
iList = items.getItems();
foundItems = iList.find(x => x.state == 'Invalid Date');
console.log(foundItems ? `Item name is: ${foundItems.name}` : 'No matching item found');

Run it from the UI and check the log to see what it finds.

1 Like

just a second…

yes, your test widget also returns the Invalid Date

your script returns:

==> /var/log/openhab/openhab.log <==
2023-01-26 16:46:47.262 [INFO ] [tomation.script.ui.searchinvaliddate] - Item name is: undefined

Ok, now It get’s a little clearer what’s happening… A time ago I kept getting errors in the logs - don’t know the exact phrase but it something like “item is undefined” or something similar… after a look at the forums someone gave me the tip to add a dummy item named undefined and after that the log mesages where gone, and I completely forgot about that until now…

I found that item in my registry and am able to remove it, don’t know which side effects this produces…

the funny thing is this worked for a long time without any errors or sideeffects, I think it all happens after updating to 3.4 and changing my rules fron DSL to JSRule.

Ah, I see. Yes, I should have guessed that initially along with '' as a possible item name. I can say whether or not such a named item would have any other downstream effects. BUt, yes, I believe item name handling has become a little more rigorous in recent core versions so that may be where the change came from. I, personally, would shy away from having an item named undefined jsut to avoid exactly this kind of mystery which I could see myself losing a whole week to before I remembered to check my weirdly named items.

1 Like

Update: I removed the dummy item named undefined and watched the logs for a time… the error messages I got before aren’t appearing for now - I keep checking this, maybe caused by an error in the previous versions of OH which is fixed already.

The undefined item was a string item but it wasn’t bound to anything, don’t know how this could get a state…

But really weird side effect it has produced…

Most likely during the testing of rules while converting from DSL to JSscripting. I could certainly see a situation where an incomplete or still buggy rule tried to send a command to an item using a variable for the item name, and if that variable was undefined but also had toString() or some similar conversion applied to it then sendCommand would have happily searched for an item named 'undefined'.

Ok this also would explain why the state changed from 5000 to Invalid Date but really weird, I would never have found this without your help!