Help!I add an entity by REST API,but it disappear when I restart the HA

Has anyone encountered this problem?

This is not a problem. It is expected behaviour.

As you created the entity with yaml you will have to manage any changes using yaml rather than by using the graphical user interface.

What makes you think it “disappeared”?

It should still be in the Developer Tools States list.

Your title and the image don’t seem to be related.

The “warning” you get here only tells you, that the entity generated doesn’t have a unique id and can therefore npt be edited from the UI. It should still work as intented, but you won’t be able to change entity id or similar from the UI.

i can’t find this in the Developer Tools States list when i restart the HA

Then there will be a log error

Go to your profile and enable Advanced Mode. The Developer Tools should be in the left hand menu. I don’t think you have to restart for them to appear.