Is there any command for listing all devices attached to RPI(light bulbs, buzzers, USB-s, etc.)?
If there is no that command, how can I check it?
For USB devices you can use lsusb. It should be installed by default in your Pi - if not do:
sudo apt-get update sudo apt-get install usbutils
later you can run the command lsusb and you should see all the devices connected via USB
No, there is no such command.
You will have to look at the Pi to see what is connected.