Insert smart switch as a third in two-way switch

Hi!

my bedroom is next to stairs with two-way switching on the stair-lights.

in my bedroom, next to the door is the main lightswitch for the overhead bulb in my room, it’s the only light in my room not controllable from home assistant. directly behind this switch on the wall outside my room is a single gang switch that is part of a 2-way setup controlling the stair-and-landing-lights also controlled at the other end of the steps.

i want to bring my overhead light into the HA fold… i could put a smart-bulb in the overhead and be done, but the existing bulb is a decent dimmable led, and i’m generally happier with smart switching of dumb fixtures anyway (except for neopixels, obvs).

i’m thinking that i can replace the single gang (UK no-neutral) dimmer switch in my bedroom with a 2 gang smart-switch with one gang controlling the bedroom overhead, and the other gang being a third way to the two-way system on the stairs, the switch for which is literally immediately behind my bedroom switch in a ~100mm plasterboard wall.

is this possible? what is the logic for adding a third switch to a 2-way setup?

thanks!

p.s.

For smarts switchs it really doesn’t matter. Setup for two way switch is to use one switch as a master and other as a slave switch. Master switch is the one that is physically controling the light and has L N L1 connected. Slave switch only has power so L and N are connected.
The only thing left to do is automation that will toggle switches on off when pressed.