It keeps disconnecting

I keep disconnecting from homeassistant, I have to disable and then re-enable the integration and then it reconnects. What can it depend on?