['UpdateDevice'] can not and ['OpenURL'] can use notifications. Topic is solved

Moderator: leecollings

Post Reply
costo
Posts: 71
Joined: Tuesday 11 August 2015 17:35
Target OS: Linux
Domoticz version: 2025.1
Location: Netherlands
Contact:

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

Post 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 ?
alanlsmith
Posts: 132
Joined: Monday 07 August 2017 17:17
Target OS: Linux
Domoticz version: Latest β
Location: Near London (Saaarf!)
Contact:

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

Post 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.
Domoticz Latest β, RPi 4B with 110Gb SSD for Domoticz, RPi 4B with 110Gb SSD for Node-Red & a RPi 2B for logging / IP addressing. RFXCOM, PiZiGate, Z-Wave, Harmony, Hue lamps and a bit of Broadlink.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest