danube / node-red-contrib-smarthome-powerswitch

European Union Public License 1.2
1 stars 1 forks source link

Timeout for Input: Motion detector works only with false payload #21

Open nrtkin opened 8 months ago

nrtkin commented 8 months ago

Hello, i'm running nodered 3.1.2 with your Version 1.2.0.

Can you have a look on this issue please.

The timeout in Input: Motion detector works only when i inject a payload with "false".

The max timeout is running ok.

image

danube commented 8 months ago

Hello @nrtkin and thanks for writing. The idea is that a detector sends a "on" signal as long as there is motion. When the detector sees no more motion, an "off" signal is being sent. The timer starts with this "off" signal. So...

  1. Motion active (incoming "on" signal). Powerswitch turns on.
  2. Motion inactive (incoming "off" signal). Powerswitch stays on, motion off timer starts.
  3. Motion off timer ends. Powerswitch turns off (if no new motion on signal occurs in the meantime).

On your screenshot this seems to be the case. A "motion on" signal turns the Powerswitch on and 5 seconds after the motion off signal, the Powerswitch turns off.

Do you have any situation, where this behavior does not suit to your use case?

Regards! Thomas

danube commented 8 months ago

Probably a lack of documentation. Going to check this.