Could not find item ... in registry

I am using Openhab 3.4.3 on Armbian on a Orangepi3 LTS. I am running Control a water heater and ground source heat pump based on cheap hours of spot priced electricity - #152 by masipila on it and it just works. However, I get these errors in the log despite the code running flawlessly and all the listed items being visible and usable from influxdb. What are these and how do I remove them?

2023-05-09 21:19:28.305 [INFO ] [b.internal.InfluxDBStateConvertUtils] - Could not find item 'fmi_forecast_TotalCloudCover' in registry
2023-05-09 21:19:28.306 [INFO ] [b.internal.InfluxDBStateConvertUtils] - Could not find item 'fmi_forecast_temperature' in registry
2023-05-09 21:19:28.307 [INFO ] [b.internal.InfluxDBStateConvertUtils] - Could not find item 'fmi_forecast_TotalCloudCover' in registry
2023-05-09 21:19:28.308 [INFO ] [b.internal.InfluxDBStateConvertUtils] - Could not find item 'fmi_forecast_WindSpeedMS' in registry
2023-05-09 21:19:28.308 [INFO ] [b.internal.InfluxDBStateConvertUtils] - Could not find item 'fmi_forecast_temperature' in registry
2023-05-09 21:19:28.308 [INFO ] [b.internal.InfluxDBStateConvertUtils] - Could not find item 'fmi_forecast_TotalCloudCover' in registry
2023-05-09 21:19:28.310 [INFO ] [b.internal.InfluxDBStateConvertUtils] - Could not find item 'fmi_forecast_WindSpeedMS' in registry
2023-05-09 21:19:28.310 [INFO ] [b.internal.InfluxDBStateConvertUtils] - Could not find item 'fmi_forecast_TotalCloudCover' in registry
2023-05-09 21:19:28.310 [INFO ] [b.internal.InfluxDBStateConvertUtils] - Could not find item 'fmi_forecast_temperature' in registry
2023-05-09 21:19:28.312 [INFO ] [b.internal.InfluxDBStateConvertUtils] - Could not find item 'fmi_forecast_WindSpeedMS' in registry
2023-05-09 21:19:28.313 [INFO ] [b.internal.InfluxDBStateConvertUtils] - Could not find item 'fmi_forecast_temperature' in registry
2023-05-09 21:19:28.314 [INFO ] [b.internal.InfluxDBStateConvertUtils] - Could not find item 'fmi_forecast_WindSpeedMS' in registry
2023-05-09 21:19:28.315 [INFO ] [b.internal.InfluxDBStateConvertUtils] - Could not find item 'fmi_forecast_temperature' in registry
2023-05-09 21:19:28.316 [INFO ] [b.internal.InfluxDBStateConvertUtils] - Could not find item 'fmi_forecast_WindSpeedMS' in registry

Is there a particular time when you see these errors (e.g. at system startup)?

The registry it mentions is the Item registry and the error means that at the time it checked, the Item didn’t exist. Knowing a bit more about the timing can maybe point at a cause, or at least a path to a cause.

Not really. They come in bursts every so often during the day.

They don’t happen to correspond to editing .items files or anything like that? The only reason I can think of that the InfluxDB add-on would be looking for Items in the registry is to do a restoreOnStartup, which happens during OH start and for file based .items files when the file is reloaded after a change.

Just found out that the errors appear when I refresh my graph:

config:
  chartType: day
  label: Spotsähkön hinta ja ohjaus II
  order: "-15"
  sidebar: true
slots:
  grid:
    - component: oh-chart-grid
      config: {}
  legend:
    - component: oh-chart-legend
      config:
        orient: horizontal
        show: true
  series:
    - component: oh-time-series
      config:
        areaStyle:
          opacity: "0.4"
        gridIndex: 0
        item: spot_price
        markLine:
          data:
            - label:
                distance: -150
              name: Avg
              type: average
        name: Sähkön tuntihinta
        step: end
        type: line
        xAxisIndex: 0
        yAxisIndex: 0
    - component: oh-time-series
      config:
        areaStyle:
          opacity: "0.4"
        gridIndex: 0
        item: nibe1245ReleStatusNumber
        name: Nibe 1245 releen tila
        step: end
        type: line
        xAxisIndex: 0
        yAxisIndex: 2
    - component: oh-time-series
      config:
        areaStyle:
          opacity: "0.4"
        gridIndex: 0
        item: Nibe1245StatusNumber
        name: Nibe 1245 pumpun tila
        step: end
        type: line
        xAxisIndex: 0
        yAxisIndex: 2
    - component: oh-time-series
      config:
        areaStyle:
          opacity: "0.4"
        color: orange
        gridIndex: 0
        item: nibe_control
        name: Nibe 1245 ohjaus
        step: end
        type: line
        xAxisIndex: 0
        yAxisIndex: 2
    - component: oh-time-series
      config:
        gridIndex: 0
        item: fmi_forecast_WindSpeedMS
        markLine:
          data:
            - label:
                distance: -100
              name: Avg
              type: average
        name: Tuuliennuste
        type: line
        xAxisIndex: 0
        yAxisIndex: 1
    - component: oh-time-series
      config:
        gridIndex: 0
        item: fmi_forecast_TotalCloudCover
        markLine:
          data:
            - label:
                distance: -100
              name: Avg
              type: average
        name: Pilvisyysennuste
        type: line
        xAxisIndex: 0
        yAxisIndex: 1
    - component: oh-time-series
      config:
        gridIndex: 0
        item: fmi_forecast_temperature
        markLine:
          data:
            - label:
                distance: -100
              name: Avg
              type: average
        name: Lämpötilaennuste
        type: line
        xAxisIndex: 0
        yAxisIndex: 1
    - component: oh-time-series
      config:
        gridIndex: 0
        item: aaroninHuoneenAnturi
        name: Aaronin MH lämpötila
        type: line
        xAxisIndex: 0
        yAxisIndex: 1
  tooltip:
    - component: oh-chart-tooltip
      config:
        orient: horizontal
        show: true
  xAxis:
    - component: oh-time-axis
      config:
        gridIndex: 0
  yAxis:
    - component: oh-value-axis
      config:
        gridIndex: 0
    - component: oh-value-axis
      config:
        gridIndex: 0
        max: "100"
        splitLine:
          show: false
    - component: oh-value-axis
      config:
        gridIndex: 0
        max: "5"
        min: "0"
        show: false

