Referencing pre-cached data in discovery yaml

Trying to get proper labels on graphs, working on support for Dell SCv-series storage.

Pre-cache seems to grab the values correctly (discovery snippit):

Caching data: sensors […]
scCtlrName.1 = “Top Controller”
scCtlrName.2 = “Bottom Controller”

I can’t for the life of me figure out how to reference this later on in the definition.

If I put the below in my description then it prints a literal “{{ $scCtlrName.$subindex0 }}” for the graph labels.

{{ $scCtlrName.$subindex0 }}

Just to trying getting the first one for testing, I tried the below and then discovery gives “Warning: No variable available to replace scCtlrName.1.”

{{ $scCtlrName.1 }}

Same warning if I use just

{{ $scCtlrName }}

I really need support for these devices. I’ve seen it talked about/requested more than once on github as well. I’m trying my best to figure this out for myself and post everything so others can benefit but I’m sinking a ton of time I don’t have into this and not making much progress. I’m not great on PHP and can’t pick apart the code and I haven’t found info in the documentation on using pre-cache.

You should probably attach your YAML file in order to get some precise help. Basically you don’t have to specify any index when you access cached data, the YAML parser takes care of giving you only the current index. So the form would be ‘{{ $scCtlrName }}’ . But without the YAML file, difficult to see the real issue …

Thanks so much for the info.

Here’s the section I’m working on:

Here’s a walk (line 435 = name, 682 = temperature)

And here’s the MIB:

On this device, the data values have a two-part index but the component description only has one. Data is in scCtlrTempCurrentC.1.1 but controller name is in scCtlrName.1, data in scCtlrTempCurrentC.2.1, controller name is in scCtlrName.2, etc.

What I really want to get to happen is something like “scCtlrName scCtlrTempName” or “scCtlrTempName (scCtlrName)”

Thanks again!

Basically, you are in a case where YAML file cannot make it. If the index is not consistant in the different OIDs, there is no way to do it except writing some PHP code.

Thank you. I’ll circle back and try that later, I have a lot of sensors to configure, so I’ll just use less pretty names for now (YAML) so I can get it at least functional first.