I’ve flashed the DualR3 with ESPHome, and have it wired up with a conventional on-off light-switch on one input, and a 240V PIR sensor output on the other input. The light switch input/etc works perfectly. For the PIR I have problems:
I can hear an internal relay trigger in the PIR sensor when motion is detected, and the Sonoff triggers, and I can measure 240V on the Sonoff input at that moment. All good!
BUT, when the PIR stops detecting, the Sonoff switches off (good!), but then fluctuates constantly between on and off (BAD!) - every second or so it switches on or off.
As far as I can tell & measure, the PIR’s output voltage doesn’t drop from 240V to 0V, but instead drops to around 0.69V and then fluctuates around 0.69V-0.70V. I’m guessing the Sonoff doesn’t like this and interprets those tiny fluctuations as on/off triggers? I’ve tried the same PIR sensor with a Shelly device and the Shelly just stays on - it considers 240V and 0.69V both as “on” and so never sees an “off” signal on its input. I have two of the same PIR sensors and they both behave in the same way, which I guess would work fine if they were wired directly to a lamp, but not to the Sonoff/Shelly.
Does this problem make sense? What are my options for getting this PIR sensor to correctly trigger the Sonoff?
I could I suppose put another relay on the PIR’s output?
Or put a diode in line to attempt to drop the 0.69V to 0V, but hardly change the 240V?
Are there any settings in ESPHome itself that could make the Sonoff device better understand that I want any tiny voltage to be considered zero?
Here’s a snippet of my current ESPhome code (on_press/release actions commented out to avoid my lights switching on/off continuously):
Thanks - that’s very helpful. The PIR itself is this device “SEBSON Mini PIR Sensor Indoor, Ceiling Flush Mounted for Installation” (not sure I’m allowed to post amazon links here, but available there). It doesn’t come with much useful information unfortunately.
Operating voltage: 220-240V AC 50/60Hz
Max. Power consumption: max. 800W with usual lamps
max. 200W with LED and energy saving lamps
Power consumption on standby: 0,5W
Detection speed: 0,6-1,5m/s
Detection range: Max. 6m (<24°C)/360°
Max. 6m (<24°C)/120°
Ambient brightness: 10/2.000LUX
Protection: IP20
Switch-off delay: 5 or 30sec, 1, 3, 5 or 8min
Ambient temperature: -20° to +40°C
Humidity: <93%
Switch dimensions: 56x37x26mm
Sensor dimensions: Ø18x25mm
Sensor mounting hole: 16mm
Housing material: Plastic
That Ikea style manual doesn’t give me an idea of the circuit. I’t’ switching L.
Anyway, it’s clear that the output is designed to drive a load (like lamp), so adding a relay there between likely works.
Ok, I’ll try that (thank you!). Agree the manual is fairly useless… Is there anything useful I could try to measure which might help understand things better? (I get your point about no load…). Or indeed anything I should try in ESPHome/yaml to investigate further…?
Amazon links are OK if they are not affiliate or tracking, so paste the link but delete the first question mark and anything after it in the link. it should still work.
Beyond your PIR, I’m not familiar of DualR3 circuit either. On Shelly L is connected to logic GND and your yaml should be valid for that.
You could post your wiring.
So you have dry contact relay on the PIR device switching L.
Also Dual R3 has L side switches, so in theory it should work.
And if Dual R3 has L tied to logic GND (like shelly has) your code looks correct as well.
So I would connect a 240V bulb in parallel with the SW. So when PIR relay closes the contact it turns on the bulb AND triggers Dual R3. Just to have some load (required) on the relay contact and also as practical indicator for debugging.
Thank you - I will try that right away. Here is my current test wiring setup on my desk with Shelly (and similar downstairs where I have installed the Sonoff).
Ok - so I’ve just tried your excellent suggestion of putting the bulb in parallel with the SW, exactly as you’ve drawn. Now when the PIR triggers the bulb is on very brightly.
But when the PIR is un-triggered, the bulb is still on (fairly dim)!! So something is bad.
If I remove the Shelly from the circuit entirely (i.e. disconnected the red-wire from bulb to SW input) in your diagram, then the bulb does properly turn fully off.
So it seems like I’m doing something wrong here with my Shelly (and Sonoff) wiring perhaps?
Difficult to answer without having Shelly complete schematics. Also I suspect you really verified your L and N somehow.
Do you have resistors in range of ~330/470/680 kilo-ohm?
Putting a 680k resistor in series before the SW-Shelly-input now “works” - in the sense that both (a) the parallel bulb is either fully on or fully off, (b) the Shelly does actually detect the PIR on/off state (albeit reversed - but easy to adjust that in settings). (c) if I add another bulb to the Shelly output, I can correctly have the Shelly trigger that bulb as well as the one in parallel…
So massive thank you!! I’ll try this out with the Sonoff now.
For sure - I have now removed the lamp in parallel (and all still works fine)… Just wanted to check one step at a time! Thank you for your help - excellent suggestions for how to debug this further, and now resolve it.
Uploading picture of the final solution for Shelly 1gen3, for clarity for anyone who reads this later. Unfortunately this solution does not work for my Sonoff DualR3, which is the device I actually need to use in this case.
Ok, looks like I spoke too soon. The above resistor-solution works perfectly with my Shelly-1gen3. However it still doesn’t work at all properly with the Sonoff dualR3.
With a bulb wired in parallel, and Sonoff SW-disconnected, the PIR works as expected (as above). However the moment I connect the Sonoff SW input, then:
With no resistor, the parallel-bulb is permanently on full brightness (I can measure 241V when the PIR is “on” and 239V when it is “off”). This is different to the Shelly.
With a 680K ohm resistor in place (which worked with the Shelly), the parallel-bulb does now turn fully off when the PIR goes off, but I can still measure 13V across it. And the Sonoff SW-1 input doesn’t correctly see PIR on/off. (If I have “inverted: False” it sees the PIR as permanently on, if I have “inverted: True” then the PIR flickers on/off repeatedly).
So the behaviour of the Sonoff is surprisingly quite different to Shelly. Any further suggestions for how to diagnose and/or fix this?
I suggest you to remove the parallel bulb from the circuit.
Then tell if and how are you 100% sure about your N and L.
Also, it’s difficult to reply to this topic because it’s signed solved.