Json update switch no trigger  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
User avatar
djdevil
Posts: 101
Joined: Friday 26 July 2019 18:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Contact:

Json update switch no trigger

Post by djdevil »

Hello i used this code for On and Off a switch with IFTT without trigger event but from the new version Version: 2020.2 Build Hash: b63341bc0 seems to activate the trigger and then activate the dzvents script connected to the key maybe it's a bug i'm wrong to use this json call? thx

Code: Select all

OFF
/json.htm?type=command&param=udevice&idx=<IDX>&nvalue=0 
ON
/json.htm?type=command&param=udevice&idx=<IDX>&nvalue=1
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Json update switch no trigger  [Solved]

Post by waaren »

djdevil wrote: Tuesday 19 May 2020 12:56 I used this code for On and Off a switch without trigger event but from the new version Version: 2020.2 Build Hash: b63341bc0 seems to activate the trigger and then activate the dzvents script connected to the key.
If you don't want to trigger the event system when sending this command you need to add

Code: Select all

&parsetrigger=false
So the complete JSON's become

Code: Select all

OFF
/json.htm?type=command&param=udevice&idx=<IDX>&nvalue=0&parsetrigger=false

ON
/json.htm?type=command&param=udevice&idx=<IDX>&nvalue=1&parsetrigger=false
This option was added in version V4.11656 and since then the default behavior for calls with param=udevice changed.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
djdevil
Posts: 101
Joined: Friday 26 July 2019 18:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Contact:

Re: Json update switch no trigger

Post by djdevil »

waaren wrote: Tuesday 19 May 2020 14:45
djdevil wrote: Tuesday 19 May 2020 12:56 I used this code for On and Off a switch without trigger event but from the new version Version: 2020.2 Build Hash: b63341bc0 seems to activate the trigger and then activate the dzvents script connected to the key.
If you don't want to trigger the event system when sending this command you need to add

Code: Select all

&parsetrigger=false
So the complete JSON's become

Code: Select all

OFF
/json.htm?type=command&param=udevice&idx=<IDX>&nvalue=0&parsetrigger=false

ON
/json.htm?type=command&param=udevice&idx=<IDX>&nvalue=1&parsetrigger=false
This option was added in version V4.11656 and since then the default behavior for calls with param=udevice changed.
Perfect it works, I wasn't aware of it thank you very much
hestia
Posts: 361
Joined: Monday 25 December 2017 23:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Paris
Contact:

Re: Json update switch no trigger

Post by hestia »

&parsetrigger=false
Does it work also for commands like

Code: Select all

/json.htm?type=command&param=switchlight&idx=<IDX>&switchcmd=Toggle
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Json update switch no trigger

Post by waaren »

hestia wrote: Wednesday 20 May 2020 22:32
&parsetrigger=false
Does it work also for commands like

Code: Select all

/json.htm?type=command&param=switchlight&idx=<IDX>&switchcmd=Toggle
No
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: Json update switch no trigger

Post by Nautilus »

Could this be added? Now I cannot find a way to update the position of a "blinds percentage" device wihtout triggering the associated scripts.
Hencor
Posts: 48
Joined: Sunday 01 September 2019 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: DE
Contact:

Re: Json update switch no trigger

Post by Hencor »

In my validation it turns out that &parsetrigger=false doesn't apply to the action set in the selector switch settings. Am I right or I'm doing something wrong?

My attempt: /json.htm?type=command&param=switchlight&idx=IDX&switchcmd=Set%20Level&level=LEVEL&parsetrigger=false

So my goal is that the selector switch action is only triggered when the user push the button on the interface and not triggered when the status is changed via json. Is there another possiblity without dzvents scripting?
User avatar
waltervl
Posts: 5886
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Json update switch no trigger

Post by waltervl »

Hencor wrote: Wednesday 16 February 2022 10:31 In my validation it turns out that &parsetrigger=false doesn't apply to the action set in the selector switch settings. Am I right or I'm doing something wrong?

My attempt: /json.htm?type=command&param=switchlight&idx=IDX&switchcmd=Set%20Level&level=LEVEL&parsetrigger=false

So my goal is that the selector switch action is only triggered when the user push the button on the interface and not triggered when the status is changed via json. Is there another possiblity without dzvents scripting?
As already mentioned in the wiki:
To update in Domoticz only without running it's device actions use
/json.htm?type=command&param=udevice&idx=IDX&nvalue=[0,1]&svalue=LEVELNR
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest