Tagged VLANS on Unifi 6 Lite AP

So I want to setup 3 tagged vlans on my unify 6 lite. The vlans connects to opnsense which handle the dhcp part.

I have guestnet on vlan 20
home on vlan 30
automation on vlan 40

I have tried create the vlans on devices. Base device set to eth0.
And then connect them to 3 separate bridge devices.
br-guest
br-home
br-automation

Then I have 3 Interfaces setting the br as device. for example automation:
Device: br-automation
IP address
192.168.4.2
IPv4 netmask
255.255.255.0
IPv4 gateway
192.168.4.1
IPv4 broadcast
192.168.4.0

Then I have created 3 different wireless networks which connects the different bridges.
guestnet
home
automation

Now when I try to connect to the wireless network I don't get any ip address, only way to connect is to set a static ip on my pc when connecting. Then I can connect to the AP but nothing else.

I would guess my problem is that the vlans is not tagged. Since there is no switch I can't figure out how to do it.

Here are the config with only automation setup

config interface 'loopback'                    
        option device 'lo'                     
        option proto 'static'                  
        option ipaddr '127.0.0.1'              
        option netmask '255.0.0.0'             
                                               
config globals 'globals'                       
        option packet_steering '1'             
        option ula_prefix 'fded:4269:0f39::/48'
                                      
config device                         
        option name 'br-lan'          
        option type 'bridge'          
        list ports 'lan'              
                                      
config interface 'lan'                
        option device 'br-lan'        
        option proto 'static'         
        option ipaddr '192.168.1.1'   
        option netmask '255.255.255.0'
        option ip6assign '60'  

config device                                                                   
        option type '8021q'                                                     
        option ifname 'lan'                                                     
        option vid '40'                                                         
        option name 'lan.40'                                                    
                                                                                
config device                                                                   
        option type 'bridge'                                                    
        option name 'br-automation'                                             
        list ports 'lan.40'                                                     
                                                                                
config interface 'automation'                                                   
        option proto 'static'                                                   
        option device 'br-automation'                                           
        option ipaddr '192.168.4.2'                                             
        option netmask '255.255.255.0'                                          
        option gateway '192.168.4.1'                                            
        option broadcast '192.168.4.0'    

Oh I got it to work, instead of putting eth0 I put lan as device in vlan

Yes, there's nothing special about the network config on the U6 Lite. It's a DSA config like any other DSA device.

Except for the extremely confusing fact there is only one port on the switch (except for the CPU) and it is named "lan". So you end up with both the Linux netdev representing the DSA port and the OpenWrt interface created on top of it having the same name. Which the brain can almost accept as long as they are "the same". But they're not anymore when you add tagging to the port.