Script PIR avec déclenchement multiple

Forum dédié aux problématiques concernant les scripts pour DomoticZ.
Entourez votre code et les logs avec les balises nommées code grâce au bouton <\>.
jeannot
Messages : 40
Inscription : 07 avr. 2019, 20:27

Re: Script PIR avec déclenchement multiple

Message par jeannot »

en début j'ai renseigné ip et port , pas user et pwd .
sur le log plus d'erreurs , j'ai la création de toutes variables mais rien ne se passe .

mon script avec toutes corrections :

Code : Tout sélectionner

dofile('/home/pi/domoticz/scripts/lua/modules.lua')
local debug = true  

commandArray = {}

    -- radar0
    if  stateChange('radar0') == "On" and (timeofday['Nighttime'])
    then
        commandArray['Eclairage_Ext'] = "On"
        commandArray['inter_chalet_Virtuel'] = "On"
        print("Radar mode nuit")
    end
    
    if  stateChange('radar0') == "On" and (timeofday['Daytime'])
    then
        commandArray['carillon'] = "On"
        print("Ding dong mode jour")
         
    end

    ---- carillon   sur ouverture1 
    if stateChange('ouverture1') == "Open" 
    then
        commandArray['carillon'] = "On"
        print("Chalet ouvert")
    end
        
    --- chalet_inter_virtuel
        
    if  stateChange('inter_chalet_Virtuel') == "On" 
    then
            commandArray['Eclairage_chalet'] = "Off"
    elseif 
            stateChange('inter_chalet_Virtuel') == "Off"
    then
            commandArray['Eclairage_chalet'] = "On"
    end
            
return commandArray
jeannot
Messages : 40
Inscription : 07 avr. 2019, 20:27

Re: Script PIR avec déclenchement multiple

Message par jeannot »

J'ai ajouté les variables et ça semble fonctionner .
Merci pas facile sans votre aide.
Répondre