PIR sensor working on specific hours

Hello everyone. I do have a question. Is it possible to run PIR only on specific hours? Like “Nighttime only” function on fixed hours. Thank you for Your help.

Yes, but I use the Home Assistant program to control the PIR.

Yes.
You can schedule presets with on and off for PIR sensor.
{"PIRsensorSwitch":{"PIRenabled":true}} for on and {"PIRsensorSwitch":{"PIRenabled":false}} for off.

It works. Thank you.

I know. I wrote the code. :rofl:

Hi guys,

this was exactly what I was looking for. But even though I (think I) followed the instruction, it doesnt work for me.

My setup:

  • I am running WLED, version 0.14.0-b6, on a ESP8266.
  • I configured a PIR under LED & Hardware setup: Button 0 GPIO=5, PIR sensor
  • for PIR activation I did: Button action: Button 0, long off->on: “preset to switch on”

So far so good and it works. But the de-activation as shown by @blazoncek does not work.

  • i added a preset to enable and a similar one (with a “false”) to disable:
    grafik

But even though i activate the Preset to disable (directly via WLED Browser UI - or via HomeAssistant, calling the preset) → the PIR is always enabled.

Any ideas are welcomed!
Thanks,
Wolfgang

Post your preset for “PIR Off”, showing the API content.

there you go:
grafik

The API above only works for PIR sensor usermod, not if you use “buttons”.

Thanks for clarification.

Is there a solution to control these buttons state without using pir switch usermode?
Maybe with some direct settings links?
I have already programmed sensors logic with Arduino Nano and I am looking for preset, controlling PIR states in HA as switch.