junkfix/numberbox-card

entity with image: no image displayed

ildar170975 opened this issue · 14 comments

The latest rev. 3.15 installed:
изображение

Consider this example with 2 entities:

  1. Entity is specified w/o entity_picture:
  test_number:
    min: 0
    max: 1000
    step: 1
    mode: slider
    icon: mdi:car
  1. Entity with entity_picture specified:
input_number:
  test_number_with_picture:
    min: -100
    max: 100
    step: 0.1
    mode: box

homeassistant:
  customize:
    input_number.test_number_with_picture:
      entity_picture: /local/images/test/lightgreen.jpg

Card:

type: entities
entities:
  - type: section
    label: image is added
  - entity: input_number.test_number
    image: /local/images/test/orange.jpg
  - type: custom:numberbox-card
    entity: input_number.test_number
    picture: /local/images/test/orange.jpg

  - type: section
    label: number with entity_picture
  - entity: input_number.test_number_with_picture
  - type: custom:numberbox-card
    entity: input_number.test_number_with_picture

In both cases numberbox-card does not show an image:
изображение

If icon: false is added:
изображение

Below - my proposals how to show an icon & picture dependently on:
-- if entity_picture is defined;
-- values of icon & picture options.

изображение

Not working with an entity with "entity_picture":

type: entities
title: entity_picture
entities:
  - type: custom:numberbox-card
    entity: input_number.test_number_with_picture

  - type: custom:numberbox-card
    entity: input_number.test_number_with_picture
    icon: false

  - type: custom:numberbox-card
    entity: input_number.test_number_with_picture
    icon: mdi:car

image

image

Why a user cannot reopen his own issues?
Imho an issue should be closed by a user who created it.

I have just tested it and workes fine,
have you tried in incognito?

Why a user cannot reopen his own issues? Imho an issue should be closed by a user who created it.

no idea how to setup this

no idea how to setup this

OK, hope we'll manage it anyway ))).

have you tried in incognito?

Strange.
I cleared a cache just in case, same in Chrome.
FF - checked too (cannot clear a cache here), same picture:
image

Incognito in Chrome:
image

what are the state attributes in Home assistant > developer tools for input_number.test_number_with_picture

image

input_number:
  test_number_with_picture:
    min: -100
    max: 100
    step: 0.1
    mode: box

homeassistant:
  customize:
    input_number.test_number_with_picture:
      entity_picture: /local/images/test/lightgreen.jpg

works here with 3.16
1
2

Really strange.
Hope we are using same revision of numberbox.

Also - about your entity.
I noticed you are using number.xxxx, and I am using input_number.xxxx.
AFAIK number entities may be created by integrations only.
Just to be sure - could you test with a conventional input_number?


Found a reason.
Check this card:

type: entities
title: entity_picture
entities:
  - entity: input_number.test_number_with_picture
  - type: custom:numberbox-card
    entity: input_number.test_number_with_picture
  - type: custom:numberbox-card
    entity: input_number.test_number_with_picture
    icon: false
  - type: custom:numberbox-card
    entity: input_number.test_number_with_picture
    icon: mdi:car

  - type: section

  - entity: input_number.test_number_with_picture_icon
  - type: custom:numberbox-card
    entity: input_number.test_number_with_picture_icon
  - type: custom:numberbox-card
    entity: input_number.test_number_with_picture_icon
    icon: false
  - type: custom:numberbox-card
    entity: input_number.test_number_with_picture_icon
    icon: mdi:car

with these helpers:

input_number:
  test_number_with_picture:
    min: -100
    max: 100
    step: 0.1
    mode: box
  test_number_with_picture_icon:
    min: -100
    max: 100
    step: 0.1
    mode: box
    icon: mdi:account

homeassistant:
  customize:
    input_number.test_number_with_picture:
      entity_picture: /local/images/test/lightgreen.jpg
    input_number.test_number_with_picture_icon:
      entity_picture: /local/images/test/orange.jpg

The 2nd helper has icon property - which forces the image to be displayed - which is not supposed to cause this.
image

NUMBERBOX_CARD 3.16 numberbox-card.js?hacstag=304967918316:3

confirmed working.

1
2

Please check my edited comment about "icon" property above

Thanks, I found the issue, please try 3.17

Thank you very much, will test it!
Does the new release contain fixes for seconds? - seems to be so.

Seems to be OK !
Here are rules:
image