@jkandasa Turned out that EEPROM was not cleared properly with 0xFF
Best posts made by benya
-
RE: MySensor auto node ID
-
RE: Triggering rule through the HTTP request
Here is a sample REST API call that modifies MyController repository variable:
curl -X PUT -H "Content-Type: application/json" -d '{"key":"Var1","value":"222"}' "http://demo:demo@demo.mycontroller.org/mc/rest/variables"
-
RE: "Send email" questions
@jkandasa Yes, followed https://easyengine.io/tutorials/linux/ubuntu-postfix-gmail-smtp/ and got it working in short time.
-
RE: Synchronization between rules and timer handlers
@jkandasa We need some mechanism to prevent race condition.
-
RE: Controlling global variable and timer from Groovy
@benya I verified, Groovy could execute external tools. Tested with Demo system:
return "ls".execute().text.split("\n")
Result:
{ "mcResult": [ "Publicbroker-wstestmosquittoorg8080mqtt", "h2", "start.bat", "start.sh", "start_.sh", "stop.sh", "test_19Kz0-tcpwantsoftru1883", "test_48n0f-tcpwantsoftru1883", "test_FzOqu-tcpwantsoftru1883", "test_epPgp-tcpwantsoftru1883", "tmp" ] }
-
RE: Controlling global variable and timer from Groovy
@jkandasa Seems
mcApi.timer().update(myTimer);
causes timer to loose references to the operations and doesn't trigger operation when enabled again.I had better luck with the following code:
def filters = [:]; filters.put("name", "Timer1"); def myTimer = mcApi.timer().get(filters); def timerIds = [myTimer.getId()]; mcApi.timer().disable(timerIds) mcApi.timer().enable(timerIds)
-
RE: Triggering rule through the HTTP request
I figured how to set dummy sensor by script called through REST API.
I created "Set DummySensor" groovy script:
def uid = "DummySensor" def value = "1" def sensor = mcApi.uidTag().getByUid(uid).getResource() sensor.setValue(value) mcApi.sensor().sendPayload(sensor);
and call it through the REST API:
curl "http://admin:admin@localhost:9880/mc/rest/scripts/runNow?bindings=%7B+%7D&script=operations%2FSet+DummySensor.groovy&scriptBindings=%7B%7D"
I defined rule that gets triggered when dummy sensor value changes.
No 5 sec delays anymore. Cool!