MQTT device availability | not getting "unavailable” when offline | mosquitto

MQTT device availability | not getting "unavailable” when offline

I want to know when my extern OpenWrt Router (connected over VPN) is not available anymore:
I thought the easiest method would be an MQTT device with LWT (last will testament):

[this good topic] (How do I set MQTT device to "unavailable state" when it has gone offline? - #2 by tom_l)

I have tested it with an Ubuntu LXC container (instead with OpenWrt) with mosquitoo:

mosquitto_pub -r -h 10.xxx -i "Workshop" -u "…" -P "…" -p 1883 -t 'homeassistant/sensor/workshop/config' -m '{"name":"WorkshopAlive","unique_id":"workshop_alive","ent_cat":"diagnostic","stat_t":"workshop/alive","avty_t":"workshop/state","device":{"identifiers":["workshop"….}}

So I can change the availability state by sending the second command “online” / “offline” and everything works fine :wink:

mosquitto_pub -h 10.xxx -i "Workshop" -u "…" -P "…" -p 1883  -m 'online' -t 'workshop/state' -q 2 -k 20 --will-payload 'offline' --will-qos 2 --will-retain --will-topic 'workshop/state'

But usually when the broker does not receive an answer after 20 sec (I have set in HA mosquitto broker settings or at least 60 sec) it should send the LWT to the will-topic and HA should set “unavailable”.
→ Unfortunately this does not work, even when I shutdown the lxc container completely and not running for couple of hours!

(By the way, that works with my esp32 flashed with my own coding not ESPHOME.)

Well I have tested a couple of things now:

mosquitto_pub -h 10.x.x.x -i "Workshop" -u "xxx" -P "xxx" -p 1883 -m 'online' -t "workshop/state" -q 2 --will-topic "workshop/state" --will-payload "offline" --will-retain --will-qos 2 -d`

So all my LWT (last will testament) are not handled by the broker for this command.
I do not get any error when I publish it also any subscriber does not receive this last will.
→ so the broker is not sending it

Client Workshop sending CONNECT
Client Workshop received CONNACK (0)
Client Workshop sending PUBLISH (d0, q2, r0, m1, 'workshop/state', ... (6 bytes))
Client Workshop received PUBREC (Mid: 1)
Client Workshop sending PUBREL (m1)
Client Workshop received PUBCOMP (Mid: 1, RC:0)
Client Workshop sending DISCONNECT

Where can I find the broker log file of HomeAssistant “Mosquitto broker version 6.2.1” Add-on?
I have installed completely HAOS running on a vm. Also I want to change the org config file. (This web interface is not enough…)