State_image in picture-entity doesn't allow spaces?

Hi all,

I’ve setup a picture-entity in lovelace to have a look of Air Quality, here’s the code:

      - type: picture-entity
        entity: sensor.aqicn
        title: Air Quality
        state_image:
          "Buona": /local/airquality/qualitabuona.jpg
          "Moderata": /local/airquality/qualitamoderata.jpg
          "Insalubre per alcuni": /local/qualitainsalubreperalcuni.jpg
          "Insalubre": /local/airquality/qualitainsalubre.jpg
          "Molto insalubre": /local/airquality/qualitamoltoinsalubre.jpg
          "Pericolosa": /local/airquality/qualitapericolosa.jpg

I noticed that if state is on “Insalubre per alcuni” which has spaces the image is not loaded. It is a issue or maybe an error in my config?

Thank you in advance!

Put your paths in quotes and it will work

      - type: picture-entity
        entity: sensor.aqicn
        title: Air Quality
        state_image:
          "Buona": "/local/airquality/qualitabuona.jpg"
          "Moderata": "/local/airquality/qualitamoderata.jpg"
          "Insalubre per alcuni": "/local/qualitainsalubreperalcuni.jpg"
          "Insalubre": "/local/airquality/qualitainsalubre.jpg"
          "Molto insalubre": "/local/airquality/qualitamoltoinsalubre.jpg"
          "Pericolosa": "/local/airquality/qualitapericolosa.jpg"

EDIT: I just noticed that you are referring to the state. That should work… What does sensor.aqicn state in the states page during that state?

at the moment this is the state:

Entità
sensor.aqicn
 
State
Insalubre per alcuni
 
State attributes (JSON, optional)



{
  "friendly_name": "Qualità dell'aria a Torino"
}

Ah, I think I found your issue. Are you missing a part of your path?

          "Insalubre per alcuni": "/local/qualitainsalubreperalcuni.jpg"
                                         ^
                                         |
          "Insalubre per alcuni": "/local/airquality/qualitainsalubreperalcuni.jpg"

You’re right!!!

Thank you very much!