Scanning DALI control gears
As you have found out, Command 269 Query Short Address only works if the gear is physically selected or the random address is equal to the search address, and only while the 15 minute initialise timer is running. This command is to be used during addressing. At other times, you can use any query which is sent using short addressed addressing to see if you get a response. Typically systems will use Command 145 Query Control Gear to see if there is a gear at that address. You may find it preferable to use Command 153 Query Device Type since you get a response that tells you more than whether there is a gear at that address, it tells you the type. Although there is Command 150 Query Missing Short Address, this would be no more useful in this situation than the other queries I mentioned if you sent it using short addressed mode, it is generally more useful in broadcast mode with only one gear on the line.

With any of these queries, you have to scan through all possible short addresses to see if you get a response. I would not recommend stopping as soon as you find a No because there is no requirement in DALI to keep the short addresses adjacent with no gaps.