Open PovilasID opened 2 years ago
Hi @PovilasID , I found that you also forked your repo from the same source as me. I also find similar issue and fixed it in my repo. You are welcome to back port any changes you find useful: https://github.com/AlexXZero/Tapo-P110-Prometheus-Exporter/tree/master Also you can ask me any extra questions e.g. I can provide you my grafana configuration or my docker compose configuration. I didn't add them into the repo since I used a few types of smart plugs (kasa hs110 and tapo P110 in the same grafana dashboard).
@AlexXZero Cool! I have gotten a pull request that probably fixed it https://github.com/PovilasID/P110-Exporter/pull/2 not sure though will need to test it :) In general I think this exporter needs to migrate to a different python lib for tapo devices because this one is not well supported...
@PovilasID I saw your fix, but I'm not sure if it is the best solution, since it adds reconnection only during initialisation, but I found that it would be good to allow reconnect to the device in runtime, e.g. sometimes I need to move the smartplug from one room to another, then it will lost connection and it need to reestablish it. So I would suggest to not try to reconnect in initialisation (just try to connect once), then in getter data check if connection is not established, then try to reconnect. (There is example how I did it in my fork: https://github.com/AlexXZero/Tapo-P110-Prometheus-Exporter/commit/1ad6f6c90375151e3c3c5b62c7963bad58ee52e5)
In terms of migration to another python library, I also would like to do it, but now I don't have enough time to sorted out with a new library API, so I just found fixed version of PyP100 library which supports a new protocol and use it. But I would be interested to backport migration to another library in case if someone has been done it before me.
Hey,
So I noticed that after I disconnect P110 and reconnect it somewhere it exporter does not resume sending data but gets stuck in exception loop:
I think after timeout it should running a login script to reestablish a session. Restarting service works.