How to Send to Controller via Rule (or trigger publish)?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Wookbert
Normal user
Posts: 132
Joined: 06 Nov 2020, 03:17

How to Send to Controller via Rule (or trigger publish)?

#1 Post by Wookbert » 28 Mar 2023, 00:22

I have a Generic HTTP controller with Controller Publish

Code: Select all

?id=%mac%&z=%lcltime%&t=%tskname%&p1=%vname1%&v1=%val1%&p2=%vname2%&v2=%val2%&p3=%vname3%&v3=%val3%&p4=%vname4%&v4=%val4%
, whereas the device Environment - BMx280 Sends to the Controller with an interval of 60 seconds.

Instead of using the interval, I’d like to send to the controller/publish the BMP280 values via Rule

Code: Select all

on System#Boot do
. How to do that? I can’t figure it out by reading the docs.

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

Re: How to Send to Controller via Rule (or trigger publish)?

#2 Post by TD-er » 28 Mar 2023, 08:54

Whenever a task performs the PLUGIN_READ function (in the code), it may yield a value (or multiple, like with the BME280)
Those values are then sent to all connected controllers of that task.

You can trigger a call to PLUGIN_READ from the rules by running the command TaskRun.
N.B. this is also how you can flush values from a "Dummy" task as that one doesn't have a periodical call to PLUGIN_READ.

See: https://espeasy.readthedocs.io/en/lates ... lue-events

Another way to publish any string you can format in the rules, you use the command "publish".
See: https://espeasy.readthedocs.io/en/lates ... nd-publish

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 30 guests