Get entries based on custom field lightswitch in custom plugin in Craft 2
You need to set the value of your Lightswitch field directly instead of using the relatedTo parameter

$criteria-&gt;lightswitchFieldHandle = '1';