Domoticz run script but nothing happen...sometimes.

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!
Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
User avatar
bueno79
Posts: 96
Joined: Wednesday 08 March 2017 11:26
Target OS: Raspberry Pi
Domoticz version: 4.9700
Location: France
Contact:

Domoticz run script but nothing happen...sometimes.

Post by bueno79 » Tuesday 06 November 2018 12:03

hi,

here is the info :
Version: 4.9700
Platform: rpi3
Plugin/Hardware: zwave
Description:
I used to run a script every day at 9am to start the pool. the instruction is "On FOR XXX". Sometimes the pool is not starting. No errors in logs. I reboot my rpi3 and the next day it work.

How to get more info on this problem ?

best regards

User avatar
emme
Posts: 936
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Domoticz run script but nothing happen...sometimes.

Post by emme » Tuesday 06 November 2018 12:15

could you describe a bit better how the system interact with the physical switch?

is that a zWave/ESP/MySensors/etc etc switch?

could you post the script?
ciao
M
The most dangerous phrase in any language is:
"We always done this way"

User avatar
bueno79
Posts: 96
Joined: Wednesday 08 March 2017 11:26
Target OS: Raspberry Pi
Domoticz version: 4.9700
Location: France
Contact:

Re: Domoticz run script but nothing happen...sometimes.

Post by bueno79 » Tuesday 06 November 2018 18:05

hi,

thx for your help. Yes i communicate with Zwave.The script catch the temperature outside and start the pump for X hours regarding the value of the temperature. I can see in Logs "Pompes pour 6 heures" but the pump is still off. If I click on the button in the web UI or on my phone...it works ! I f I reboot my rpi, tomorrow it will works for few days...then...it will stop to work. I did not get this problem before. here is the script :

Code: Select all

package.path = package.path..";/home/pi/domoticz/scripts/lua/?.lua"
require "modules"

local t = os.date("*t")

commandArray = {}

if (otherdevices['Pompe Piscine - Mode Nuit'] == 'Off') then
    if (t.hour == 09) and (t.min == 00 ) and (uservariables['Pompe_Control'] == "OFF") then
        if (uservariables['Temp Ext Matin'] >= 0.0 and uservariables['Temp Ext Matin'] <= 9.0) then
            commandArray['Pompe de la Piscine'] = "On FOR 120" -- on allume 2 heures la pompe
            print("Pompe pour 2 heures")
            commandArray['Variable:Pompe_Control'] = 'ON'
        end
        if (uservariables['Temp Ext Matin'] > 9.0 and uservariables['Temp Ext Matin'] <= 18.0) then
            commandArray['Pompe de la Piscine'] = "On FOR 360" -- on allume 6 heures la pompe
            print("Pompe pour 6 heures")
            commandArray['Variable:Pompe_Control'] = 'ON'
        end
        if (uservariables['Temp Ext Matin'] > 18.0 and uservariables['Temp Ext Matin'] <= 24.0) then
            commandArray['Pompe de la Piscine'] = "On FOR 600" -- on allume 10 heures la pompe
            print("Pompe pour 10 heures")    
            commandArray['Variable:Pompe_Control'] = 'ON'
        end
        if (uservariables['Temp Ext Matin'] > 24.0 ) then
            commandArray['Pompe de la Piscine'] = "On FOR 840" -- on allume 12 heures la pompe
            print("Pompe pour 14 heures")    
            commandArray['Variable:Pompe_Control'] = 'ON'
        end
    end
    
    if (t.hour == 09) and (t.min == 01 ) and (uservariables['Pompe_Control'] == "ON") then
        commandArray['Variable:Pompe_Control'] = 'OFF'
    end
end

if (otherdevices['Pompe Piscine - Mode Nuit'] == 'On') then
    if (t.hour == 23) and (t.min == 01 ) and (uservariables['Pompe_Control'] == "OFF") then
        if (uservariables['Temp Ext Matin'] >= 0.0 and uservariables['Temp Ext Matin'] <= 9.0) then
            commandArray['Pompe de la Piscine'] = "On FOR 120" -- on allume 2 heures la pompe
            print("Pompe pour 2 heures")
            commandArray['Variable:Pompe_Control'] = 'ON'
        end
        if (uservariables['Temp Ext Matin'] > 9.0 and uservariables['Temp Ext Matin'] <= 18.0) then
            commandArray['Pompe de la Piscine'] = "On FOR 360" -- on allume 6 heures la pompe
            print("Pompe pour 6 heures")
            commandArray['Variable:Pompe_Control'] = 'ON'
        end
        if (uservariables['Temp Ext Matin'] > 18.0 and uservariables['Temp Ext Matin'] <= 24.0) then
            commandArray['Pompe de la Piscine'] = "On FOR 600" -- on allume 10 heures la pompe
            print("Pompe pour 10 heures")    
            commandArray['Variable:Pompe_Control'] = 'ON'
        end
        if (uservariables['Temp Ext Matin'] > 24.0 ) then
            commandArray['Pompe de la Piscine'] = "On FOR 720" -- on allume 12 heures la pompe
            print("Pompe pour 12 heures")    
            commandArray['Variable:Pompe_Control'] = 'ON'
        end
    end
    
    if (t.hour == 23) and (t.min == 02 ) and (uservariables['Pompe_Control'] == "ON") then
        commandArray['Variable:Pompe_Control'] = 'OFF'
    end
end
-- if (t.hour == 09) and (t.min == 02 ) and (uservariables['Pompe_Control'] == "ON") then
   --  commandArray['Variable:Pompe_Control'] = 'OFF'
--end

return commandArray

pigloox
Posts: 77
Joined: Wednesday 10 February 2016 0:02
Target OS: Raspberry Pi
Domoticz version: BETA
Location: France
Contact:

Re: Domoticz run script but nothing happen...sometimes.

Post by pigloox » Monday 12 November 2018 0:04

hi,

same issue for me with blockly,
V4.10181 on RPI
RPI3 Stretch (Hard disk)
-RFXtrx433 USB
-OpenZwave USB
-Teleinfo USB

User avatar
bueno79
Posts: 96
Joined: Wednesday 08 March 2017 11:26
Target OS: Raspberry Pi
Domoticz version: 4.9700
Location: France
Contact:

Re: Domoticz run script but nothing happen...sometimes.

Post by bueno79 » Monday 12 November 2018 16:50

just remove yana server, some old programs (script to pass speech to google home) and some old programs...will see if it is more stable.

sexyboy
Posts: 18
Joined: Tuesday 25 September 2018 16:34
Target OS: Linux
Domoticz version:
Contact:

Re: Domoticz run script but nothing happen...sometimes.

Post by sexyboy » Tuesday 13 November 2018 1:46

I'm running the latest beta 4.10179
Build Hash: f0985571
Build Date: 2018-11-07 14:30:43

On Ubuntu 18.04

It seems like that the new Event editor on the latest Beta is not saving the newly create scripts/event files onto the disk under domoticz/scripts/dzVents/generated_scripts/.

If I touch a new file and save data to it subsequently it starts working.

Thanks in advance.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests