Charts in OH3

New attempt!
I have installed Javascript-Transformation.
My transformation file co2.js:
(function(i){
return (i*1000000);}
)(input)
I hope this is the solution

Might be a problem with the netatmo binding?

Couldn’t find the the name of the developer/maintainer of that binding. Do you know who is the right person to address?

What is the „should be“ value of the item state in REST API:

Humidity 80%:
REST API:0.8?
-> Property humidity -> Number:Dimensionless -> UI: 80% -> Chart: 80%
(No separate state description applied in metadata)

Is this how it should be? Or is there anything missing?

Do you then use the item state of the same item for UI and chart?

Yes. The transform file is only the attempt to correct the value from channel status to item status because of the persistence value is then correct.
netatmo-Modul updates only when values changes. I wait for update!

My Humidtiy Status netatmo: UI: 80%, Chart: 0.8%
Only Metadata: ‘%d %%’ correct my Chart to 80%

The attempt with javascript transormation does not work :frowning:

I don’t unterstand why charts of the netatmo-binding over a long time in OH 2.x works without any problem, but in OH 3 not!
Is there any solution for this issue???

File an issue on the openhab-addons repo is probably the best way.

The whole point of units of measurement is that it is able to do the conversions. So all of those could be “correct”.

Sounds like maxmaximax has a solution.

Hey @maxmaximax,
thank you for the solution to fix the value for indoor and outdoor humidity with pattern ‘%d %%’.
Do you have a solution for CO2 and Noise problem?

It took a while to find a solution -> Hardcoding of UoM (e.g. ppm, dB) in the pattern solved the issue

It seems the problems occur in (some) cases where “pattern”: “%d %unit%” is used by default. Somehow the correct unit is used to show the item in the UI, but for some reason the unit is not correctly applied to persist the values -> charts are wrong.

Add metadata as follows:

CO2: “%.0f ppm”
Noise: “%.0f dB”

3 Likes

Thank you @maxmaximax,
it works, great!

I had the same problem with Co2 values from my Netatmo weather station.
I was looking for a solution for several hours. Now I am happy about this great idea. It works fine.
Thank you very much @maxmaximax.

Update:
Now I started to work with the rain sensor of Netatmo. I added the pattern “%.1f mm” to the item’s state description metadata. This pattern is obviously not used. A label card shows the right value, but with far too many digits behind the radix point.

Is there any solution known for this?

FYI, I ran into this issue as well with my air quality sensor CO2 levels in PPM, plus a few other values.

What’s interesting is I had an old carryover JDBC sqlite persistence config from openhab2. Everything worked fine under JDBC. It was only when I switched to rrd4j that I started seeing issues.

Adding the state description to the relevant items fixed the issue for me though.

It seems like maybe the solution here is openHAB should apply the same logic used to render the elements in the UI (that successfully comes up with a “logical” state description for items without the explicit metadata) to render chart point values?

Dear all, im looking for “visible” depends of items.XXX.state within oh-time-series. Does anybody have a solution?

This is my try and error:

component: oh-time-series
config:
gridIndex: 0
xAxisIndex: 0
yAxisIndex: 0
type: line
name: “115”
item: TMP_115
visible: items.HTL_STE_115.state === “4”

but did not work.

br
hobaka

Hello,

I have a question about the formatting of the values in the chart. both the values at the min/max values and the tooltip are unformatted. I have already created metadata for this and made a formatting there with %.0f W, this is also displayed to me when I look at the item itself, but in the chart everything remains the same. Am I doing something wrong? or is that like the widgets that you distinguish in yaml somewhere in state and the displayed state? For help I would be very grateful.

Furthermore, I can not find anything about charts where you could look up what there is still so for things that do not go through the menu but directly in yaml. Where can I find some additional information or a guide to all the different possibilities? Maybe someone could explain how e.g. the chart Building Pages in the OH3 UI: documentation draft (1/3) is assembled.

Thanks a lot!

Persistence does not yet support units of measurement and therefore the charts do not support units of measurement. The metadata is used in the legend for the Y axis but the graphs are created just the numbers as they are stored in the DB.

Ah ok, thanks. And on the subject of information or guidance?

If I had any advice I would have included it in my reply. I don’t create charts myself really. I find the ones generated by default with the Analyze actions to be more than adequate for my needs.

OK, thank you!

I think I have discovered something similar for myself. Here explanation: Strange behavior in charts when I put two measures together

Hey,

I have a question regarding charts.
I would like to make an aggregate series for a switch item.

I want to have days, and hours of days as axis, and want to plot when presence was active.

With oh-mark-area I got a time series with a switch working, but not an aggregate series.

Thanks!

Some update:

I made a rule to write 1 to a number item if presence active, 0 if inactive.
That way you get really nice plots where hours with partly presence have a lighter color.
I use it for our cats presence (cat flap). That way I can easily see patterns during a week.

Would be nice to know if the above is possible anyway.

Next question: can I adjust colors for the visual map outside the 4 presets?

For example I would like blue-green-red for tracking our cats food intake and the dayly calories.
That way we could easily see when he had too much and when he didn’t eat enough.

EDIT:

for the people looking for an answer:

  visualMap:
    - component: oh-chart-visualmap
      config:
        max: "500"
        min: "0"
        pieces: 4
        inRange:
          color: ['blue', 'green','green','green', 'red']
          colorSaturation: 1
        show: true
        type: continuous

EDIT2:

This is cool. Some others:

  visualMap:
    - component: oh-chart-visualmap
      config:
        max: "1"
        min: "0"
        inRange:
          color:
            - transparent
            - orange
        show: false
        type: continuous