Analyze discrete String

Hi,

I have a sensor which reports lightlevel as a discrete String values. I’d like to analyze these values such that I can see the lightlevel at certain times. I configured the analyze action but my chart is empty. Note that analyzing in general works fine using jdbc as default persistence.

My guess is that the analyzer needs numeric data points to work. The next question would be how to best transform the strings into numbers but still displaying them in the chart. I could certainly do that using Rules but I wonder if there is a more direct way?

Greetings,
Matthias

Probably.

When you are ready, show us the detail of your Item and how it gets updated - channel, perhaps? - and sample data.

@rossko57 sure:


According to the binding docs, light_level should be a number type channel.

Perhaps your device hasn’t been found properly?

What is an example of an actual Item state here, are you trying to plot text “Daylight” and “Dark” values here?

Yeah, the discrete values are smth. like “Daylight”, “Sunset”, “Dark”, … And I’d like to plot them.

There is a numeric channel “Daylight value” and the analyzer for the linked item is working. But the question remains, what’s the best way to plot discrete String values :slight_smile:

What do you visualize happening, exactly, what would a chart of “text” look like?
Maybe a timeline, a bar that changes colour in blocks. It’s an interesting challenge and I don’t think there is any feature like that readily available.

Of course you could create a numeric analog to the text, scale 0 to 3 or whatever by simple mapping, and chart that fairly easily.

Struggling to see the point really when you already have numeric alternate value available to chart. What is the real purpose of having this, what are you hoping to gain or learn? There might be a different approach.

@rossko57

Of course you could create a numeric analog to the text, scale 0 to 3 or whatever by simple mapping, and chart that fairly easily.

^ this would be enough for me for the moment. How would you do that? Create a new Item and populate that using a rule?

Create a Number type Item, link that to your existing string channel (as well as your regular String Item), but apply a transform profile. Use a MAP transform to select numeric values.

1 Like

@rossko57 Thank you, I knew there was something more specialized for that than rules

same problem:
Presence (netzwork binding with ping) detection with “away” or “in House” with transform file.
Analyze is not possible.
My solution:
2 items, one with textual (transform) and one with Switch (ON / OFF), which can be analyzed and charted.
The events log displays both if they change.
Is there a possibility to make that more comfortable with only one item?
Thanks

2 Likes

@Klaus_Schuster not that I’m aware of. Maybe we should write a github issue.