Lovelace UI reporting duplicate key in log

I have setup the Lovelace UI and it is working really well. Only issue is that my error log is reporting the following quite regularly

YAML file /config/ui-lovelace.yaml contains duplicate key “entity”. Check lines 549 and 554."
YAML file /config/ui-lovelace.yaml contains duplicate key “entity”. Check lines 521 and 526.
etc…

I have checked the config file and there are no duplicate entities at all.

Is this an error that others are seeing too?

Here is a screen shot of ui-lovelace.yaml showing lines 549 and 554
lovelace-error

OK, so I managed to sort out the error. I had copied a configuration from an example and it had entity: under the state_image. So the error reported did not relate to lines 549 and 554. The error was on lines 550 and 555. I was looking at the line numbers reported which was wrong.

I simply removed the second instance of entity: group.critical.devices on line 555 and no more errors being reported.

You may also run into issueswith state_image and image. Pick one or the other, don’t combine the two if you can. If the image doesn’t change based on the state, remove the whole state_image section. Or if you want to make it work based on the state, remove the image line.

Thank you Petro, great suggestion. I have commented out the image and have added the alternate image states to the state_image. It was working as I had it but I prefer your suggestion.

1 Like