I'm using an ESP8266 as an IOT device, with MQTT to send status messages.
Each device have its own availability topic, to state its online
or offline
state ( needed for Home Assistant
indication on web GUI )
Since multiple devices are present- I was wondering if a lastwill status can be sent for a joint topic to be monitored ( for example :"device_id:offline
" )
my relevant part of the code defining a lastwill for devices topic is : mqttClient.connect(deviceName, user, passw, availTopic, 0, true, "offline")
EDIT1:
using PubSubClient.h
offline
notification from all 10 devices ( a topic that will be saved as a log file ).