net-daemon / integration

Helper integration for Home Assistant
https://netdaemon.xyz/
MIT License
5 stars 5 forks source link

Integration loosing my callback methods after some time #17

Open wojciechczyz opened 3 years ago

wojciechczyz commented 3 years ago

The problem

After few days my Home Assistant suddenly "looses" callbacks that were exposed by net-daemon intergration. I am exposing 4 methods such as:

[HomeAssistantServiceCall] public async Task OpenDoor1(dynamic data) {...}

they are working happilly dozen of times for few days and then they simply disappear. When trying to call them from my scripts I get:

Service not found for call_service at pos 1: Unable to find service netdaemon.mutuumairlockapp_opendoor1

When going to: Developer tools > Services

I stiill see: NetDaemon - Entity_Create NetDaemon - Entity_Remove NetDaemon - Entity_update NetDaemon - register_service NetDaemon - reload_apps

but my callbacks are gone.

Restarting NetDaemon docker container solves problem, till next time it occurs.

System health

System Health

version core-2021.5.0
installation_type Home Assistant Container
dev false
hassio false
docker true
virtualenv false
python_version 3.8.9
os_name Linux
os_version 4.19.118
arch aarch64
timezone Europe/Madrid
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Lovelace dashboards | 1 -- | -- resources | 0 views | 1 mode | yaml

Traceback/Error logs

Additional information

helto4real commented 3 years ago

Thank you for reporting. Do you think this happening when you are installing a new version of HA or restarting HA or does it "just stops working"?

wojciechczyz commented 3 years ago

Thank you for following up on this, sorry for delay, missed this message. This happens when HA is restarted, without restarting NetDaemon container. As soon as I restart also NetDaemon, it reconnects to HA and then my netdaemon service is back.

Is there some bidirectional pinging mechanism in place that makes sure both parties sees each other? Cheers!

wojciechczyz commented 3 years ago

Now this error happens more frequent, as netdaemon is installed on one machine and Home Assistant on another one. For one reason or another they are getting out of sync much more frequently now

helto4real commented 3 years ago

Can you point to your code for the app. If you do not want it public, ping me privately. Thanks.