If you use the MQTT on/off status feature that released in 1.7.0 you can have Home Assistant do this tracking for you with an MQTT Binary Sensor. See the
wiki for
an example of how to set one of those up.
Sending the object detected and percentage in the Telegram message is easy, there's a "caption" property on the sendPhoto command. Just put whatever text you want in there. To convert the list of prediction objects in the MQTT message to a nice string for display you can do
something like this in a function node:
JavaScript:
predictions
.map(prediction => {
return `${prediction.label} (${(prediction.confidence * 100).toFixed(0)}%)`;
})
.join(", ");
Alternatively I'll have an official release out today or tomorrow that supports mustache templates in the trigger configuration so you'll be able to just include {{formattedPredictions}} in your MQTT payload directly if you wish. To play with this support now you can install the :dev tag image from Docker Hub, although there's no documentation on the mustache properties yet!