Devices not affected when targeting an area from a bluprint

I have a blueprint that creates an automation for an IKEA remote. When executed, it’s supposed to turn off all lights in certain areas.
However, a couple of those lights stay unaffected when the automation runs even though the HA user interface clearly shows that they are assigned to said areas.
I have tried removing and re-adding them to their area, and even recreated the whole area, without any improvement.
Now I’m out of clues on how to proceed.

It should be noted that if I add the lights as “entities” (“device” won’t work), then I can finally address them. But that’s not how it’s supposed to work, because all the other lights assigned to various areas behave as expected…
Am I really the first to experience this, or do I just suck at searching or using the proper keywords? :cry:

Well ill give you another thing to think about.

Don’t use devices.

If you replace an entity and use the same name on the new entity yojr automation will continue unchanged.

Devices do not survive replacement so if you use device you will need to edit your automation if you replace the device.

For this reason it’s STRONGLY recommended you don’t use devices unless an entity is not available for the thing you want to manipulate.

So while I get ya. You probably don’t want to go that way.