@_arthur_ Hi! Well, the actual problem I did not solve. It's not solvable the way Recalbox handles devices with Amiberry, I think. (I didn't try it, but probably also not for Dosbox... unless you use some libretro based Dosbox, I guess) They are not read form the Retroarch configs, but passed as runtime arguments when starting the game, probably in the order they were plugged in or detected on system start. From this list and order the Amiberry config is then generated on-the-fly. Device ids, names or anything like that is not taken into account. Just the order, which may be anything. (IIRC)
At least with Recalbox 8 or so this on-the-fly generating was fixed, so that the generate config at least makes sense now and shows proper device names. So at least you can change it now in the Amiberry GUI, everytime you start the game.
You could override it with custom uae files. It should work within the limitations. But again, only based on order. So you could store "device #3" as first controller. And it will be whatever the system figures out as #3. If you are lucky it's stable. If there is no #3, because it's not plugged in, well...