Page 1 of 1

['UpdateDevice'] can not and ['OpenURL'] can use notifications.

Posted: Friday 23 March 2018 14:11
by costo
In Events I wrote a LUA script to monitor batterij-voltage of a remote node. I like to receive a notification in Telegram_app if the LiFePo4 voltage goes below 2.75 volt. (idxVolt = the idx of the device and volt is the value)

I can use two different ways to get the result in Domoticz.

With this command
commandArray['OpenURL']="127.0.0.1:8080/json.htm?type=command&param=udevice&idx="..idxVolt.."&nvalue=0&svalue="..volt
logfile reports:
2018-03-23 14:04:01.433 EventSystem: Fetching url...
2018-03-23 14:04:02.024 (Virtual) General/Voltage (LoRa TTN-vcc)
Value is updated and notification to Telegram will work.

With this command
commandArray[3] = {['UpdateDevice'] = idxVolt .. '|0|' .. volt}
there is nothing in the logfile, values are received by Domoticz but notifications do not work.

Is there a logical reason for this behaviour ?

Re: ['UpdateDevice'] can not and ['OpenURL'] can use notifications.

Posted: Saturday 24 March 2018 13:05
by alanlsmith
As far as I know the json command will trigger an event and therefore any associated scripts or actions whereas ['UpdateDevice'] will change device values without triggering an event.

I use ['UpdateDevice'] when , for example I want to change the value of a thermostat but not trigger the script that is associated with that device which would be triggered if the device was changed manually.

This allows me to update setpoints in line with my heating plan but also allows for manual override by triggering a script that sets a variable to stop the automatic updating, when the setpoint is changed through the user interface.