uxhamby wrote: ↑01 Apr 2023, 04:31
Is the use of the 'runtask' command documented more comprehensively somewhere? I seem to be missing the boat on getting the temperature from %eventvalue% in all my attempts at using it so far.
The actual command is TaskRun, not runtask... that should improve the score on
search-results (scroll down a bit, can't link to it directly)
It all depends on wether you have enabled "Single event with all values:" or not (by default that is not enabled), resulting in an event to be generated for Ambient#Temperature or Ambient#All. (as stated above)
To use the value from that event you will need to add an eventhandler in rules like this (assuming the default for "Single event with all values:", being disabled)
Code: Select all
On Ambient#Temperature Do
Publish,your/mqtt/topic,%eventvalue1%
Endon
For this event there is only 1 value appended to the event, like: Ambient#Temperature=23.4
For sensors that have multiple Values available, a separate event for each Value will be generated, each with only their own current value included
If you have ENabled "Single event with all values:", and possibly connected multiple DS18b20 sensors to the same GPIO (up to 4 are supported per task for this plugin), you could handle these 4 temperature readings in a single eventhandler (aka: rule).
The generated event (with 4 sensors configured) could look like this: Ambient#All=23.4,21.5,16.8,10.5
Code: Select all
On Ambient#All Do
Publish,your/mqtt/topic/living,%eventvalue1%
Publish,your/mqtt/topic/kitchen,%eventvalue2%
Publish,your/mqtt/topic/hallway,%eventvalue3%
Publish,your/mqtt/topic/outside,%eventvalue4%
Endon
NB: These events will be generated at each Interval, except when that is set to 0 (when allowed, not for the DS18b20), then only an initial event is generated.