The graph works right, though.

Did some debugging and found out the root cause for this error. It happens when the graph is fetching point values from InfluxDB that do not have a corresponding Item in OpenHAB. If I add an item with the same name the error goes away.

Seems like the graphing engine is expects items for all displayed values. Is this a bug or is this how it is supposed to work? I see no need for items for values that are used for graphing only.

openHAB charting only works with Items. Yes, the healing engine is expecting Items. This is working as designed. I’m not entirely clear how you got it to even try to chart data that isn’t associated with an Item.

I have no clue either. “It just works”. I originally just copied the template of @masipila Control a water heater and ground source heat pump based on cheap hours of spot priced electricity - #152 by masipila I do not recall exactly how I got it working but I assume I just edited the yaml and added point names for the graphs. And poof,.they showed up.

Reading Marcus’ post he clearly states items have to be created for them to be available for the graph.

This is a kludgy workaround to get openhab chrts to render our control value time series.

Background:

The control value time series data is saved to the influxdb directly with the Influx REST API (called from the script actions of our rules) , bypasing the openhab persistence layers completely. This is because openHab doesn’t currently support saving timeseries data with future timestamps.

Now, the data of the control points is in the influx database, but openHab is completely unaware of it, so it cannot render it in the Charts.

To make the data available for charting, the kludgy workaround is to create an Item with exactly the same name as what we used when we saved the data to the database. This way we Charts will read the data from the database just like it does for “normal” items whose data openHab had saved via normal persistence.

Markus

1 Like

This clarifies it a bit. I still can not explain why graphs show influx points without corresponding items?

This is interesting… Did you enter the name of the control point to the chart YAML manually? I can’t think of any other way how the chart could be aware of that time series, if you had not created the Item with the same name earlier.

Markus

Yes. For example, the weather forecast from fmi has several forecasts named differently. I just added them to the scripts that fetch the data and then added the same names in the graph yaml. As far as I recall I never had any items created.

Okay, this then explains this. Openhab charts were completely unaware that such data could exist because there were no items for them. It’s kinda a same thing as editing the YAMLs manually and making a typo, that would for sure result in similar errors.

Now that we know what was behind this, it’s quite easy to connect the dots. The error message is telling us exactly what the problem is :slight_smile:

Yes, I will add the items to get rid of the errors in the log.

I still don’t get it how this is possible:

I have no items for “Tuuliennuste” or “Pilvisyysennuste”, i.e fmi_*:

kuva

They are, however, referred to in the YAML:

kuva

OpenHAB complains about these missing items, but still draws the chart.

My theory would be as follows. The interface between OH and InfluxDB is pretty generic. If you give it an Item name, even one that doesn’t exist in OH, it will happily generate a query InfluxDB for that. And since the timeseries in InfluxDB match the Item name, it finds data and charts it.

However, the chart widget also subscribes for update events from the Items it is displaying. This is where the error is coming from since the Item doesn’t exist.

1 Like

Added items for all the point names in influx. Now there are no errors in the log anymore.

Hey @timo12357,
cloud you explain what you did in influx to get rid of the messages? I’ve got the same problem after restoring some influx openhab measurements for some items. now i see that

[INFO ] [b.internal.InfluxDBStateConvertUtils] - Could not find item 'MQTTSmartMeters.SM01GASKBMTotal' in registry

Message in openhab.log a million times :wink:

InfluxDB, for some reason, is able to store values without a corresponding Item. If this happens, i.e. you have a measurement in InfluxDB that does not have an Item with same name in OpenHAB you get this error.

For example, you have a measurement in InfluxDB that is called:

it will churn out the error but you will still be able to use it in graphs without having a corresponding Item in OpenHAB. This is very counterintuitive and it took some time for me to understand.

The solution, is to create dummy items in OpenHAB with the exact name of the offending item in your logs. In your case, you need to create a dummy item with the name

MQTTSmartMeters.SM01GASKBMTotal

in OpenHAB. After doing this the error should go away.

1 Like

You, good Sir, won the Internet today!

Thank you for the detailed explanation and have a good one!

1 Like

Well after some testing - this isnt my problem, unfortunately…
I used InfluxDB Studio to look inside database and found that i did something wrong while importing the old data. So current data is stored in item_1, label_1 and type_1 while old, imported data is in item, label and type:

So now i have to figure out how to move that data to the correct place… wonderful :wink: