I had missed a " delay(100); " from the //PIR CODE but it uploaded and compiled ok…
I also edited *** SENSOR DEFINITIONS *** to
int pirValue1;
int pirStatus1;
String motionStatus1;
int pirValue2;
int pirStatus2;
String motionStatus2;
then changed the //PIRCODE to the below to property differentiate between the two PIRs…
//PIR1 CODE
pirValue1 = digitalRead(PIR1PIN); //read state of the
if (pirValue1 == LOW && pirStatus1 != 1) {
motionStatus1 = "standby";
sendState();
pirStatus1 = 1;
}
else if (pirValue1 == HIGH && pirStatus1 != 2) {
motionStatus1 = "motion detected";
sendState();
pirStatus1 = 2;
}
delay(100);
//PIR2 CODE
pirValue2 = digitalRead(PIR2PIN); //read state of the
if (pirValue2 == LOW && pirStatus2 != 1) {
motionStatus2 = "standby";
sendState();
pirStatus2 = 1;
}
else if (pirValue2 == HIGH && pirStatus2 != 2) {
motionStatus2 = "motion detected";
sendState();
pirStatus2 = 2;
}
delay(100);
Doesn’t seem to work though, only the PIR1 Motion 1 seems is working, PIR2 doesn’t change state at all. I’ve double checked all the config.yaml and all looks good… if I remove all the numbers from the //PIR code to keep them at pirValue/pirStatus then both sensors in HASS just keep continually cycling between standby and motion detected.
I think I’ll look into ESPEasy - this is giving me a headache!! Thanks for the help though!
@Sthope Think I finally got it working… changed the defined pins to 5 and 6 rather than 4 and 5 and it seems to be working now… Is there something special about PIN 4 that would stop it working?
Hello @boxgrove, glad you got it working. For debugging you can use the Arduino IDE console from there you can see if the message is being published by the ESP or if it is a yaml configuration fault.
I don’t know why PIN 4 isn’t working, the only problem I had was when I connected multiple sensors especially 5v and powered the ESP thought the PC some sensors wouldn’t work or they wouldn’t work properly
I have put this multisensor in homebridge (homekit) to use with Siri. The PIR Motion Sensor never show up in the homekit. Is there anyone use homekit and can add in all the 6 multisensor?
Another question from what I remember. I have put Mr.Bruh sensor as a sensor not binary_sensor, Do I have to change to binary_sensor as well or just create one more or just add the device_class in the sensor I already have?
I got every sensor work except the motion sensor from Mr.Bruh, I will try as you have mentioned this evening. Other motion sensors also avaiable in homebridge but not the motion sensor from Mr.Bruh.
Correct pin as earlier I use as sensor, show on frontend corretly with correct state standby or motion_detected.
I would like to get this motion sensor into homebridge, so the recommend on above posted told me to change from sensor to binary_sensor which show on frontend. The result show on frontend is “clear” / from entity id show result “off”
Even though I have wave my hand to let motion detect, nothing happen, no result change at all. Only state “clear”
That’s not an automation, it’s just how you set it up for HomeKit. I suggest you to check your configuration for another piece of code that might be causing issues.
I have try exactly like what you post. On frontend show clear and nothing change.
But the entity id of binary_sensor.kitchen_motion_sensor show off. There is no turn on/off