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!
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.
- Create a Virtual Thing Custom “PushButton” thing with default state false (not pushed)
- Edit rule and create new trigger when virtual button = true (pressed)
- 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