MQTT status problems

I’m integrate my device to HA via mqtt, when i’m connect to broker and subscribe to receive HA status (homeassistant/status), i’m immediately receive ‘offline’. If restart HA, then receive offline, then online.

As far as i understand, offline mqtt message send to broker with Retain flag, but online message with out. As result - after connect to broker and subscribe to topic, i’m receive offline message. Where i can provide that bug?

MQTT Birth and Last will - Home Assistant — that’s not help.

The log looks like:
homeassistant/status offline
homeassistant/sensor/0x00158d0006d4ded6/battery/config {“availability”:[{“topic”:“zigbee2mqtt/bridge/state”},{“topic”:“zigbee2mqtt/Button_GardenLights/availability”}],"availability_
homeassistant/sensor/0x00158d0006d4ded6/voltage/config {“availability”:[{“topic”:“zigbee2mqtt/bridge/state”},{“topic”:“zigbee2mqtt/Button_GardenLights/availability”}],"availability_
homeassistant/sensor/0x00158d0006d4ded6/action/config {“availability”:[{“topic”:“zigbee2mqtt/bridge/state”},{“topic”:“zigbee2mqtt/Button_GardenLights/availability”}],"availability_m

MQTT Discovery config messages should be with retain flag. If this is all you send to the broker, your MQTT config is incomplete. Check the provided link to the documentation to verify that your MQTT Discovery has all needed info.

I’m only subscribe to homeassistant/status, after that, i’m receive status from mqtt brocker (mosquito, installed on separate server), that status offline. That’s be only on subscribe, if after that i’m restart home assistant, that my software receive offline and then HA up - online.