Person YAML

Hi folks,

wher do I find the comfiguration YAML including person and user-dates?

In your configuration folder.

Person can be set up in the UI or YAML.

Sorry you misunderstood me
I want to edit people who have already been created in the UI and cannot find the YAML entries for them.
Where are they?

I guess persons are in the .storage folder
The UI is not writing in to yaml

am I able to edit them somehow?

Storage entries are not meant to be edited. They are in JSON format in a hidden folder.

Click on the Configuration tab and go to “People”. You can change anything you need to there.

1 Like

How to delete an assigned picture there? Not replace, but complete delete?

Ah. I’ve never tried to do that! That does seem to be an oversight in the UI.
Just delete the person, then recreate them without the picture.

I’m running Home Assistant 2021.11.4 and I have a “Close” button right next to the picture. When I click it, the picture is removed.

If you click the Close button, then Update at the bottom, and return to the main config view - is the image gone? It is not for me. I’m on 2021.11.5. I can also confirm that closing the picture does not edit the storage entry for the person.

I’m going to assume this is intentional since the button is “Close” and not “Delete”.

Ok, I did not try to actually update the person when I was testing this. I’m pretty sure this is not intentional. There should definitely be a way to remove the picture. We should probably raise an issue here GitHub - home-assistant/frontend: Frontend for Home Assistant

Agreed! I don’t think this is really a “bug” though, just an oversight. Perhaps a Feature Request here on the forums would be a more appropriate venue?

I’ve been playing with it for the last hour and it’s definitely a bug, I just can’t find where it is.
For example, try this: start editing a user that has no profile picture. Upload a picture and then click the Cancel Close button. No picture is shown in the form. Click update. The picture you uploaded still gets assigned to the user. So the Cancel Close button is completely useless.
I will file an issue shortly.

This works as expected for me. The image is not changed if I click cancel, the original image remains. The new one is not even uploaded to the image directory.

However, here is a couple of more data points for you if you’re going to create an issue.

  • If you get to the point where upload/crop an image, but don’t click update and just close the dialogue, the person entity is not updated as expected - but the image remains in the image folder.
  • There is no way to select existing images in the image folder. You must always upload a new one, which would be fine I guess, - if old images were deleted.
  • Because the file extensions are stripped from the original image, there is no way to easily see what the images are (I know I always use PNG so I can just add the PNG extension to see which images they are.) Also fine, if images are deleted.

I guess what I’m saying is, if an person image is replaced, the old one should be deleted. And yes, there should definitely be a way to delete the existing image also.

Sorry, I accidentally wrote Cancel when I meant to write Close (the button next to the selected picture).
Steps to reproduce the issue:

  1. Go to Configuration > People and click on Add person.
  2. In the pop-up form, click on picture and upload one (click on Crop in the popup). Also give the person a name.
  3. Click on Close next to the uploaded picture. See it disappear.
  4. Click on Create.
  5. In the list of people, observe that the newly created person has the profile picture you uploaded while the form was showing no picture when you clicked Create.

The button label is Close. Honestly, I think it just hides the picture in the Person edit dialogue. I don’t think it is supposed to delete or remove the picture. If I had to hazard a guess, the mechanism to delete the people images simply does not exist yet. It’s likely in the low priority section on someone’s TODO list.

It is probably called Close because it is “inherited” all the way from frontend/ha-file-upload.ts at 01049e8eb81181ffa2cc354c29f2d542e1bde0e3 · home-assistant/frontend · GitHub. It does fire a change event when clicked and frontend/dialog-person-detail.ts at 01049e8eb81181ffa2cc354c29f2d542e1bde0e3 · home-assistant/frontend · GitHub seems like it should be able to handle this._picture=null because that is the default value. I don’t think this would be hard to fix. That’s without deleting the uploaded files, though.

I see when you “close” the current picture it does give you the option to select a replacement.

Just quickly going by the tooltip text the “X” icons, on the device tracker section says Clear and it does exactly that. It clears the entry. The tooltip on the both the main dialogue and the picture section say Close. And that is what they do, they close the element. Personally, I would have expected the one beside the picture to at least clear the image from the profile (if not actually delete it too) but obviously it does not. Admittedly I’m not super familiar with all the nuts and bolts here so I’ll have to leave it at that.

If you do file an issue please post a link to it here - I now find myself overly invested in this issue and want to see how it plays out! :slight_smile:

It is already. But until now without any reaction.

2 Likes

That issue was raised in core instead of frontend, that’s why I couldn’t find it. I don’t think this is a core problem though. We should probably still raise a new one in frontend and just link the one from core.

1 Like