Search found 10 matches

by optiserw
Sunday 06 May 2018 22:49
Forum: Python
Topic: Multiply on/off switch change
Replies: 9
Views: 973

Re: Multiply on/off switch change

jvdz wrote: Sunday 06 May 2018 21:42
optiserw wrote: Sunday 06 May 2018 20:43 If I take one of these url it takes about 7 seconds.
So it takes 7 seconds for domoticz to come back with OK when you use that URL in a regular browser like Chrome?

Jos
If I use browser the time is very short.

Pawel
by optiserw
Sunday 06 May 2018 20:43
Forum: Python
Topic: Multiply on/off switch change
Replies: 9
Views: 973

Re: Multiply on/off switch change


That should be done in milliseconds! How long does it take when you take one of these url's and put them in a browser?
Either way, you have been given a number of answers in the other thread so really don't understand why you started a new one in stead of following up on the posted suggestions ...
by optiserw
Sunday 06 May 2018 19:49
Forum: Python
Topic: Multiply on/off switch change
Replies: 9
Views: 973

Re: Multiply on/off switch change


See my edit!

.. and I don't see why that takes long.


This code takes about 25 second!
Why?

urllib.urlopen("https://192.168.20.10/json.htm?type=command&param=switchlight&idx=192&switchcmd=On").read()
urllib.urlopen("https://192.168.20.10/json.htm?type=command&param=switchlight&idx=193 ...
by optiserw
Sunday 06 May 2018 15:10
Forum: Python
Topic: Multiply on/off switch change
Replies: 9
Views: 973

Re: Multiply on/off switch change

jvdz wrote: Sunday 06 May 2018 15:08 They each require an separate API call as far as I know.

Jos
But it takes a long time...
by optiserw
Sunday 06 May 2018 15:07
Forum: Python
Topic: Multiply on/off switch change
Replies: 9
Views: 973

Multiply on/off switch change

Hi,

I have a few switches in my system.
I want to change the status of the switches at the same time using one API command.

I am thinking about somenthing like that:
/json.htm?type=command&param=switchlight&idx=1&switchcmd=On&idx=2&switchcmd=Off&idx=3&switchcmd=Off&idx=4&switchcmd=On

How can I ...
by optiserw
Sunday 06 May 2018 14:24
Forum: Switches and Scenes
Topic: Multiply on/off switch change
Replies: 9
Views: 1455

Re: Multiply on/off switch change


code in dzVents: ( find many other examples here )

--[[
Switch sequence of devices
]]

return {

on = { devices = { "Your trigger device" } },

execute = function(dz, trigger )

if trigger.state ~= "Off" then
dz.devices(1).switchOff()
dz.devices(2).switchOn()
dz.devices(3).switchOff ...
by optiserw
Thursday 03 May 2018 20:53
Forum: Switches and Scenes
Topic: Multiply on/off switch change
Replies: 9
Views: 1455

Re: Multiply on/off switch change

waaren wrote: Thursday 03 May 2018 20:34 For virtual switches the delay is negligible
Could you show me the example code for that?
Language - whatever
idx 01-100

1 pff
2 on
3 off
4 off

state random

Best regards
Pawel
by optiserw
Thursday 03 May 2018 20:01
Forum: Switches and Scenes
Topic: Multiply on/off switch change
Replies: 9
Views: 1455

Re: Multiply on/off switch change

waaren wrote: Thursday 03 May 2018 19:45 Or put the switches in a group and use a json to switch the group
The state of all the group members must be the same!
In my case, the states of switches are different - not equal.

This solution isn't good.

Pawel
by optiserw
Thursday 03 May 2018 19:57
Forum: Switches and Scenes
Topic: Multiply on/off switch change
Replies: 9
Views: 1455

Re: Multiply on/off switch change


Put your json commands in a script using curl and fire the script? You can only switch one per command


If I put about 20 singular commands into the script, it will be executed for a long time (>20 seconds).
If I need to use 100 switches, it will be more than 1 minute!

This way isn't right, I ...
by optiserw
Thursday 03 May 2018 13:40
Forum: Switches and Scenes
Topic: Multiply on/off switch change
Replies: 9
Views: 1455

Multiply on/off switch change

Hi,

I have a few switches in my system.
I want to change the status of the switches at the same time using one API command.

I am thinking about somenthing like that:

/json.htm?type=command&param=switchlight&idx=1&switchcmd=On&idx=2&switchcmd=Off&idx=3&switchcmd=Off&idx=4&switchcmd=On

How can I ...