json switchcmd=On for 1 sec.

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
epost
Normal user
Posts: 33
Joined: 09 Feb 2018, 20:04

json switchcmd=On for 1 sec.

#1 Post by epost » 12 Mar 2022, 11:02

Hello,
I've been looking for days how in the json line below the switch for 1 sec. can be switched 'On'.
Is there anyone who has a solution for this?

dz.openURL('http:/192.168.xxx.xxx:8080/json.htm?type=command&param=switchlight&idx=507&switchcmd=On')

User avatar
Ath
Normal user
Posts: 3526
Joined: 10 Jun 2018, 12:06
Location: NL

Re: json switchcmd=On for 1 sec.

#2 Post by Ath » 12 Mar 2022, 14:14

Is this supposed to work with ESPEasy?, as I don't recognize the command syntax :?
/Ton (PayPal.me)

epost
Normal user
Posts: 33
Joined: 09 Feb 2018, 20:04

Re: json switchcmd=On for 1 sec.

#3 Post by epost » 12 Mar 2022, 16:12

This is a command from a Domoticz/dzvents script to activate a switch for 1sec. to turn on.
Perhaps this question should not be asked in this forum.

TD-er
Core team member
Posts: 8759
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: json switchcmd=On for 1 sec.

#4 Post by TD-er » 12 Mar 2022, 20:10

Do you want to send this URL from ESPeasy to Domoticz?

Jieffe
New user
Posts: 6
Joined: 02 May 2021, 22:17

Re: json switchcmd=On for 1 sec.

#5 Post by Jieffe » 12 Mar 2022, 20:31

epost wrote: 12 Mar 2022, 11:02 I've been looking for days how in the json line below the switch for 1 sec. can be switched 'On'.

dz.openURL('http:/192.168.xxx.xxx:8080/json.htm?type=command&param=switchlight&idx=507&switchcmd=On')
If I understand correctly, you're trying to send a dzEvent from Domoticz to activate a switch flashed with EspEasy.

If so, have you tried :

Code: Select all

dz.openURL('http:/192.168.xxx.xxx/control?cmd=pulse,<gpio>,1, 1000')
where <gpio> is the gpio on your switch commanding the relay. 1000 is the duration of the pulse in milliseconds, thus 1 second in this case.

epost
Normal user
Posts: 33
Joined: 09 Feb 2018, 20:04

Re: json switchcmd=On for 1 sec.

#6 Post by epost » 13 Mar 2022, 11:06

I'll try to explain what the point is.
I have a wireless Doorbell whose push button range (433 MHz.) is not large enough.
With this push button I have created a Doorbell Device in Domoticz so that the range is large enough.
With a dzVents Script I can now control the bell, but that should not be less than a second.
The current command keeps the bell ringing.

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
}

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests