I dug into the channel numbering / ordering issue a little further, and have come to the conclusion that this is more of a vbox issue rather than an issue with kodi or the addon.
The vbox does not send the channel numbers anywhere in the xml of the API call, so kodi has nothing to work with.
Kodi really needs channel numbers to be able to order the list of channels correctly, as the option to use the backend channel ordering doesn't work well where two channels have the same number. This is where the problem lies - because the vbox returns the channel number as 0 for most channels, though other channels have a completely random number. Where two channels have the same number then kodi will order those channels alphabetically, regardless of your "use backend channel order" option.
Here is an example of the content coming back from my vbox in the API call:
Code:
<channel id="www.BBC%20One%20Yorkshire.co.un">
<display-name>BBC One Yorkshire</display-name>
<display-name>TV</display-name>
<display-name>002007ff1933</display-name>
<display-name>Free</display-name>
<icon src="http://192.168.0.166:55555/images/tv_icon.jpg"/>
<url src="http://192.168.0.166:55555/BBC%20One%20Yorkshire"/>
</channel>
<channel id="www.BBC%20Two%20England.co.un">
<display-name>BBC Two England</display-name>
<display-name>TV</display-name>
<display-name>002007fd189e</display-name>
<display-name>Free</display-name>
<icon src="http://192.168.0.166:55555/images/tv_icon.jpg"/>
<url src="http://192.168.0.166:55555/BBC%20Two%20England"/>
</channel>
<channel id="www.ITV%20Yorkshire.co.un">
<display-name>ITV Yorkshire</display-name>
<display-name>TV</display-name>
<display-name>0020080527b0</display-name>
<display-name>Free</display-name>
<icon src="http://192.168.0.166:55555/images/tv_icon.jpg"/>
<url src="http://192.168.0.166:55555/ITV%20Yorkshire"/>
</channel>
<channel id="www.Channel%204_3.co.un">
<display-name>Channel 4</display-name>
<display-name>TV</display-name>
<display-name>002007f923fe</display-name>
<display-name>Free</display-name>
<display-name>10238</display-name>
<icon src="http://192.168.0.166:55555/images/tv_icon.jpg"/>
<url src="http://192.168.0.166:55555/Channel%204_3"/>
</channel>
In this example BBC One, BBC Two and ITV are all given a channel number of 0, and Channel 4 is given a channel number of 10238. Though in the vbox backend I numbered these channels as 1,2,3 & 4. It seems that if a 5th display-name attribute is present then the vbox plugin uses this, otherwise it uses 0 as the channel number. I think what the vbox sometimes sends in the 5th display name attribute is possibly the freesat frequency - but it certainly isn't the channel number
I thought of a workaround to this, whereby an extra option is added to the addon "Set channel numbers using backend channel order". When checked, this option will simply use a counter, and as channels are added it will increase the channel number by one, rather than using the completely meaningless channel numbers returned by the vbox.
As I have 3 different kodi devices it actually ended up quicker to write a workaround in the addon, than go round each device and manually order the 130+ channels within kodi ;-)
I have already coded this and tested it successfully, so will submit a pull request for it to be included in a future release.
This is very much a workaround to the shortcomings of the vbox api, and it's obviously not going to give you the correct channel numbers if you like to have gaps in your channel numbering. But if you have all the channel numbers sequential, with no gaps then the channel numbers will come out nicely.