Attribute with value 0 shown as "unknown"

I am displaying the attribute of a sensor in the frontend with the lovelace card type “entity”

cards:
  - type: entity
    entity: sensor.poolpump_power_statistics
    attribute: min_value
    icon: mdi:arrow-down-bold-box-outline
    name: "Min."
    unit: W

If the attribute “min_value” is zero (0), it is shown as “unknown” in the frontend. I would expect it to be shown just as “0”

Is this a bug or feature? Am I doing soemthing wrong?

I just tried it with one of my entities and you are completely right.

“0” displays unknown and anything else (string or number) works fine.

Looks like a bug to me.

Same here.

I tried to display the second attribute of a input_datetime. Its value is 0 yet it’s reported as Unknown in the Lovelace UI Editor:

Bug. :bug:

I hope someone is creating an Issue on the home assistant github? That’s where bugs need to be reported, when it is clear that it’s a bug.

1 Like

Are you volunteering?

No, I don’t have this problem :wink:

But seriously, this is not the place to report bugs. It can be the starting point, to find out whether it really is a bug, but it should end with an Issue being reported in the appropriate HA github. Please note the process of assessing whether there’s a bug also happens a lot in the githubs. So feel free to take such a discussion like above straight to github.

Also, the HA Dev’s don’t look for bugs here, they look at the Issues reported in the various HA githubs.

Also 2, bug-fixes are accepted much quicker when there is a bug reported.

Of course, there are exceptions, but they, like I, tend to focus on “their” integrations. When I find a real bug in “my” integration over here, I always ask the user reporting the bug to create an Issue. Because this helps getting the fix in quicker.

1 Like

You’ve made a lot of assumptions about the purpose of this thread.

If one encounters anomalous behavior, it’s good practice to confirm with others first, here in the community forum, before opening an Issue in GitHub. It minimizes the possibility of reporting something that is simply due to user-error.

Now the OP has received confirmation the behavior is reproducible by others and can confidently report it as an Issue in the frontend repository. If they were unaware of the need to do that, well, they know it now.

Frontend or core for this though?

The smart-azz answer is: “Yes”

I’ve had one too many Issues ping-ponged between developers in the two repos. I’ll say “start with frontend” and hope for the best.

1 Like

Registerd in Github under #6483

4 Likes