Page 1 of 1

json switchcmd='On' for 1 sec.

Posted: Sunday 13 March 2022 14:01
by epost
Hello,
I have a wireless doorbell whose push button range (433 MHz.) is not big enough.
With this push button I have made a doorbell device in Domoticz so that the range with the RFLink is large enough.
With a dzVents Script I can now control the bubbles (3), but the 'On' signal should not be longer than one second.
The current script rings the bell constantly.

return {
on = {
devices = { 525 }
},

execute = function(dz, device)

if (device.active) then
dz.openURL('http:/192.168.1.23:8080/json.htm?type=command&param=switchlight&idx=507&switchcmd=On')
end
end
}

Re: json switchcmd='On' for 1 sec.

Posted: Sunday 13 March 2022 17:17
by waltervl
What kind of device is idx 507?
Because you can also use a dzvents command instead of openUrl.
Like:
dz.devices(507).switchOn().forSec(1)

Re: json switchcmd='On' for 1 sec.

Posted: Sunday 13 March 2022 18:30
by epost
Device idx(507) is the doorbell in Domoticz that was created with the push button in Domoticz, and thus contains the original transmitted code of the push button. By controlling this with the dzvents script I use Domoticz as an amplifier for the push button signal.

Re: json switchcmd='On' for 1 sec.

Posted: Monday 14 March 2022 11:46
by epost
There is a bug in the command line:
Device idx(507) must be idx(525).