The router is configured as a WireGuard client.
At the moment, the router has access to the Internet with or without WireGuard. OpenWrt clients, like OpenWrt itself, get an IP address from the main router, which is fine for me. I would like that when the WireGuard interface is turned on, all Wi-Fi OpenWrt clients work through WireGuard, and the clients connected via the wire remain as they are. Please help me achieve this, I myself am not strong in networks and to be honest, there is simply no time
P.S. The WireGuard server uses Unbound (DNS server).
Despite this probably beeing highly complicated to implement, I see a problem with the OpenWrt only beeing the access point and a switch. Also you want to just route the WiFi clients and the clients get their IP via DHCP which isn't your OpenWrt device.
On top of that the wireguard tunnel isn't enabled all the time?
It is necessary to have the OpenWrt as gateway for the clients. Then you can control if they will use the WG or the ISP. This means you'll turn of dhcp server on ISP router and enable it on OpenWrt.
The main thing for me is that from any device on my local network, I can access any other device on the same network.
It is not necessary for the main router to provide addresses, but it is desirable. If this makes the task easier, then all the devices of the router can have addresses like 192.168.2. *.
It's not different from what I told you already. Everything is bridged so lan and wifi are in the same broadcast domain and every device will get settings from OpenWrt DHCP server.
If you want to route the wifi clients separately from the wired ones, you'll need to unbridge the wifi from the ethernet. They are currently bridged together as br_lan, the default OpenWrt config.
Once you have these separated, you'll be able to create a new firewall zone and place the wifi in it. Then you can set up zone forwardings to route this through the wireguard tunnel.
I don't see how this can work with everything getting ip addresses from the main router. That requires everything to be on the same broadcast domain, which runs counter to having separate routing. I would set up a dhcp server on the wifi interface to look after the wifi clients.
I would also say this is the only possible solution. If the WiFi clients don't need access on LAN devices you can just route the whole traffic through the wireguard tunnel.