NUT - no sensors created for s/n or model no by integration

Hi,

Nut running on my Pi should be able to output the model and s/n when running the upsc command the values should be present. So why are no sensor entries created by the HA Nut integration? Thank you

Not sure on the sensor but HA is pulling the info for my three. Just have to download the diagnostics to see it.

Ran diags and in the case of one nut I have setup it does see s/n. In fact every unique_id includes the serial number so why no sensors for it when I check under integrations?

Is it possible to create a sensor using part of the unique id? Every sensor for a UPS running nut uses s/n as part of the unique id. On the Pi the s/n can be seen but s/n comes up blank as shown in my last post. Can a manual sensor be created and populated with a value?

A little farther up, do you have a section like this?

image

If so, then you can create a template helper with this template:

{% set identifiers = device_attr('sensor.3d_printers_ups_load', 'identifiers') | list %}
{% set identifier = identifiers[0][1] %}
{{ identifier.split('_')[-1].strip() }}

and it should give you the SN as a new entity.

I will have to check when I am home later. One of my Pi’s will give me the s/n and couple others don’t. One a side note, the one we are discussing does and the NUT chat over at Github is telling me I need to update NUT to latest version. I thought sudo update\upgrade should do that, but apparently not. Not sure if that relates because I am not sure where NUT for HA is compared to the other one that can be used in multiple platforms. My skill set is not at a level where I can compile a new NUT.

For what your asking I will check later on. Thank you for assistance here.

1 Like

Here is a screenshot of further up in the extract from the diags:

Then I get this error:

Should be sensor.baseups_load in the template.

While it is pulling out the serial number I am getting the message:

‘This template does not listen for any events and will not update automatically’

I am not seeing uom, device class, state class and no submit button.

Your serial number won’t ever change, so I wouldn’t worry too much about it not updating.

You’ll use the template to create a template sensor from the Helpers tab under devices.

That’s where my screenshot came from.

Its not about it not changing. I view HA as a place where all my information can be easily accessed in one place. I don’t want to be looking under the bottom or back of something.

thank you for clarifying that. much appreciated.

Just add it as an attribute and be done with it. There’s a couple of forum posts on how to do that using customize.

Also, I get HA is done by volunteers and I guess there is 3 people that maintain the NUT addon\integration (or so I was told), but I could rattle off few things that entities were created for NUT and the data never changes. It always has a static value. Some have their wants and needs, I have mine too. Thanks for the tip.

Then this needs to go in as a Feature Request. Pretty sure I saw another one requesting this already somewhere on the forum, so search around before creating a new one please.

Difference between what I inquired about on this post was the s/n was part of the entity_id. Now I need to add attribute to something that does not have entity_id or entity. I am basically looking to create something from a data value. I been looking in forums and google and not seeing any good pointers. Can you reference me something to go by?

Nevermind, It was your own post I read, on a different topic, and where you were already told to raise a Feature request.

If it helps, there’s already a generic feature request to show the Serial Id for devices. I suggest you vote there since you’ll have greater odds of this being voted for due to its generic nature.

so no way of creating a manual entity. I guess I was lucky with the other one and it could be manipulated with the template since the s/n was part of entity_id. oh well, win some and lose some.

That’s one of the functions of using a template sensor. It allows you to manual create an entity from somewhere else. There are other entities that can be manually created depending on what you’re trying to do.

Easiest way to create any attributes/notes/whatever for your devices is to use the customize.yaml file. You can then use it in a card just like petro showed you how in the linked post.

Here is an entire FR thread asking for generic notes. The second post shows you exactly what you need to add in customize.yaml.
Just set it up once & forget it.