Device add by mqtt but not online

  • When registering a device using mqtt, the device appears offline and cannot update its status


{
	"command_topic":"homeassistant/light/moorgen-light/switch",
    "state_topic":"homeassistant/light/moorgen-light/state",
	"brightness_command_topic":"homeassistant/light/moorgen-light/brightness_set",
	"brightness_state_topic":"homeassistant/light/moorgen-light/brightness_status",
	"availability_topic":"homeassistant/light/moorgen-light/availability",
	"brightness_scale":100,
	"name":"moorgen-light",
	"unique_id":"moorgen-light",
	"brightness_value_template":"{{value_json.brightness}}",
	"device":
	{
		"model":"model",
		"hw_version":"1",
		"sw_version":"1",
		"manufacturer":"摩根",
		"identifiers":"moorgen"
	},
	"availability_mode":"any",
	"retain":true,
	"payload_available":"online",
	"payload_on":1
}

send this message not work

The topic should be "online", not the dictionary you have supplied.

not change still