How to speed up Domoticz event action

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

How to speed up Domoticz event action

Post by deennoo »

Hi there !

Nearly 2 year i'm using Domoticz, spending time to improve 433 reception, introduce new devices (esp8266, RFLINK, Milight, Zwave).

Checking various hardware solution : RPI B+, RPI2, WD Mybookworld, Chroot on various android device, Synology DS 216 Play, and now testing with a Intel NUC I5 with 4G ram + 64GO ssd).

Really Happy with solution, easy clik and play, and always found a solution for device who are not listed (Scripting).

Only 1 thing don't put the WAF at 100% :

Domoticz Beta : 3.5700 on a Debian Linux 8.5 on a intel core i5 Nuc

I'm using some chacon wall switch to light up Milight Bulb.
Those Milight Bulb are drive by RFLInk (was drive by Milight wifi gateway by the past).
Chacon Switch are RFXTRX hardware part.
As 2 switch can drive the same bulb groupe, i'm using this kind of LUA script

Code: Select all

commandArray = {}
 if (devicechanged['Inter plaf salon tv'] and otherdevices['Plafonnier Salon'] == 'Off')  then
     commandArray['Group:Plafonnier salon']='On'
 elseif (devicechanged['Inter plaf salon tv'] and otherdevices['Plafonnier Salon'] ~= 'Off')  then
     commandArray['Plafonnier Salon']='Off'
 end
 return commandArray
On script :
- Inter Plaf Salon : is the Chacon switch module
- Plafonnier Salon : is a Milight Bulb Group drive by a group scene

Can't use toggle fonction because i'm using a device twice script who send order twice time (433 + 2.4ghz to be sure that device recieve order).
Can't use zwave module doesn't get 230V at real switch.
Since 2 years now each time i'm using this kind of event : it can takes 1 to 4 secondes to run.

Got a second one who looks like this

Code: Select all

commandArray = {}
 if (devicechanged['Inter lum salon'])  then
     commandArray['Lumiere Salon']='Toggle'
 end
 return commandArray
Result is the same

4 secondes for waiting a light up, that long, very long, and WAF go down under 0.

On french forum, someone found Some Sleep_second(1) on domoticz code (SQLHelper and another fie), and decide to set it at 100 MS before compiling, i try this and this works.
On my RPI testing machine i got better speed result than on my core i5 (who run near 1% on cpu usage, a Ferrari to go shopping).

But doing this doesn't allow update, and can be a source of non stability, even if i don't face this since 1 week.

What be done to speedup domoticz Event, reaction, to make it run faster, more reactive ?
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: How to speed up Domoticz event action

Post by Egregius »

Look at the logfile to see where the delay is.
I used to have 800-1200msec delay when using on/off action.
Now, with my pass2php script there's only 43msec between signal of pir and switch of light.
Lightning fast that is :mrgreen:
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: How to speed up Domoticz event action

Post by deennoo »

there is my log

Code: Select all


2016-10-06 21:44:10.999 (RFXTRXE) Lighting 2 (Inter lum salon)
2016-10-06 21:44:12.035 EventSystem: Script event triggered: Lum Salon
2016-10-06 21:44:11.832 (RFXTRXE) Lighting 2 (Inter lum salon)
2016-10-06 21:44:12.110 (zwave+) General/kWh (Conso TV Parents)
2016-10-06 21:44:12.382 (zwave+) General/kWh (Conso TV Parents)
2016-10-06 21:44:12.654 (RFLink Ser2net) General/kWh (Conso Lave Linge)
2016-10-06 21:44:12.925 (RFLink Ser2net) General/Voltage ($Conso lave linge 3)
2016-10-06 21:44:13.195 (RFLink Ser2net) Current ($Conso Lave Linge)
2016-10-06 21:44:13.705 LUA: TWICE : Lumiere Salon -> Off
2016-10-06 21:44:13.706 EventSystem: Script event triggered: Device Twice
2016-10-06 21:44:13.466 (RFLink Ser2net) Light/Switch (Lumiere Salon)
2016-10-06 21:44:13.739 (zwave+) Usage ($Prise TV Chambre Parents)
2016-10-06 21:44:14.833 (zwave+) Current ($Prise TV Chambre Parents Total Conso)
2016-10-06 21:44:15.739 RFLink Sending: 10;AB400D;000060;4;OFF
Last edited by deennoo on Thursday 06 October 2016 22:12, edited 1 time in total.
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: How to speed up Domoticz event action

Post by deennoo »

Egregius wrote:Look at the logfile to see where the delay is.
I used to have 800-1200msec delay when using on/off action.
Now, with my pass2php script there's only 43msec between signal of pir and switch of light.
Lightning fast that is :mrgreen:
Ok thanks for your script, can you give some usage exemple, i'm ready to try it, putting script adress on action ON ?
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: How to speed up Domoticz event action

Post by Egregius »

There's some explanation in http://www.domoticz.com/forum/viewtopic ... 23&t=12343
The script is created to NOT use the on/off action as those are executed with about 1 sec delay.
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: How to speed up Domoticz event action

Post by deennoo »

Egregius wrote:There's some explanation in http://www.domoticz.com/forum/viewtopic ... 23&t=12343
The script is created to NOT use the on/off action as those are executed with about 1 sec delay.
I check your website, with interest, my probleme is that first part of you tweak isn't in english (or french) and i'm not sure to understand google translation.

Will contact you on MP if i need.
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: How to speed up Domoticz event action

Post by Egregius »

Just ask in the topic mentioned above, I'll explain everything in English then, not in French, would cause to much errors for me ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest