Help with dimming light automation in combination with Apple Scene

Hi all, I need a helping hand with a light automation. I cannot figger out how to automate the feature I want.

I have to lights, let’s say Light A and Light B. If I turn on Light A, I want Light B to dim to 30%. If I turn off Light A, I want Light B to dim to 100%. So far nothing complex.
I also have a Apple scene to turn off all lights at my home at the same time. And here it comes. If Light A is on and Light B is dimmed to 30% and when I activate the Apple scene, all lights turn off and Light B dims to 100%, instead of turning off…
What I do want is that all light turn off, including Light B.

Can anybody help me solving this issue? Much appreciated!

Unfortunately no response yet. In the meantime I was thinking. Is it possible to determine which device (Homepod or Hassio) triggered the event?
That would be a great help…