pulse interval in rules

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
hestia
Normal user
Posts: 90
Joined: 06 Mar 2021, 08:27
Location: Paris

pulse interval in rules

#1 Post by hestia » 01 Oct 2021, 15:58

Hi,
is it possible too get the Interval of a pulse counter a the rules?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: pulse interval in rules

#2 Post by TD-er » 01 Oct 2021, 22:08

You can let the task send a combined event, of all task values. Then you have the values as shown also on the devices page.

Or you enable monitoring (see: https://espeasy.readthedocs.io/en/lates ... ore-events )
and then when the event is triggered for a state change you can store the time (%uptime_ms%) in a variable and compute the difference.
However you cannot do that at "high" frequencies (over a few Hz) as rules parsing isn't that fast.
Also it may take a while before you process the event, so the timing isn't that accurate. (typical 100 msec resolution at best)

hestia
Normal user
Posts: 90
Joined: 06 Mar 2021, 08:27
Location: Paris

Re: pulse interval in rules

#3 Post by hestia » 02 Oct 2021, 10:24

Thanks for your reply
...compute the difference...
seems a bit complicated for what I need: just to avoid hard coding
combined event
seems better but I don't understand how to let "the task send a combined event"
Could you give me some hint please?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: pulse interval in rules

#4 Post by TD-er » 02 Oct 2021, 14:19

In the task configuration, you can check:
"Single event with all values:"

This will send a single event with all values of the task. See: https://espeasy.readthedocs.io/en/lates ... all-values

hestia
Normal user
Posts: 90
Joined: 06 Mar 2021, 08:27
Location: Paris

Re: pulse interval in rules

#5 Post by hestia » 03 Oct 2021, 10:02

In the task configuration, you can check:
"Single event with all values:"
What I understand is that if I check this, for all the task concerned, I'll have a single event with all the values. With witch interval?
I've read this could a good for performance issue, but I don't understand how it will be usefull to get the interval of the device.
Perhaps I wasn't clear...
What I'd like is to use in the rules some values given by Show Json
Screenshot 2021-10-03 095850.png
Screenshot 2021-10-03 095850.png (15.34 KiB) Viewed 4902 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: pulse interval in rules

#6 Post by TD-er » 03 Oct 2021, 10:57

Ah OK, then I completely misunderstood your question.
I thought you wanted to get the "period" of the pulse you got from the pulse counter task, did not think of the set "interval" in the task.

That's never been asked before, but I get why you would want that.
For that I guess we need to implement a new variable.
Something like %intervalN% where N is the task index (starting at 1)

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: pulse interval in rules

#7 Post by TD-er » 03 Oct 2021, 11:02


hestia
Normal user
Posts: 90
Joined: 06 Mar 2021, 08:27
Location: Paris

Re: pulse interval in rules

#8 Post by hestia » 03 Oct 2021, 23:00

Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 37 guests