Automation triggered in Off mode


I created an automation for the camera and camera alarm to switch on when the front or back door is opened. Offcourse i only want this to work in Home or Away mode, but the camera and camera alarm also activate when in Off mode wich is very inconvenient when i am at home and i have to open the door to take out the trash for example.

Does anyone know how to fix this?