Custom light switch to combine Sonoff and Wemo commands

I used to just have Wemo bulbs installed but they were a real pain because when turned off at the wall switch, they go offline and fail to be “smart”. So I wired up Sonoff basics to control the circuits they’re on. Now I have smart lights that thanks to GPIO14 also can be toggled from the wall switch - Great.
But if I want to control the dimming capabilities of the globes I need to access a different entity.
What I would love to do is have a custom light switch where the HA switch is talking to the sonoff. And the sliding dimmer control talks to the Wemo bulb. So from the grab pasted below, one part controls the sonoff and the other part controls the Wemo.


Is this possible?

Oh, the dimmer would need to just disapear when power to the circuit is off, Don’t want an unavailable message or error appearing in this situation.

If it is possible - could somebody offer some clues please?

Sorry for my dumb question. I am now into the world of Lovelace and custom cards. This link helped me achieve what I wanted…