Determine what initiated a device change? (or updateSetPoint(value).silent())

Post Reply
thibaut
Posts: 2
Joined: Monday 04 December 2017 19:25
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Determine what initiated a device change? (or updateSetPoint(value).silent())

Post by thibaut » Thursday 07 December 2017 16:20

Hi,

I have a battery-powered z-wave thermostat (SRT 323) that I sometimes control from scripts when e.g. temperature in another room is getting too low.

Whenever I change the setpoint from a script, that triggers two events:
- one immediately after I change the setpoint, when my command is queued in domoticz (or so I guess) ;
- another one when the device wakes up and actually receives the new set point.

Now I want to react to setpoint changes, but only when initiated by the user (by moving the physical dial on the device). So I want to filter out the events triggered by a script. How can I do that?

I have tried to append .silent() to the command in the script, but that doesn't seem to be supported for updateSetPoint() (I'm under domoticz 3.8153):

Code: Select all

mydevice.updateSetPoint(value).silent()
yields an error:
2017-12-07 15:16:00.566 Error: dzVents: Error: An error occured when calling event handler test
2017-12-07 15:16:00.566 Error: dzVents: Error: .../domoticz/var/scripts/dzVents/generated_scripts/test.lua:30: attempt to index a nil value
I addition, I guess that the silent() feature would only prevent the first of the two script-generated events, but not the second (which I guess is actually generated by the device when it receives the new setpoint).

Kind regards

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests