Log of rules

Is there anyway to get a log, with timestamps of what rules ran and why they made the decisions they made?

Nope, but we have an open issue for it: https://github.com/WebThingsIO/gateway/issues/2664

Another nit… Today, I just made a bunch of changes to a rule and wanted to manually execute it as a test and realized there is no obvious way to manually initiate execution.

Someone told me that patientce is a virtue, which I guess applies in this instance!

Check out https://github.com/WebThingsIO/gateway/issues/1912

What: Execute Rules Using Virtual Thing Custom PushButton

Found a cheap way to manually execute a rule using a Virtual Think Custom Push Button thing. You can manually press the button to execute the rule or even execute it using cURL remotely which is what I do.

  1. Create a Virtual Thing Custom “PushButton” thing with default state false (not pushed)
  2. Edit rule and create new trigger when virtual button = true (pressed)
  3. In same rule, create new action and set virtual button = false (reset to not-pressed)

So, anytime the button is “pressed” the rule will fire. You can manually do this on the GUI.

I wrote a Mochad script to send WebThings cURL commands when X10 buttons are pressed. Here is what I would execute to set the boolean property I defined in the virtual button remotely (inspiration from curl_examples SetProperty.sh…)

TIMEOUT=" --connect-timeout 10 --max-time 30 "

curl ${TIMEOUT} -H "Authorization:Bearer ${WTGW_AKEY}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-X PUT -d '{"'${xPROPERTY}'":'${xVALUE}'}' \
--insecure --silent --show-error \
${WTGW_URL}/things/${xTHING}/properties/${xPROPERTY} > ${LOGDIR}/x10-mochad-curl-output.txt 2>&1