Appel d'un script Python à partir d'un script LUA
Appel d'un script Python à partir d'un script LUA
Bonsoir,
J’aimerai savoir comment on fait pour lancer à partir d’un script LUA, un script Python ?
J’arrive bien à lancer mon script python depuis l' »Action On » et l' »Action Off » d’un interrupteur : « script://scripts\python/play.py scripts\python/lightDining_On.txt » mais impossible depuis un script LUA.
J'ai essayé plein de choses avec la commande "os.execute" mais en vain.
Merci
J’aimerai savoir comment on fait pour lancer à partir d’un script LUA, un script Python ?
J’arrive bien à lancer mon script python depuis l' »Action On » et l' »Action Off » d’un interrupteur : « script://scripts\python/play.py scripts\python/lightDining_On.txt » mais impossible depuis un script LUA.
J'ai essayé plein de choses avec la commande "os.execute" mais en vain.
Merci
Re: Appel d'un script Python à partir d'un script LUA
Salut,
Depuis un script LUA, il faut écrire:
Mais auparavant il faut mettre des autorisations sur le script:
cd /home/pi/domoticz/scripts/python
chmod 777 script_chauffage.py (ou chmod +x je ne sais pas...les puristes du site pourront trancher!
)
Depuis un script LUA, il faut écrire:
Code : Tout sélectionner
os.execute('sudo /home/pi/domoticz/scripts/python/script_chauffage.py')cd /home/pi/domoticz/scripts/python
chmod 777 script_chauffage.py (ou chmod +x je ne sais pas...les puristes du site pourront trancher!
Domoticz 2022.1/RFlink V1.1_R48/ prises: DIO, SCS/caméras IP/station météo Auriol/sondes Oregon/PIR/ZK1PA/Relevé compteur Gaz/téléinfo EDF/Mysensors:RGB-3D,Temp.,IR/Arrosage autonome/Google home/ ESP: IR,Temp.,relai,distance,OLED/Withings Ws30
Re: Appel d'un script Python à partir d'un script LUA
Salut,
Merci pour cette réponse mais je suis sous Windows...
Merci pour cette réponse mais je suis sous Windows...
Re: Appel d'un script Python à partir d'un script LUA
Pour ceux que ça intéresse, j'ai fini par arriver à le faire.
Voici un exemple d'appel d'un script python avec 1 paramètre :
Voici un exemple d'appel d'un script python avec 1 paramètre :
Code : Tout sélectionner
os.execute('start cmd /c C:/Python27/python.exe "C:/Program Files (x86)/Domoticz/scripts/python/play.py" "C:/Program Files (x86)/Domoticz/scripts/python/lightDining_On.txt"')
Re: Appel d'un script Python à partir d'un script LUA
Merci !
Je vais peut être me repencher sur le reboot quotidien de ma freebox via script... ça va sans doute m'aider
Je vais peut être me repencher sur le reboot quotidien de ma freebox via script... ça va sans doute m'aider
MiniPC W10 + RFXCom 433e + RFLINK
Elec : Téléinfo
Alexa + Alhau
MQTT...
(merci easydomoticz !)
Elec : Téléinfo
Alexa + Alhau
MQTT...
(merci easydomoticz !)
-
landaisbenj
- Messages : 695
- Inscription : 12 mars 2017, 19:24
Re: Appel d'un script Python à partir d'un script LUA
Pour info j'ai trouver une méthode pour rebooter la freebox par script lua.
J'ai fais le script il suffit de t'appuyer sur l'api de reboot du site des dev freebox.
Et si vous vous y connaissait en python ce serait bien de faire un plugin materiel pour la freebox. En voyant arriver la V7 bientôt il y a de très grandes chance qu'elle fasse de la domoticz et s'appuie sur l'api json...
Du coup il serait simple de faire un materiel freebox. J'ai l'idée mais je ne sais pas la développer...
J'ai fais le script il suffit de t'appuyer sur l'api de reboot du site des dev freebox.
Et si vous vous y connaissait en python ce serait bien de faire un plugin materiel pour la freebox. En voyant arriver la V7 bientôt il y a de très grandes chance qu'elle fasse de la domoticz et s'appuie sur l'api json...
Du coup il serait simple de faire un materiel freebox. J'ai l'idée mais je ne sais pas la développer...
Rpbi3b: Domoticz + Homebridge + Monit + Freebox scripts + Shellinabox; Rpbi2: Jarvis
Domoticz: Derniere stable; RFLINK: Dernière stable; Xiaomi Gateway
Domoticz: Derniere stable; RFLINK: Dernière stable; Xiaomi Gateway