const states = global.get('homeassistant.homeAssistant.states') const deliveryMode = states['input_boolean.delivery_mode'].state const detect = msg.detect node.send([null,msg]) if (detect === 'motion' && deliveryMode === 'on') { node.status({fill:"green",shape:"dot",text:"Motion/Delivery"}) node.send([msg,null]) } else { node.status({fill:"green",shape:"dot",text:"Not Motion"}) }