The customization didn’t show immediately. It took many restarts and eventually the entity default icon was replaced by the custom picture.
So, I removed the customize section from configuration.yaml and restarted HA.
But now, the entity icon has not returned to the default icon. It is still the custom picture.
What have I done wrong?
It looks like the customization has been made permanently.
Thanks for your help
Yes, many times.
I tried a new browser that I never used to open an HA session and I have the same result.
If I check the Developer Tools/States, I see that an attribute: entity_picture: /local/battery-0.png
has been added, but not by me.
I have other battery level sensors and they don’t have an entity_picture attribute.
It should be either replaced after HA reboot or (if not rebooted) after first change of the entity’s state.
By you , but it is still there.
You do not need to remove it if you added it intentionally and still want the image to be shown.
But there is another point.
What was the reason you added the image?
This is a battery level sensor with a “device_class: battery” attribute which adds a dynamically changed icon.
When you add an entity picture, it will be shown instead of that icon. Not good imho.
@boheme61
In settings/devices&services/entities the icon shown for the sensor is the default one.
If I click on the sensor to get the history window, the icon shown for the sensor is the custom one (/local/battery-0.png)
@Ildar_Gabdullin
I think there is a misunderstanding.
My intention was to test the customization functionality.
I chose this sensor because I already had it defined in a card tile and was easy to monitor.
All I did was to add a customization in configuration.yaml :
As I said, the custom icon showed up only after many restarts and platform reboots. Since this was just a test, I removed the customization from configuration.yaml, but the custom icon wasn’t replaced by the default icon.
So I started investigating.
In Developer Tools/States, you can see the entities attributes. That’s where I noticed that a new attribute had been added to the sensor.
My understanding is that this attribute: entity_picture: /local/battery-0.png
is added to the sensor when added to the customize section in configuration.yaml and HA restarted.
Since I removed it from the customize section in configuration.yaml and HA restarted, shouldn’t this attribute be also removed from the entity?
@Ildar_Gabdullin
Hello again,
When I started writing my previous comment, the icon shown for the sensor was the custom icon. Now, the sensor icon is back to the default icon. I check in Developer Tools/States and I confirm that the entity_picture attribute has been removed.
I didn’t make any changes, HA didn’t restart or reboot. But I woke up my ipad.
Obviously, HA reboot doesn’t set or reset the customization.
But the first change of the entity’s state explains the behavior.
The sensor I modified is an ipad battery level.
This particular sensor doesn’t change it’s value when the ipad battery level changes. To get an updated value, the ipad must be in wake mode and the HA ios app must be active. Also, values are rounded to 5%, so 1% change doesn’t show up.
When I woke up my iPad, the sensor value went from 40% to 30% and thus the icon changed from custom to default.
The customization refresh behavior is a bit counter intuitive. I would assume that a simple yaml refresh would do the trick, but it seems that a state change is also required.
I guess we can close this issue.
Thanks for your help.
I do not think this is correct. HA reboot does reload integrations which causes a change of added “entity_picture”.
Same, reloading a particular integration will refresh entity_picture.
Imho you were too quick with marking the post as a “solution” (((. Why the attribute was not added after proper operations - needs to be found.
@Ildar_Gabdullin
Please let me disagree.
An HA reboot most probably reloads integrations, but I’m positive it doesn’t cause a change of added “entity_picture”. I had multiple HA reboots and the custom “entity_picture” remained in the list of sensor attributes until the iPad woke up.
If you’re not convinced, then I suggest you give it a try to see by yourself. You need the mobile integration to get the battery_level sensor and an iPad with the ios app. It’s probably the same for an iPhone, but I didn’t try it. I don’t know if it’s the same with Android because I don’t have android phone or tablet.
From my observations, the customized “identity_picture” is either added or removed upon state change. An HA reboot doesn’t seem to force a state change. In the case of this particular sensor, state change occurs when the iPad is awake, the ios HA app is active and the battery_level varies more than 5%.
So, from my point of view, this case is solved because it provides a good explanation of the customization refresh behavior.
Now, if this behavior is not appropriate, then feel free to open a bug report.
May be because a whole config entry for this device could not be updated since the device was unreachable.
This is not about me. In the post which you marked as a “solution” you claimed that “entity picture” is only updated after a state change. May be (let some core expert to say), but this usually happens on an integration reload. That means that a statement “HA reboot doesn’t set or reset the customization” is not correct.
… with partially wrong assumptions.
Since I found them incorrect - I suggested you to correct them.
This is something for you to decide, no one gonna register issues for another person.
After a while, I think this a probable explanation. On HA reboot (or even after a manual reload of a config entry), if the device is unreachable, it’s entities cannot be updated.
We can because we are editing data on a local entity_registry file. But getting data from an entity (with added attribute) seems to be different thing.
Ain’t the “added” attributes etc made in HA, and not on the Device ?
It Seems to me like it was updated, however the Card/View(or whatever) seemed first to be updated when his device came on, and changed the Status ( Then i guess the Entity was “Called/Pulled” to frontend/view with it’s “removed/changed” attributes )
No, frontend has an access to “states” object containing entities. If the objects is not updated (here - does not have the added property) then the frontend will not show it.