csuermann / node-red-contrib-presence-faker

Node-RED node that fakes presence in a smart home by switching devices (e.g. lights) on and off at random times.
MIT License
23 stars 2 forks source link

Off-> ON min duration #5

Closed ldb2000 closed 4 years ago

ldb2000 commented 4 years ago

I have tested node-red-contrib-presence-faker. I have an issue, maybe I use it in the wrong way, or I don't understand it :)

Everytime, I have a off, 1 sec after, the on is sent. The on duration and the count sounds ok, but the off is too short?

Thanks,

csuermann commented 4 years ago

Could you please paste your node config here?

ldb2000 commented 4 years ago

I was using the example that you have provide. I changed the node as bellow:

[{"id":"e2038d28.9bb258","type":"presence-faker","z":"940b2dac.004b08","name":"","onPayload":"true","onPayloadType":"bool","onTopic":"OnTopic","offPayload":"false","offPayloadType":"bool","offTopic":"OffTopic","windowBegin":"07:30","windowEnd":"17:30","minDurationHours":0,"minDurationMinutes":0,"minDurationSeconds":"2","minDuration":"2","maxDurationHours":0,"maxDurationMinutes":"0","maxDurationSeconds":"5","maxDuration":"5","minCount":"100","maxCount":"500","startupBehavior":"onMsg","actionOnDisable":"off","x":500,"y":820,"wires":[["6dab47e1.88dd2","6553cfc0.f36e48"]]}]

When I click on enable, here is the debug output:

Thanks for your help

csuermann commented 4 years ago

I actually don't see any abnormal behavior in the debug output you posted.

10 sec off -> 4 sec on -> 104 sec off -> 3 sec on

Admittedly, the sample config is rather excessive with 100 to 500 on times, which might lead to only very short intervals of on and off times. Try reducing those numbers and observe how the schedule changes.

You might want to add the following to your node-red settings.js file to generate a more verbose debug output:

presenceFakerDebug: true