RF transmitter and reciver

I am creating something like a key finder on my arduino. I plan to push a button turning on the transmitter. The receiver will connect to a second arduino which will have a if x >y statement. When the transmitter is on this statement should turn on a buzzer. I feel as though this code makes logical sense however all the research I've done on RF transmitting with arduinos always are very complex and include the TX and RX slots. I am new to this and only roughly understand their function so would prefer to stay away from them. Can anyone tell me if a normal analog imput will work for just telling an arduino if the transmitter is on? And if so does the rest of the code sound alright?

TRANSMITTER
const int switchPin = 2
const int rftransPin = 8

int switchState = 0

void setup() {
// put your setup code here, to run once:
pinMode(switchPin, INPUT);
pinMode(rftransPin, OUTPUT);
}

void loop() {
// put your main code here, to run repeatedly:
switchState = digitalRead(SwitchPin);
if (switchState == HIGH) {
digitalWrite(rftransPin, HIGH);
}
else {
digitalWrite(rftransPin, LOW);

Reciver
const int buzzerPin = 2
const int rfrecPin = A1

int rfrecState = 0

void setup() {
pinMode(buzzerPin, OUTPUT);
}

void loop() {
rfrecValue = analogRead(rfrecPin);

if(rfrecValue > 150)
digitalWrite(buzzerPin, HIGH);
if(rfrecValue < 150)
digitalWrite(buzzerPin, LOW);

There are probably 100 different RF devices around, so it would help to know
what you're using.

RF modules with RX and TX have a chip that handles the protocol.
The very cheap RF transmitters modules can only switch the transmitter on and off.

I guess you have a very cheap 433MHz RF module.

The output pin of the receiver module does not reflect the signal strength. You have to hack the circuit to find the signal strength (find the capacitor for the automatic gain control).

For these cheap modules, switching it on and off can not be detected by the receiver, due to the agc (automatic gain control). You have to use a software protocol. The VirtualWire is (the only) good library for that, VirtualWire: VirtualWire library for Arduino and other boards

Or these: