[SOLVED] Graphs with RRD4J

image

REST API

Go to Items
image
Select POST
Enter the item name
Enter the value
Click “Try it out”

I do not have the rest api, only the home builder :persevere:, anyway I am testing with the setpoint of the temperature of the heating and nothing

I think is an error in maybe a command line?
let’s review

  1. Install rrd4j addon
  2. Select rrd4j in config
  3. Create rrd4j.persist

Strategies {
// for rrd charts, we need a cron strategy
everyMinute: “0 * * * * ?”
default = everyChange
}

Items {
Temperature*: strategy = everyUpdate, everyMinute
}

  1. Create the .sitemap command
    Chart item=Temperature refresh=6000 period=h
Chart item=Temperature* refresh=60000 period=h

Can you post your items?

How did you define the group Temperature?
Are you sure your items belong to that group?

This is my .item for weather with the weather addon, i try this Temperature item without group but not work

String Conditions “Conditions [%s]”
Image Icon “Icon”
DateTime ObservationTime “Observation time [%1$tH:%1$tM]”
String ObservationLocation “Location [%s]”
String Station “Station [%s]”

Number Temperature “Current temperature [%.1f °C]”

Number ForecastTempMin “Forecast min temp [%.1f °C]”
Number ForecastTempMax “Forecast max temp [%.1f °C]”

OK create a Group called Temperatures (With an s)

Items:

Group Temperatures
String Conditions “Conditions [%s]”
Image Icon “Icon”
DateTime ObservationTime “Observation time [%1$tH:%1$tM]”
String ObservationLocation “Location [%s]”
String Station “Station [%s]”

Number Temperature “Current temperature [%.1f °C]” (Temperatures)

Number ForecastTempMin “Forecast min temp [%.1f °C]”
Number ForecastTempMax “Forecast max temp [%.1f °C]” 

Persistence:

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

Items {
    Temperatures*: strategy = everyUpdate, everyMinute
}

Ok, now the graphics disappear, I have also modified the sitemaps in this way

Chart item=Temperatures refresh=6000 period=h

If i put only Temperature item, the graph reappears but empty

Only thing I can suggest is to uninstall rrd4j, restart oh and reinstall rrd4j

I’ll try that and if it does not work I’ll try with InfluxDB+Grafana.

Thanks for all!!

Hi,

I remember I had the same issue like you at the beginning. I would strongly recommend to try out RRD4J before Influx+Grafana. This is a bit more complex to master than RRD4J.

It may sound awfully stupid, but what helped with me, was to create a new group, which I persisted.

Also, I assume you still have the corresponding channels in your Item file?

Just sharing some example from my implementation, with different bindings:

ITEM FILE:

    Group TempusChart	
    Group Tempus "Temperatur" <temp> (Home)
    Group Wetter "Weather Items" (Home)
//Some Item from the Yahoo Binding
Number Temperature_yahoo "Aussentemperatur (MD) [%.1f °C]" <tempoutside> (Wetter, Tempus) { channel="yahooweather:weather:7665b22d:temperature" }
//Some Item from the Wunderground Binding
Number Forecast2TempMin "Minimal Temp. übermorgen [%.1f °C]" <tempoutside> (Wetter) {channel="weatherunderground:weather:local:forecastDay2#minTemperature"}
//Some Item from the Weather Binding
Number   Temp_Feel        "Temperatur gefühlt [%.2f °C]" <tempfelt> (Wetter, Tempus, TempusChart) {weather="locationId=home2, type=temperature, property=feel"}

// You can use this dummy item to change the measurement time in your graphs
Number IntervallTempus

SITEMAP FILE:

Switch item=IntervallTempus label="Temperaturverlauf" mappings=[0="Hour", 1="Day", 2="Week", 3="Month", 4="Year"]
Chart item=TempusChart period=h refresh=30000 visibility=[IntervallTempus==0, IntervallTempus=="Uninitialized"]
Chart item=TempusChart period=D refresh=30000 visibility=[IntervallTempus==1]
Chart item=TempusChart period=W refresh=30000 visibility=[IntervallTempus==2]
Chart item=TempusChart period=M refresh=30000 visibility=[IntervallTempus==3]
Chart item=TempusChart period=Y refresh=30000 visibility=[IntervallTempus==4]

RRD4J CONF FILE

NADA! (all commented out - no special manual config)

PERSISTENCE FILE:

Strategies {
 everyMinute : "0 * * * * ?"
 everyHour : "0 0 * * * ?"
 everyDay : "0 0 0 * * ?"
 every15min : "*/15 * * * * ?"
 default = everyChange
}

Items {
TempusChart* : strategy = restoreOnStartup, everyChange  }

It’s not my work, it’s copied together from other people who shared their knowhow previously and maybe the above is helping you now.

Kurt

1 Like

I copied your example by adapting it to my items and i reinstalled the addon.
When I put a items group the graph disappears, when I put an item, the graphic appears but empty.
I use Snapshot 2.3 in windows, maybe it is some error?

Hi,

mmh. I believe I’m at the end of what would be further guidance for finding a solution :frowning:

To make sure:

  1. you did give the persistence service some time to log data and plot it?
  2. you are sure that the group config is correct?

the config I posted above definitely works on 2.3

Kurt

Finally works!!
I Installed openhabian, copy your example, select rrd4j in the system, and WORKSSS, maybe a problem with something in windows

Thank you very much for the time dedicated, great forum, great people

Great stuff and happy to hear this!
Please mark your threat as resolved and enjoy the data graphs :wink:

Kurt

Really glad you got it working. Linux all the way!!
Really stumped as to why it didn’t work before
Please mark the thread as solved

Hi Vincent,

a side question: How do you display the rest api in the main landing page?

Kurt

I run expert mode, maybe that’s why I have the REST api in the landing page.
Are you on simple, or standard mode?

mmh. I’m not really sure to be honest. I wasn’t aware about the expert mode :zipper_mouth_face:
standard (openhabian), I guess.
Kurt

In your conf/services folder there is a file called addons.cfg
It looks like this:

# The installation package of this openHAB instance
# Note: This is only regarded at the VERY FIRST START of openHAB
# Note: If you want to specify your add-ons yourself through entries below, set the package to "minimal"
# as otherwise your definition might be in conflict with what the installation package defines.
#
# Optional. If not set, the dashboard (https://<yourserver>:8080/) will ask you to choose a package.
#
# Valid options:
#   - minimal  : Installation only with dashboard, but no UIs or other add-ons. Use this for custom setups.
#   - simple   : Setup for using openHAB purely through UIs - you need to expect MANY constraints in functionality!
#   - standard : Default setup for normal users, best for textual setup
#   - expert   : Setup for expert users, especially for people migrating from openHAB 1.x
#   - demo     : A demo setup which includes UIs, a few bindings, config files etc.
#
# See http://docs.openhab.org/configuration/packages.html for a detailed explanation of these packages.
#
#package = minimal
...

Uncomment the #package=minimal and change it to package=standard
Restart OH

1 Like