Page 1 of 1

Generic Pulse Counter with LED indication?

Posted: 19 Jan 2022, 07:57
by Metatron
Hello,

I am currently developping hardware for pulse counting with espeasy.
It would be very handy, if the onboard LED of my D1 mini would indicate a closed contact.
Can anyone please give me a hint, how to implement this?

Regards, Metatron

Re: Generic Pulse Counter with LED indication?

Posted: 19 Jan 2022, 09:40
by Ath
There are no events triggered when a pulse is counted, as far as I can see, the closest you can get is to catch the event "on <PulsecounterTaskName>#Count do", and set the interval to 1 second.

A more tricky method could be to also configure a Switch device on the same GPIO, without any debounce settings, and handle the "on <SwitchTaskName>#State do" in a rule. That will trigger immediate when the pin state changes, but if the pulse frequency is > 1 Hz, most likely the ESP will either be very busy or crash, because it can't properly handle that kind of amount of rules processing (rules processing is not that fast, and quite CPU intensive).
So you may need to remove any unneeded rules (or comments), and place the 'high-frequency' rules as first in the Rules1 file.

Re: Generic Pulse Counter with LED indication?

Posted: 22 Jan 2022, 18:20
by Metatron
Hello,

thank you, that works for me! (Using switch)

Regards, Metatron