Script LUA et Dimmer HUE

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 <\>.
PoDeZebi
Messages : 53
Inscription : 27 oct. 2020, 08:08

Script LUA et Dimmer HUE

Message par PoDeZebi »

Bonsoir,
Avec un peu d'aide, j'ai réussi à faire ce code :

Code : Tout sélectionner

commandArray = {}
Widget = 'Hue_Remote'
if otherdevices_svalues[ Widget ] == "On" then
    commandArray[#commandArray+1]={['HUE1']='On'} 
    commandArray[#commandArray+1]={['HUE1']='Set Level:80'}
    commandArray[#commandArray+1]={['HUE2']='On'}
    commandArray[#commandArray+1]={['HUE2']='Set Level:80'}
    commandArray[#commandArray+1]={['HUE3']='On'}
    commandArray[#commandArray+1]={['HUE3']='Set Level:80'}
end

if otherdevices_svalues[ Widget ] == "Off" then    
    commandArray[#commandArray+1]={['HUE1']='Off'}
    commandArray[#commandArray+1]={['HUE2']='Off'}
    commandArray[#commandArray+1]={['HUE3']='Off'}
    commandArray[#commandArray+1]={['HUE1']='Set Level:0'}
    commandArray[#commandArray+1]={['HUE2']='Set Level:0'}
    commandArray[#commandArray+1]={['HUE3']='Set Level:0'}
end
if otherdevices_svalues[ Widget ] ~= "On" and otherdevices_svalues[ Widget ] ~= "OFF" then
    DimVal = otherdevices_svalues[ Widget ]
    commandArray[#commandArray+1]={['HUE1']='Set Level:' .. DimVal}
    commandArray[#commandArray+1]={['HUE2']='Set Level:' .. DimVal}
    commandArray[#commandArray+1]={['HUE3']='Set Level:' .. DimVal}
end
return commandArray
A priori, ca fonctionne bien ! A priori...

EDIT !
J'arrive à allumer, éteindre, faire varier l'intensité !
L'idée maintenant, c'est de faire varier l'intensité de 5 en 5... parce que 1 par 1... C'est long :D

Merci de votre aide !

Merci à tous pour votre aide.
Dernière modification par PoDeZebi le 07 janv. 2021, 21:34, modifié 1 fois.
Keros
Messages : 6638
Inscription : 23 juil. 2019, 20:57

Re: Script LUA et Dimmer HUE

Message par Keros »

Alors, peux-tu éditer ton premier post et enlever la partie concernant les erreurs de la Zigate et les mettre dans un sujet dans le forum Zigate (Pipiche ne verra pas ta question ici).
Indique comment apparaisse ces logs : tu appuis sur un bouton ?

Concernant ton code, tu peux le simplifier en utilisant le format suivant :

Code : Tout sélectionner

If Toto = 1 then (Si ...)
 Tata =1
elseif Toto = 2 then (Sinon si ...)
 Tata = 2
else (sinon...)
 Tata = 0
End
Et concernant l'augmentation de 5 en 5, mets nous ton code, on pourra certainement t'aider à le faire fonctionner ;)
Comment bien utiliser le forum : Poser une question, Mettre un script, un fichier, une image ou des logs
Mes petits guides : Débuter en programmation, Le débogage, Le choix de matériel, Les sauvegardes
Ma présentation - Mes Tutos
PoDeZebi
Messages : 53
Inscription : 27 oct. 2020, 08:08

Re: Script LUA et Dimmer HUE

Message par PoDeZebi »

Merci pour ta réponse !
J'avous, j'ai codé ça avec les pieds :D
J'aurais pu faire encore mieux si je comprenais quelque chose au variable et fonction en LUA... mais la c'est encore un peu frais pour moi !

Voila mon code!

Code : Tout sélectionner

commandArray = {}
Widget = 'Hue_Remote'
local DimVal
local DimVal2

if otherdevices_svalues[ Widget ] == "On" then
    commandArray[#commandArray+1]={['HUE1']='On'} 
    commandArray[#commandArray+1]={['HUE1']='Set Level:80'}
    commandArray[#commandArray+1]={['HUE2']='On'}
    commandArray[#commandArray+1]={['HUE2']='Set Level:80'}
    commandArray[#commandArray+1]={['HUE3']='On'}
    commandArray[#commandArray+1]={['HUE3']='Set Level:80'}
    DimVal = otherdevices_svalues[ Widget ]
elseif otherdevices_svalues[ Widget ] == "Off" then    
    commandArray[#commandArray+1]={['HUE1']='Off'}
    commandArray[#commandArray+1]={['HUE2']='Off'}
    commandArray[#commandArray+1]={['HUE3']='Off'}
    commandArray[#commandArray+1]={['HUE1']='Set Level:0'}
    commandArray[#commandArray+1]={['HUE2']='Set Level:0'}
    commandArray[#commandArray+1]={['HUE3']='Set Level:0'}
    DimVal = otherdevices_svalues[ Widget ]
else 
    DimVal = otherdevices_svalues[ Widget ]
    print ('Valeur du dimmer : '..DimVal)
    if otherdevices_svalues[ Widget ] > DimVal then
        DimVal2 = DimVal +4
        commandArray[#commandArray+1]={['HUE1']='Set Level:' .. DimVal2}
        commandArray[#commandArray+1]={['HUE2']='Set Level:' .. DimVal2}
        commandArray[#commandArray+1]={['HUE3']='Set Level:' .. DimVal2}
    else
         DimVal2 = DimVal -4
        commandArray[#commandArray+1]={['HUE1']='Set Level:' .. DimVal2}
        commandArray[#commandArray+1]={['HUE2']='Set Level:' .. DimVal2}
        commandArray[#commandArray+1]={['HUE3']='Set Level:' .. DimVal2}
    end
end
return commandArray
J'ai pris en compte tes remarques, c'est un peu plus claire ! Je vais rajouter des coms aussi ;) ça fera plus genre "j'y connais kekchose !!!".

Mon problème c'est que mes valeurs ne s'incrémente que de 1. Je soupconne que mon DimVal ne soit pas une variable numérique, mais un type "string" ?

Merci de ton aide
Keros
Messages : 6638
Inscription : 23 juil. 2019, 20:57

Re: Script LUA et Dimmer HUE

Message par Keros »

PoDeZebi a écrit : 07 janv. 2021, 21:51 J'avous, j'ai codé ça avec les pieds
PoDeZebi a écrit : 07 janv. 2021, 21:51 Je vais rajouter des coms aussi ;) ça fera plus genre "j'y connais kekchose !!!".
Nous utilisons nos mains et notre temps libre pour te répondre et t'aider.



Les commentaires sont utile pour mettre des informations dans le code qui te permettrons de comprendre comment il fonctionne quand tu reviendras dessus dans 6 mois ou 1 an.

Rajoute des prints dans ton programme pour vérifier les valeurs prises par DimVal2 et ainsi connaitre ce que tu envois en commande à ta lampe.
Mets nous les logs.
Comment bien utiliser le forum : Poser une question, Mettre un script, un fichier, une image ou des logs
Mes petits guides : Débuter en programmation, Le débogage, Le choix de matériel, Les sauvegardes
Ma présentation - Mes Tutos
PoDeZebi
Messages : 53
Inscription : 27 oct. 2020, 08:08

Re: Script LUA et Dimmer HUE

Message par PoDeZebi »

Keros a écrit : 08 janv. 2021, 12:38
PoDeZebi a écrit : 07 janv. 2021, 21:51 J'avous, j'ai codé ça avec les pieds
PoDeZebi a écrit : 07 janv. 2021, 21:51 Je vais rajouter des coms aussi ;) ça fera plus genre "j'y connais kekchose !!!".
Nous utilisons nos mains et notre temps libre pour te répondre et t'aider.
Vraiment, ce n'était pas une critique envers toi, mais bien envers moi même, parce que j'ai conscience du piètre niveau que j'ai sur LUA. Je ne cherche qu'a comprendre ou m'amélioré ! Je suis désolé si tu l'as mal pris... Ce n'était pas le but du tout !

Pour en revenir a mon code, j'ai l'impression qu'il met un souk enorme ! Beaucoup beaucoup de log que je ne comprends pas. je vais te mettre l'intégralité, et je men excuse par avance...
J'ai juste fait un off, puis on, 3 fois +, 3 fois - et un off pour finir.
ça s'allume, s'éteinds... mais je n'ai pas l'impression de voir de variation de luminosité significative

Code : Tout sélectionner

2021-01-08 14:20:53.968 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01910010 already in queue this command is dropped
2021-01-08 14:20:53.968 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01910010 already in queue this command is dropped
2021-01-08 14:20:53.969 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01910010 already in queue this command is dropped
2021-01-08 14:20:53.969 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01910010 already in queue this command is dropped
2021-01-08 14:20:53.970 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01910010 already in queue this command is dropped
2021-01-08 14:20:53.881 Status: LUA: Valeur du dimmer : 61
2021-01-08 14:20:53.881 Status: LUA: Valeur du dimmer incrémenté : 57.0
2021-01-08 14:20:53.883 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 14:20:53.896 Status: LUA: Valeur du dimmer : 61
2021-01-08 14:20:53.896 Status: LUA: Valeur du dimmer incrémenté : 57.0
2021-01-08 14:20:53.897 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 14:20:53.930 Status: LUA: Valeur du dimmer : 61
2021-01-08 14:20:53.930 Status: LUA: Valeur du dimmer incrémenté : 57.0
2021-01-08 14:20:53.931 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 14:20:53.945 Status: LUA: Valeur du dimmer : 61
2021-01-08 14:20:53.945 Status: LUA: Valeur du dimmer incrémenté : 57.0
2021-01-08 14:20:53.946 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 14:22:34.496 (Zigate GateWay) UpdateDevice - (Zigate GateWay - lumi.weather_Temp+Hum-00158d000320ad31-01) 0:19.6;0;0
2021-01-08 14:22:34.498 (Zigate GateWay) UpdateDevice - (Température Humidité Barometre) 0:19.6;45.5;1;1004.2;3
2021-01-08 14:22:34.510 (Zigate GateWay) UpdateDevice - (Zigate GateWay - lumi.weather_Temp+Hum-00158d000320ad31-01) 0:0;45.5;1
2021-01-08 14:22:34.508 Status: LUA: Valeur du dimmer : 61
2021-01-08 14:22:34.508 Status: LUA: Valeur du dimmer incrémenté : 57.0
2021-01-08 14:22:34.509 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 14:44:25.270 Status: Incoming connection from: 192.168.1.101
2021-01-08 14:44:35.398 Status: Incoming connection from: 192.168.1.101
2021-01-08 14:44:35.397 Error: Failed login attempt from 192.168.1.101 for 'adminroot' !
2021-01-08 15:08:33.877 Status: Incoming connection from: 192.168.1.102
2021-01-08 15:10:57.711 (Zigate GateWay) [ MainThread] sendData - Warning 0063/02e52501010000 already in queue this command is dropped
2021-01-08 15:11:49.748 Status: EventSystem: reset all events...
2021-01-08 15:12:17.397 Status: (Zigate GateWay) Plugin Restart command : http://@127.0.0.1:8080/json.htm?type=command&param=updatehardware&htype=94&idx=6&name=Zigate GateWay&address=0.0.0.0&port=9999&serialport=/dev/ttyUSB0&Mode1=USB&Mode2=&Mode3=False&Mode4=9440&Mode5=&Mode6=0&extra=Zigate&enabled=true&datatimeout=0
2021-01-08 15:12:17.440 Error: Error parsing http request.
2021-01-08 15:12:37.742 Status: Incoming connection from: 192.168.1.101
2021-01-08 15:12:47.869 Status: Incoming connection from: 192.168.1.101
2021-01-08 15:12:47.869 Error: Failed login attempt from 192.168.1.101 for 'adminroot' !
2021-01-08 15:18:49.013 (Zigate GateWay) UpdateDevice - (Température Humidité Barometre) 0:19.3;45.5;1;1004.2;3
2021-01-08 15:18:49.040 (Zigate GateWay) UpdateDevice - (Zigate GateWay - lumi.weather_Temp+Hum-00158d000320ad31-01) 0:19.3;0;0
2021-01-08 15:18:49.055 (Zigate GateWay) UpdateDevice - (Zigate GateWay - lumi.weather_Temp-00158d000320ad31-01) 19.3:19.3
2021-01-08 15:18:49.070 (Zigate GateWay) UpdateDevice - (Température Humidité Barometre) 0:19.3;45.0;1;1004.2;3
2021-01-08 15:18:49.093 (Zigate GateWay) UpdateDevice - (Zigate GateWay - lumi.weather_Temp+Hum-00158d000320ad31-01) 0:0;45.0;1
2021-01-08 15:18:49.108 (Zigate GateWay) UpdateDevice - (Température Humidité Barometre) 0:19.3;45.0;1;1004.4;3
2021-01-08 15:18:49.129 (Zigate GateWay) UpdateDevice - (Zigate GateWay - lumi.weather_Baro-00158d000320ad31-01) 0:1004.4;3
2021-01-08 15:18:59.800 (Zigate GateWay) UpdateDevice - (Zigate GateWay - lumi.weather_Temp+Hum-00158d000320ad31-01) 0:19.3;0;0
2021-01-08 15:18:59.844 (Zigate GateWay) UpdateDevice - (Zigate GateWay - lumi.weather_Temp+Hum-00158d000320ad31-01) 0:0;45.0;1
2021-01-08 15:18:59.883 (Zigate GateWay) UpdateDevice - (Température Humidité Barometre) 0:19.3;45.0;1;1004.0;3
2021-01-08 15:18:59.933 (Zigate GateWay) UpdateDevice - (Zigate GateWay - lumi.weather_Baro-00158d000320ad31-01) 0:1004.0;3
2021-01-08 15:18:59.976 (Zigate GateWay) UpdateDevice - (Température Humidité Barometre) 0:19.3;45.0;1;1004.4;3
2021-01-08 15:19:00.022 (Zigate GateWay) UpdateDevice - (Zigate GateWay - lumi.weather_Baro-00158d000320ad31-01) 0:1004.4;3
2021-01-08 15:22:45.066 Status: EventSystem: reset all events...
2021-01-08 15:23:10.217 (Zigate GateWay) UpdateDevice - ( Hue_Remote) 0:Off
2021-01-08 15:23:10.268 (Zigate GateWay) UpdateDevice - ( HUE1) 0:Off
2021-01-08 15:23:10.318 (Zigate GateWay) UpdateDevice - ( HUE2) 0:Off
2021-01-08 15:23:10.341 (Zigate GateWay) UpdateDevice - ( HUE3) 0:Off
2021-01-08 15:23:10.365 (Zigate GateWay) [ MainThread] sendData - Warning 0092/02378d010b00 already in queue this command is dropped
2021-01-08 15:23:10.366 (Zigate GateWay) [ MainThread] sendData - Warning 0092/02025c010b00 already in queue this command is dropped
2021-01-08 15:23:10.366 (Zigate GateWay) [ MainThread] sendData - Warning 0092/02dcb3010b00 already in queue this command is dropped
2021-01-08 15:23:10.366 (Zigate GateWay) [ MainThread] sendData - Warning 0092/02378d010b00 already in queue this command is dropped
2021-01-08 15:23:10.367 (Zigate GateWay) [ MainThread] sendData - Warning 0092/02025c010b00 already in queue this command is dropped
2021-01-08 15:23:10.417 (Zigate GateWay) [ MainThread] sendData - Warning 0092/02dcb3010b00 already in queue this command is dropped
2021-01-08 15:23:10.418 (Zigate GateWay) [ MainThread] sendData - Warning 0092/02378d010b00 already in queue this command is dropped
2021-01-08 15:23:10.418 (Zigate GateWay) [ MainThread] sendData - Warning 0092/02025c010b00 already in queue this command is dropped
2021-01-08 15:23:10.245 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:10.298 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:10.331 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:10.355 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:11.646 (Zigate GateWay) [ZiGateForwarder_6] UpdateGroup - ( HUESalon) 0:57
2021-01-08 15:23:11.673 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:25.483 (Zigate GateWay) UpdateDevice - ( Hue_Remote) 1:On
2021-01-08 15:23:25.581 (Zigate GateWay) UpdateDevice - ( HUE1) 1:80
2021-01-08 15:23:25.620 (Zigate GateWay) UpdateDevice - ( HUE2) 1:80
2021-01-08 15:23:25.654 (Zigate GateWay) UpdateDevice - ( HUE3) 1:80
2021-01-08 15:23:25.689 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:25.690 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:25.691 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:25.691 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:25.692 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:25.743 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:25.743 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:25.743 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:25.800 (Zigate GateWay) UpdateDevice - ( HUE1) 1:2
2021-01-08 15:23:25.823 (Zigate GateWay) [ZiGateForwarder_6] UpdateGroup - ( HUESalon) 0:43
2021-01-08 15:23:25.849 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:25.849 (Zigate GateWay) UpdateDevice - ( HUE1) 1:80
2021-01-08 15:23:25.872 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:25.873 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:25.874 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:25.874 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:25.874 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:25.925 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:25.926 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:25.509 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:25.605 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:25.639 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:25.674 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:25.813 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:25.835 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:25.863 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:26.031 (Zigate GateWay) UpdateDevice - ( HUE2) 1:2
2021-01-08 15:23:26.054 (Zigate GateWay) [ZiGateForwarder_6] UpdateGroup - ( HUESalon) 1:16
2021-01-08 15:23:26.079 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:26.079 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:26.079 (Zigate GateWay) UpdateDevice - ( HUE2) 1:80
2021-01-08 15:23:26.102 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:26.153 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:26.153 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:26.153 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:26.359 (Zigate GateWay) UpdateDevice - ( HUE3) 1:2
2021-01-08 15:23:26.381 (Zigate GateWay) [ZiGateForwarder_6] UpdateGroup - ( HUESalon) 1:2
2021-01-08 15:23:26.406 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:26.407 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:26.408 (Zigate GateWay) UpdateDevice - ( HUE3) 1:80
2021-01-08 15:23:26.474 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:26.476 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:26.477 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:26.490 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:26.491 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:26.492 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:26.044 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:26.066 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:26.092 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:26.371 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:26.394 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:26.436 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:30.832 (Zigate GateWay) [ZiGateForwarder_6] UpdateGroup - ( HUESalon) 1:21
2021-01-08 15:23:30.940 (Zigate GateWay) [ZiGateForwarder_6] UpdateGroup - ( HUESalon) 1:60
2021-01-08 15:23:30.988 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:30.989 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:30.990 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:30.864 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:30.957 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:31.398 (Zigate GateWay) [ZiGateForwarder_6] UpdateGroup - ( HUESalon) 1:80
2021-01-08 15:23:31.446 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:31.447 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:31.447 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01cc0010 already in queue this command is dropped
2021-01-08 15:23:31.418 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:34.975 (Zigate GateWay) UpdateDevice - ( Hue_Remote) 1:80
2021-01-08 15:23:34.998 Status: LUA: Valeur du dimmer : 80
2021-01-08 15:23:34.998 Status: LUA: Valeur du dimmer incrémenté : 76.0
2021-01-08 15:23:35.027 (Zigate GateWay) UpdateDevice - ( HUE1) 1:76
2021-01-08 15:23:35.054 (Zigate GateWay) UpdateDevice - ( HUE2) 1:76
2021-01-08 15:23:35.076 (Zigate GateWay) UpdateDevice - ( HUE3) 1:76
2021-01-08 15:23:35.100 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01c20010 already in queue this command is dropped
2021-01-08 15:23:35.100 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01c20010 already in queue this command is dropped
2021-01-08 15:23:35.101 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01c20010 already in queue this command is dropped
2021-01-08 15:23:35.101 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01c20010 already in queue this command is dropped
2021-01-08 15:23:35.102 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01c20010 already in queue this command is dropped
2021-01-08 15:23:35.152 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01c20010 already in queue this command is dropped
2021-01-08 15:23:35.001 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:35.042 Status: LUA: Valeur du dimmer : 80
2021-01-08 15:23:35.042 Status: LUA: Valeur du dimmer incrémenté : 76.0
2021-01-08 15:23:35.043 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:35.065 Status: LUA: Valeur du dimmer : 80
2021-01-08 15:23:35.065 Status: LUA: Valeur du dimmer incrémenté : 76.0
2021-01-08 15:23:35.066 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:35.087 Status: LUA: Valeur du dimmer : 80
2021-01-08 15:23:35.087 Status: LUA: Valeur du dimmer incrémenté : 76.0
2021-01-08 15:23:35.089 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:36.092 (Zigate GateWay) UpdateDevice - ( HUE1) 1:78
2021-01-08 15:23:36.145 (Zigate GateWay) UpdateDevice - ( HUE1) 1:76
2021-01-08 15:23:36.177 (Zigate GateWay) [ZiGateForwarder_6] UpdateGroup - ( HUESalon) 1:79
2021-01-08 15:23:36.200 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01c20010 already in queue this command is dropped
2021-01-08 15:23:36.201 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01c20010 already in queue this command is dropped
2021-01-08 15:23:36.201 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01c20010 already in queue this command is dropped
2021-01-08 15:23:36.252 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01c20010 already in queue this command is dropped
2021-01-08 15:23:36.252 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01c20010 already in queue this command is dropped
2021-01-08 15:23:36.253 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01c20010 already in queue this command is dropped
2021-01-08 15:23:36.759 (Zigate GateWay) UpdateDevice - ( HUE2) 1:77
2021-01-08 15:23:36.783 (Zigate GateWay) [ZiGateForwarder_6] UpdateGroup - ( HUESalon) 1:78
2021-01-08 15:23:36.808 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01c20010 already in queue this command is dropped
2021-01-08 15:23:36.808 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01c20010 already in queue this command is dropped
2021-01-08 15:23:36.809 (Zigate GateWay) UpdateDevice - ( HUE2) 1:76
2021-01-08 15:23:36.831 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01c20010 already in queue this command is dropped
2021-01-08 15:23:36.832 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01c20010 already in queue this command is dropped
2021-01-08 15:23:36.832 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01c20010 already in queue this command is dropped
2021-01-08 15:23:36.833 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01c20010 already in queue this command is dropped
2021-01-08 15:23:36.884 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01c20010 already in queue this command is dropped
2021-01-08 15:23:36.885 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01c20010 already in queue this command is dropped
2021-01-08 15:23:36.885 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01c20010 already in queue this command is dropped
2021-01-08 15:23:36.116 Status: LUA: Valeur du dimmer : 80
2021-01-08 15:23:36.116 Status: LUA: Valeur du dimmer incrémenté : 76.0
2021-01-08 15:23:36.120 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:36.165 Status: LUA: Valeur du dimmer : 80
2021-01-08 15:23:36.165 Status: LUA: Valeur du dimmer incrémenté : 76.0
2021-01-08 15:23:36.166 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:36.187 Status: LUA: Valeur du dimmer : 80
2021-01-08 15:23:36.187 Status: LUA: Valeur du dimmer incrémenté : 76.0
2021-01-08 15:23:36.189 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:36.770 Status: LUA: Valeur du dimmer : 80
2021-01-08 15:23:36.770 Status: LUA: Valeur du dimmer incrémenté : 76.0
2021-01-08 15:23:36.771 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:36.793 Status: LUA: Valeur du dimmer : 80
2021-01-08 15:23:36.793 Status: LUA: Valeur du dimmer incrémenté : 76.0
2021-01-08 15:23:36.795 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:36.820 Status: LUA: Valeur du dimmer : 80
2021-01-08 15:23:36.820 Status: LUA: Valeur du dimmer incrémenté : 76.0
2021-01-08 15:23:36.821 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:37.299 (Zigate GateWay) [ZiGateForwarder_6] UpdateGroup - ( HUESalon) 1:77
2021-01-08 15:23:37.351 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01c20010 already in queue this command is dropped
2021-01-08 15:23:37.352 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01c20010 already in queue this command is dropped
2021-01-08 15:23:37.353 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01c20010 already in queue this command is dropped
2021-01-08 15:23:37.457 (Zigate GateWay) [ZiGateForwarder_6] UpdateGroup - ( HUESalon) 1:76
2021-01-08 15:23:37.506 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01c20010 already in queue this command is dropped
2021-01-08 15:23:37.506 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01c20010 already in queue this command is dropped
2021-01-08 15:23:37.322 Status: LUA: Valeur du dimmer : 80
2021-01-08 15:23:37.322 Status: LUA: Valeur du dimmer incrémenté : 76.0
2021-01-08 15:23:37.325 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:37.473 Status: LUA: Valeur du dimmer : 80
2021-01-08 15:23:37.473 Status: LUA: Valeur du dimmer incrémenté : 76.0
2021-01-08 15:23:37.475 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:51.408 (Zigate GateWay) UpdateDevice - ( Hue_Remote) 1:81
2021-01-08 15:23:51.458 (Zigate GateWay) UpdateDevice - ( HUE1) 1:77
2021-01-08 15:23:51.510 (Zigate GateWay) UpdateDevice - ( HUE2) 1:77
2021-01-08 15:23:51.559 (Zigate GateWay) UpdateDevice - ( HUE3) 1:77
2021-01-08 15:23:51.610 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01c40010 already in queue this command is dropped
2021-01-08 15:23:51.611 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01c40010 already in queue this command is dropped
2021-01-08 15:23:51.612 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01c40010 already in queue this command is dropped
2021-01-08 15:23:51.614 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01c40010 already in queue this command is dropped
2021-01-08 15:23:51.615 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01c40010 already in queue this command is dropped
2021-01-08 15:23:51.616 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01c40010 already in queue this command is dropped
2021-01-08 15:23:51.617 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01c40010 already in queue this command is dropped
2021-01-08 15:23:51.618 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01c40010 already in queue this command is dropped
2021-01-08 15:23:51.431 Status: LUA: Valeur du dimmer : 81
2021-01-08 15:23:51.432 Status: LUA: Valeur du dimmer incrémenté : 77.0
2021-01-08 15:23:51.435 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:51.482 Status: LUA: Valeur du dimmer : 81
2021-01-08 15:23:51.482 Status: LUA: Valeur du dimmer incrémenté : 77.0
2021-01-08 15:23:51.486 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:51.534 Status: LUA: Valeur du dimmer : 81
2021-01-08 15:23:51.534 Status: LUA: Valeur du dimmer incrémenté : 77.0
2021-01-08 15:23:51.537 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:51.582 Status: LUA: Valeur du dimmer : 81
2021-01-08 15:23:51.582 Status: LUA: Valeur du dimmer incrémenté : 77.0
2021-01-08 15:23:51.585 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:23:56.582 (Zigate GateWay) [ZiGateForwarder_6] UpdateGroup - ( HUESalon) 1:77
2021-01-08 15:23:56.593 Status: LUA: Valeur du dimmer : 81
2021-01-08 15:23:56.593 Status: LUA: Valeur du dimmer incrémenté : 77.0
2021-01-08 15:23:56.595 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:24:04.187 (Zigate GateWay) UpdateDevice - ( Hue_Remote) 1:80
2021-01-08 15:24:04.285 (Zigate GateWay) UpdateDevice - ( HUE1) 1:76
2021-01-08 15:24:04.325 (Zigate GateWay) UpdateDevice - ( HUE2) 1:76
2021-01-08 15:24:04.348 (Zigate GateWay) UpdateDevice - ( HUE3) 1:76
2021-01-08 15:24:04.371 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01c20010 already in queue this command is dropped
2021-01-08 15:24:04.371 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01c20010 already in queue this command is dropped
2021-01-08 15:24:04.372 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02dcb3010b01c20010 already in queue this command is dropped
2021-01-08 15:24:04.372 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02378d010b01c20010 already in queue this command is dropped
2021-01-08 15:24:04.372 (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01c20010 already in queue this command is dropped
2021-01-08 15:24:04.211 Status: LUA: Valeur du dimmer : 80
2021-01-08 15:24:04.212 Status: LUA: Valeur du dimmer incrémenté : 76.0
2021-01-08 15:24:04.214 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:24:04.309 Status: LUA: Valeur du dimmer : 80
2021-01-08 15:24:04.310 Status: LUA: Valeur du dimmer incrémenté : 76.0
2021-01-08 15:24:04.313 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:24:04.336 Status: LUA: Valeur du dimmer : 80
2021-01-08 15:24:04.336 Status: LUA: Valeur du dimmer incrémenté : 76.0
2021-01-08 15:24:04.338 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:24:04.359 Status: LUA: Valeur du dimmer : 80
2021-01-08 15:24:04.359 Status: LUA: Valeur du dimmer incrémenté : 76.0
2021-01-08 15:24:04.360 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:24:05.962 (Zigate GateWay) [ZiGateForwarder_6] UpdateGroup - ( HUESalon) 1:76
2021-01-08 15:24:05.973 Status: LUA: Valeur du dimmer : 80
2021-01-08 15:24:05.973 Status: LUA: Valeur du dimmer incrémenté : 76.0
2021-01-08 15:24:05.974 Status: EventSystem: Script event triggered: HUE Remote
2021-01-08 15:24:18.444 (Zigate GateWay) UpdateDevice - ( Hue_Remote) 0:Off
2021-01-08 15:24:18.494 (Zigate GateWay) UpdateDevice - ( HUE1) 0:Off
2021-01-08 15:24:18.543 (Zigate GateWay) UpdateDevice - ( HUE2) 0:Off
2021-01-08 15:24:18.567 (Zigate GateWay) UpdateDevice - ( HUE3) 0:Off
Encore désolé pour ce Km de log imbouffable...

Merci de ton aide
Dernière modification par Keros le 08 janv. 2021, 17:08, modifié 1 fois.
Raison : Suppression d'un login potentiel
Keros
Messages : 6638
Inscription : 23 juil. 2019, 20:57

Re: Script LUA et Dimmer HUE

Message par Keros »

Alors plusieurs choses :

1- Il y a des logs bizarre pour la Zigate mais ça, il faut voir avec Pipiche dans l'autre section du forum.

Mais quand je vois (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01c20010 already in queue this command is dropped, je me dis qu'il doit y avoir des choses qui ne fonctionnent pas.

2- Quand tu as un script qui ne fonctionne pas avec plusieurs actions (ici 3 ampoules), tu réduis à une seul action pour simplifier. Quand ça fonctionnera pour 1 alors tu pourras ajouter les deux autres ;)

3- Essaye d'aller plus loin dans le débogage et mettant un print après chaque If ou else afin de savoir tout ce que fait ton programme.
J'ai écrit quelques lignes dans ma signature à propos du débogage, tu y trouveras peut-être des infos.

4- Pourquoi as tu besoin de mettre l'ampoule à ON puis de faire un Set Level ? Le Set Level ne suffit pas ?

5- Ton log ... Il y a beaucoup de chose. Tu pourrais indiquer les moments où tu fais les actions sur les boutons ? (telle ligne j'ai appuyé sur tel bouton .... cette ligne j'ai appuyé sur un autre) Tu peux te caler par rapport à l'heure de DomoticZ (affichée en haut à gauche) et faire des actions toutes les 15 secondes par exemple.
Comment bien utiliser le forum : Poser une question, Mettre un script, un fichier, une image ou des logs
Mes petits guides : Débuter en programmation, Le débogage, Le choix de matériel, Les sauvegardes
Ma présentation - Mes Tutos
PoDeZebi
Messages : 53
Inscription : 27 oct. 2020, 08:08

Re: Script LUA et Dimmer HUE

Message par PoDeZebi »

Keros a écrit : 08 janv. 2021, 17:24 Alors plusieurs choses :

1- Il y a des logs bizarre pour la Zigate mais ça, il faut voir avec Pipiche dans l'autre section du forum.

Mais quand je vois (Zigate GateWay) [ MainThread] sendData - Warning 0081/02025c010b01c20010 already in queue this command is dropped, je me dis qu'il doit y avoir des choses qui ne fonctionnent pas.
Ca tu l'as vu, j'ai déjà posté sur la section zigate, je suis venu ici sur les conseil de Pipiche !
Keros a écrit : 08 janv. 2021, 17:24 2- Quand tu as un script qui ne fonctionne pas avec plusieurs actions (ici 3 ampoules), tu réduis à une seul action pour simplifier. Quand ça fonctionnera pour 1 alors tu pourras ajouter les deux autres ;)
Pour le coup, je pensais que ca ne generai pas ! mais je suis tes conseils !!! Je vais mettre en com les HUE2 et HUE3
Keros a écrit : 08 janv. 2021, 17:24 3- Essaye d'aller plus loin dans le débogage et mettant un print après chaque If ou else afin de savoir tout ce que fait ton programme.
J'ai écrit quelques lignes dans ma signature à propos du débogage, tu y trouveras peut-être des infos.
J'y vais de ce pas
Keros a écrit : 08 janv. 2021, 17:24 4- Pourquoi as tu besoin de mettre l'ampoule à ON puis de faire un Set Level ? Le Set Level ne suffit pas ?
Pas de passion ! Je voulais juste imposé un éclairage suffisant à l'allumage, mais si ca te semble problématique : pouf y'a pu !
Keros a écrit : 08 janv. 2021, 17:24 5- Ton log ... Il y a beaucoup de chose. Tu pourrais indiquer les moments où tu fais les actions sur les boutons ? (telle ligne j'ai appuyé sur tel bouton .... cette ligne j'ai appuyé sur un autre) Tu peux te caler par rapport à l'heure de DomoticZ (affichée en haut à gauche) et faire des actions toutes les 15 secondes par exemple.
Je m'en fais faire des tests, du nettoyage, et je reviens dans une petite heure !

Merci Merci merci !!!!
PoDeZebi
Messages : 53
Inscription : 27 oct. 2020, 08:08

Re: Script LUA et Dimmer HUE

Message par PoDeZebi »

Je reprend mon problème de A à Z !
J'ai un Device "hue Remote" qui correspond à la télécommande censée commander mes ampoules.
J'ai un groupe dans la zigate, qui m'a créer un device dans domoticz : Tout va bien pour l'instant !
J'ai ce code :
(promis, il est de moi :) )

Code : Tout sélectionner

commandArray = {}
print (' #### DEBUT DU SCRIPT HUE REMOTE ####')
------------------------------
-- Definition des variables --
------------------------------
Widget = 'Hue_Remote'
local DimVal
local DimVal2

------------------------------
--          If On           --
------------------------------
if otherdevices_svalues[ Widget ] == "On" then
    print ('___ Remote sur On ___')
    otherdevices_svalues[ Widget ] = 80
    print ( '____ Dimmer = ' ..otherdevices_svalues[ Widget ] )
    DimVal = otherdevices_svalues[ Widget ]
------------------------------
--         If Off           --
------------------------------
elseif otherdevices_svalues[ Widget ] == "Off" then
    print ('___ Remote sur Off ___')
-------------------------------
--         If nombre         --
-------------------------------
else 
    print ('____ Remote sur dimmer ___')
    DimVal2 = otherdevices_svalues[ Widget ]
    print ('____ Dimmer Update = '.. DimVal2 ..' ____')
    
end

print (' #### FIN DU SCRIPT HUE REMOTE ####')
return commandArray

En reponse, j'ai cela dans les logs

Code : Tout sélectionner

2021-01-08 22:56:03.790 (Zigate GateWay) UpdateDevice - ( Hue_Remote) 1:On
2021-01-08 22:56:03.800 Status: LUA: #### DEBUT DU SCRIPT HUE REMOTE ####
2021-01-08 22:56:03.800 Status: LUA: ___ Remote sur On ___
2021-01-08 22:56:03.800 Status: LUA: 80
2021-01-08 22:56:03.800 Status: LUA: #### FIN DU SCRIPT HUE REMOTE ####
2021-01-08 22:57:28.752 Status: EventSystem: reset all events...
2021-01-08 22:57:33.405 (Zigate GateWay) UpdateDevice - ( Hue_Remote) 0:Off
2021-01-08 22:57:33.415 Status: LUA: #### DEBUT DU SCRIPT HUE REMOTE ####
2021-01-08 22:57:33.415 Status: LUA: ___ Remote sur Off ___
2021-01-08 22:57:33.415 Status: LUA: #### FIN DU SCRIPT HUE REMOTE ####
2021-01-08 22:57:37.232 (Zigate GateWay) UpdateDevice - ( Hue_Remote) 1:On
2021-01-08 22:57:37.243 Status: LUA: #### DEBUT DU SCRIPT HUE REMOTE ####
2021-01-08 22:57:37.243 Status: LUA: ___ Remote sur On ___
2021-01-08 22:57:37.243 Status: LUA: ____ Dimmer = 80
2021-01-08 22:57:37.243 Status: LUA: #### FIN DU SCRIPT HUE REMOTE ####
2021-01-08 22:57:43.049 (Zigate GateWay) UpdateDevice - ( Hue_Remote) 1:95
2021-01-08 22:57:43.059 Status: LUA: #### DEBUT DU SCRIPT HUE REMOTE ####
2021-01-08 22:57:43.059 Status: LUA: ____ Remote sur dimmer ___
2021-01-08 22:57:43.059 Status: LUA: ____ Dimmer Update = 95 ____
2021-01-08 22:57:43.059 Status: LUA: #### FIN DU SCRIPT HUE REMOTE ####
Le ON : C'est ok !
Le OFF : C'est ok !
Le DImmer c'est ok aussi ... mais voila, dans l'idée, il va falloir que je test si le dimmer augmente ou diminue afin d'augmenter ou baisser de 5% à chaque pression... Du coup j'aimerai à l'allumage forcer mon dimmer à 80% (comme ca je test si la pression provoque un chiffre sup ou inf... ).
Et ça comme tu le constate, ca ne marche pas : Je ne sais pas comment faire pour dire à ce widget "Tu te mets à 80%" (et tu fermes ta... bref...)

Merci encore !
Keros
Messages : 6638
Inscription : 23 juil. 2019, 20:57

Re: Script LUA et Dimmer HUE

Message par Keros »

Bien voilà des logs explicites :D

Par contre, je ne comprends pas comme tu fais fonctionner ton dimmer :
  • Dans le script, tu ne fais afficher qu'une valeur
  • Dans les logs, on voit une valeur de 95 alors que juste avant, tu as fait un "On" donc 80 ???
A quoi sert la ligne DimVal = otherdevices_svalues[ Widget ] dans le "If ON" ?
Comment bien utiliser le forum : Poser une question, Mettre un script, un fichier, une image ou des logs
Mes petits guides : Débuter en programmation, Le débogage, Le choix de matériel, Les sauvegardes
Ma présentation - Mes Tutos
PoDeZebi
Messages : 53
Inscription : 27 oct. 2020, 08:08

Re: Script LUA et Dimmer HUE

Message par PoDeZebi »

Merci pour le temps que tu m'accordes !
En effet, pour le moment, je veux juste être sur de contrôler mon dimmer. une fois que tout sera ok, que je serais sur de pas générer des problemes à droite à gauche, je réappliquerai les valeurs du dimmer sur mes ampoules !
Je ne sais pas si c'est la bonne méthode, mais j'ai l'impression que c'est plus "safe" pour l'ensemble du systeme !

Pour le deuxieme point, c'est justement là le problème !
- j'allume, je fixe le dimmer à 80 => ca fonctionne, je vois bien le Widget passer à on, puis le slider sur 80.
- Je fais une pression sur "+" => tu vois bien 95, le slider va directement sur cette valeur, sans s'incrémeter de un !
- Je fais une pression sur "-" => Il fait la même chose !!! direct sur 95

Pour info si je fais "-" jusqu'à 35 %, je passe sur off, puis on, je passe à 80. Mais une pression sur +/- je repasse à 35 !

pour la ligne DimVal = otherdevices_svalues[ Widget ] je pensais qu'en mettant la valeur du dimmer dans une variable, je pourrais plus simplement l'incrémenter par la suite, mais ça ne fonctionne pas du tout.
J'avoue que je ne sais pas trop par quel bout l'attaquer :(

Merci !
Répondre