Jokerigno
(Jokerigno)
1
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!
petro
(Petro)
2
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?
Jokerigno
(Jokerigno)
3
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"
}
petro
(Petro)
4
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"