Timing - general question

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
uweklaus
New user
Posts: 7
Joined: 28 Feb 2018, 09:33

Timing - general question

#1 Post by uweklaus » 28 Feb 2018, 10:12

Hi all,
I am new to this forum.

I have a general question about execution times of rules and other action with ESP_Easy:
What are or should be in general the execution times of rules?
I read in the forum something between 150 and 2500 ms .. And there are many discussions about MQTT slow response etc....

Maybe to my setup first:
Wemos D1 mini with 4 relays and 4 switches (later replaced by motion detectors).
I m running rules to communicate with my broker Mosquitto running on a PI3 and my homebridge on same PI using MQTT.
OpenHAB is on controller 1 without any passwords.

Now, when I press a button, this is published via my broker to the homebridge (works fine and quick).
With node-RED I advised the broker to switch on lamps my sending rule commands by MQTT to the ESP. One command, one rule for one lamp.
In the broke I can define which lamps should be switched on (say Lamp1 and Lamp2).
The Lamp rule publishes a MQTT message back that the Lamp is on or off using JSON format (works).

What I observe is the following:
Press the button : immediately the motion-sensor button in the homekit (via homebridge and Mosquitto) shows the activity (ms ...)
Then it takes about 1 second to switch the first lamp.
After another second the next lamp switches.

Looking into the log:
execution lamp1
...
1300 ms execution time
executing lamp2
...
1350 ms execution time.


My question is this long execution time normal?
Is it related to MQTT messages sent and received?
Can I reduce the reaction time somehow?

It is doing what it should, but I would like to have a quicker response time somehow, because I want to control finally using 2 ESP, 8 lamps, 5 motion sensors (=switches) and one other sensor (=switch).

Thanks in advance for any hint.

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: Timing - general question

#2 Post by toffel969 » 28 Feb 2018, 10:50

First question would be the setting on message delay in advanced tab. Standard is 1000msec. Try to lower it to 10 or 100. This gave me acceptable switching times. Its still not immediate, but fast enough to feel responsive
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

uweklaus
New user
Posts: 7
Joined: 28 Feb 2018, 09:33

Re: Timing - general question

#3 Post by uweklaus » 28 Feb 2018, 11:07

Thanks, I will try this evening.

Isn t the delay, if the devices are directly reporting to mqtt? Do they report always in the delay frequency or only if the value has changed? This I couldn t extract from the forum topics nor the description in letscontrolit ...

I send the msg in the rules with publish.

Maybe I should post the setup of my device, which I will do.

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: Timing - general question

#4 Post by toffel969 » 28 Feb 2018, 13:03

uweklaus wrote: 28 Feb 2018, 11:07 Thanks, I will try this evening.

Isn t the delay, if the devices are directly reporting to mqtt? Do they report always in the delay frequency or only if the value has changed? This I couldn t extract from the forum topics nor the description in letscontrolit ...

I send the msg in the rules with publish.

Maybe I should post the setup of my device, which I will do.
There are two delay settings :
1. In device: it's the interval between reports to controller, for switch input if it's 0 the device will report only on change. Else it reports the switch state every x sec(=delay setting) to controller
2. Global message delay in advanced tab : the time esp easy waits before sending a msg
There is another discussion on the forum to change nomenclature to avoid the confusion you just experienced
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

uweklaus
New user
Posts: 7
Joined: 28 Feb 2018, 09:33

Re: Timing - general question

#5 Post by uweklaus » 28 Feb 2018, 13:50

Thx a lot.
Now it becomes clear!

I will play with it this evening.

uweklaus
New user
Posts: 7
Joined: 28 Feb 2018, 09:33

Re: Timing - general question

#6 Post by uweklaus » 28 Feb 2018, 20:19

Now I played a little and what I saw is the following:
- as long as the delay (in advanced settings) is lower than processing time no change in processing time nor execution speed still remains between 850 and 1000 MS per rule.
- even if i do not use a rule (e.g. Motion1#Switch is renamed to Motion2#Switch) and activating device reporting with delay 0 , execution time is 10 to 20 MS faster- thats it.
- Today I was not able the reproduce the above mentioned 1300 ms.
- When a timer ends Rules#Timer=.... the execution time between 1900 and 2000 MS (sometimes 1700).

I deactivated debug on serial and/or web, deactivated serial or closed the web interface. No significant change in timing and processing time.
Also NTP has no influence.

Any hint how to come down to about 500 MS processing time ?

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests