Connecting to entities in a plugin

Did you manage to solve it? I have a similar problem