Send location and extended data on reconnect
This is an enhancement request:
OwnTracks does a good job of detecting when a connection to the MQTT broker has been lost (e.g. through a network change), and establishes a new connection quickly.
It would be helpful if, immediately after a new broker connection is made, the current location and extended data (if selected) were transmitted. This would allow for detecting the change of WiFi state for example, as well as triggering a remote config change.
My use case is to switch off monitoring when connected to home or work WiFi, and to switch to move monitoring when disconnected from WiFi. At the moment, even though OwnTracks handles the WiFi disconnection quickly, I cannot remote switch monitoring modes until I hear from the app that the WiFi is disconnected. I realise that this can be achieved with Tasker, but I would prefer not having the additional complexity of keeping Tasker alive and working when OwnTracks could achieve the same result without it.
App: 2.4.6 Android: 11 Device: Samsun A51 Installation source: Google Play
Seems reasonable. Not everyone would want it (I use a broker that aggressively FIN's the connection if it doesn't get a keepalive in 60s, so I get lots of reconnects), but can put behind a toggle.
It's only really relavent in MQTT mode, so would just need to figure out how / where to put that in the UI.
Fair point, which I hadn't considered. I am using mosquitto which, I believe, also closes connections if keep alive is not every 60s. Nevertheless, if it isn't too much hassle, it would be worth trying.
Just thinking about the detection for this. If your actual aim is to get a message pinged when the network condition changes (e.g. Wifi), would it be better to trigger it off that, rather than using the MQTT transport as a proxy? That would then be relavent to HTTP users too.
That makes sense. So my use case is, when a change of Wifi connection is detected an update is sent to the server. Node-red then triggers a config change (e.g. manual to significant changes monitoring) through remote config.
Closed in #1273