Persistence, Sitemap Charts blank?

  • Platform information:

    • Hardware: Intel Core i3-6100T CPU @ 3.20GHz (amd64)
    • OS: Docker container: docker pull openhab/openhab:latest
    • Java Runtime Environment: whatever is in the container
    • openHAB version: 4.1.1
  • Issue of the topic:

In terms of persistence, I have a pretty simple configuration. I have a file called rrd4j.persist in the persistence folder. The content of this file is:

// persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies {
	// if no strategy is specified for an item entry below, the default list will be used
	default = everyMinute
}

Within the GUI I have clicked Settings->System Settings->Persistence. There is a single radial button under Default Service called RRD4j. I have ticked this radial button and clicked Save.

I have a somewhat involved custom.sitemap, for simplicity, here is a brief code segment:

    Frame label="Outside" icon="garden" {
        Group item=OU_FrontYard {
            Default item=OU_FrontYard_UpLights 
            Switch item=OU_FrontYard_Chimes_Switch label="Chimes:" mappings=[on="UP",off="DOWN"]
        }
        Chart item=OU_Temperature period=12h  legend=true
    }

For completeness here is my Item definition:

Number:Temperature      OU_Temperature  "Temperature [%.1f %unit%]" <Temperature>      (OU)      ["Temperature", "Point","Measurement"]                     {unit="°F",channel="openweathermap:weather-and-forecast:e520b4654b:local:current#temperature"}

My expectation is to see a Chart that has the temperature for the past 12 hours. Instead, I see this:
image

The GUI provides a value for the Item:

I suspect that I’m overlooking something incredibly simple, but in my several years of OpenHAB, I’ve never been able to get Charts within Sitemaps to work consistently. Another possibility is that I don’t fundamentally understand how RRD4J works as a persistence service, or how persistence services work in general.

I have read:

Although the documentation says this:

NOTE: rrd4j is for storing numerical data only. It cannot store complex data types. The supported item types are therefore only Switch (internally mapped to 0/1), Dimmer, Number, Contact (internally mapped to 0/1), Rollershutter and Color (only brightness component stored).

It looks to be incorrect?

I could provide another example with an Item that is just a Dimmer and/or Number and I have the same result.

I have also tried more complex configurations in the past (on other installs of OpenHAB) with PostgreSQL, and encountered similar issues, which makes me think it’s just me doing something wrong.

[Edit: more than 12 hours has elapsed! :slight_smile: ]

I’d really appreciate some help!

SixO

maybe this is the issue?

Appreciate the search and the response.

The current documentation here:

states:

  • When charting a group of item, make sure that every label is unique.

I don’t see the caveats from the previous documentation being pulled forward to the current documentation.

Also, I’m not charting a group item.

Also, the community forum article originates the problem with a [WARN] in the logs, and I’m not seeing that.

To test, I’ve changed the sitemap to:

    Frame label="Outside" icon="garden" {
        Group item=OU_FrontYard {
            Default item=OU_FrontYard_UpLights 
            Switch item=OU_FrontYard_Chimes_Switch label="Chimes:" mappings=[on="UP",off="DOWN"]
        }
        Chart item=OU_Temperature label="Very-Unique-Label" period=12h  legend=true
    }

and the problem still persists (haha pun!)

My guess is that isn’t the issue.

everyMinute is not one of the predefined strategies. If you want an every minute strategy, you need to define it with a cron statement.

Maybe:?

grumble grumble

Thank you @JustinG

I’ve changed my rrd4j.persist file to:

Strategies {
    // for rrd charts, we need a cron strategy
    everyMinute : "0 * * * * ?"
}

Items {
    // persist items on every change and every minute
    * : strategy = everyChange, everyMinute
}

It’s unclear to me if that’s an acceptabed strategy (everyChange and everyMinute) for charting to work, or, if I have to remove everyChange.

It’s a step forward for sure:
image

Probably needs to be a different thread, but what’s up with all the decimal places. 3 significant digits is enough for me!

I’ll update the post and mark JustinG as the solution tomorrow.

The default strategy for rrd4j when there is no .persist file is going to be everyMinute, everyChange, restoreOnStartup so everyChange and everyMinute is just fine on rrd4j. It’s the default.

See Items | openHAB.