Toggle lights with physical (no smart) switch via automation

My situation is as follows: in our house I have all smart lighting from Tradfri and innr via zigbee2mqtt. 3 of the smart lamps can be switched with a physical on/off switch (not smart, just power on and off).
Now I have tried to set up an automation so that when I turn off those 3 lights, several lights are also turned off, so this does not work. When I test it from the automation it works, but not when I use the physical switch. I think the status of the lights is the problem and they are not being detected as turned off. Is there anyone who has set up such automation or knows how I can best approach this? I think I’m overlooking something.

Neither ZHA or Z2M can detect your light has been powered off manually. What they do (but not by default on Z2M) is pinging regularly the device to see if it’s alive. If it’s not, the device will be marked unavailable, and your automation should work.

Bottom-line: you can reduce the time between checks so that the device is detected unavailable sooner, but a quick off-on will never work.

Of course its very logical, no power, no device visible. Thanks.

I actually have a similar use-case, but with dumb lights: I want to switch on/off smart lights if the dumb ones are switched on/off.

What I did is put an illuminance sensor just in front of the dumb ones. That way, I can detect if the lights are on/off and act upon it, with a reasonable delay due to the fact that those sensors only report big leaps with some delay.