json switchcmd='On' for 1 sec.

Moderator: leecollings

Post Reply
epost
Posts: 11
Joined: Sunday 27 December 2020 14:28
Target OS: -
Domoticz version:
Contact:

json switchcmd='On' for 1 sec.

Post 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
}
User avatar
waltervl
Posts: 5907
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

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

Post 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)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
epost
Posts: 11
Joined: Sunday 27 December 2020 14:28
Target OS: -
Domoticz version:
Contact:

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

Post 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.
epost
Posts: 11
Joined: Sunday 27 December 2020 14:28
Target OS: -
Domoticz version:
Contact:

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

Post by epost »

There is a bug in the command line:
Device idx(507) must be idx(525).
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest