How to retrieve Sensor Id based on sensor name

Hello,
I’m implementing evolution for a custom component https://github.com/jugla/worldtidesinfocustom

I use the fonction async_track_state_change_event in order to generate an update of sensor based on another one.
I assume that name given to async_track_state_change_event is anough. Unfortunately it can happen that 2 entities gets the same name and HA will gives a suffix “_i” (i = 2…N).
Please how to retrieve all entities IDs based on a name ?

Thanks in advance

hereafter a solution, where I want to fetch a sensor thanks to its unique_id

from homeassistant.helpers.entity_registry import async_get_registry
...
        registry = await async_get_registry(self.hass)
        entity_id_main_sensor = registry.async_get_entity_id("sensor",DOMAIN,unique_id_of_main_sensor)