Running Appdaemon in Docker

Hi
I’m trying to run AppDaemon in a docker instance.

When trying to get the current value of a sensor

current_temp = float(self.get_state(mysensor))

the response is Entity sensor.***** not found in namespace default
but If I call it with

            response = requests.get(
                f"{ha_url}/api/states/{mysensor}", 
                headers={
                    "Authorization": f"Bearer {ha_token}",
                    "Content-Type": "application/json"
                },
                timeout=10,
                verify=False
            )

I’m getting a valid response

The question is, why does not work the normal way for me?
Is it a firewall issue o something like that?

Thanks for your time