How to remove orphaned entities

I’m not sure if this topic is more related to z-wave or general (if general, please guide me where to post it).

I recently did some changes in my z-wave devices (i.e. removed a dead node or re-included other one) and found, that I have some orphaned entities not related to any existing device. I see these entities on the lovelace dashboard, but when I click on them to go to the settings and remove, I have following information: " This entity (‘binary_sensor.drzwiwejscie_access_control_window_door_is_open’) does not have a unique ID, therefore its settings cannot be managed from the UI. See the documentation for more detail."

When I go to the “related devices” tab, it is just empty:

I can see that device in the settings → devices&services → entities section, but they are greyed and reported as read-only, so I can’t do anything with them. They are doubled with ones created during re-inclusion of the sensor. The integration in their case is no longer Z-wave, but button, senor, etc.

How to get rid of those orphaned entities?