Bonjour à tous,
J’essaie d’utiliser une variable dans un script php.
J’ai mis ma commande dans le chemin du fichier (cf. capture ci-dessous):
Dans mon fichier php, j’utilise
$valeurCharge = (int)($argv[1] ?? 0); pour récupérer la valeur puis
$data = [ 'mode' => 1, 'power' => $valeurCharge, ];
pour utiliser la valeur.
J’ai l’erreur suivante à l’exécution:
Erreur exécution de la commande [Energies][Actions_Cloud_Izypower][Charge_intell] : Erreur sur sudo chmod +x /var/www/html/plugins/script/data/charge_intell.php 2>/dev/null;php /var/www/html/plugins/script/data/charge_intell.php -578 2>&1 valeur retournée : 255. Détails : PHP Parse error: syntax error, unexpected token "[", expecting "function" or "fn" or "static" or "#[" in /var/www/html/plugins/script/data/charge_intell.php on line 13
Merci d’avance pour votre aide.
Bien cordialement.
Informations Jeedom
Core : 4.5.3 (master)
DNS Jeedom : non
Plugin : wifilightV2
Version : 2026-03-07 12:04:41 (stable)
Statut Démon : Démarré - (2026-05-24 12:45:15)
Santé
🟢 Matériel : diy
🟢 Système à jour : OK
🟢 Cron actif : OK
🟢 Scénario actif : OK
🟢 Démarré : OK 2026-05-20 17:48:19
🟢 Date système (dernière heure enregistrée) : OK 2026-05-24 13:59:39 (2026-05-24 13:37:02)
🟢 Droits sudo : OK
🟢 Version Jeedom : 4.5.3
🟢 Version OS : debian 12.12
🟢 Version PHP : 8.2.31
🟢 Nombre de processus Apache : 15
🟢 Version OS : Linux Jeedom 6.1.0-41-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.158-1 (2025-11-09) x86_64 GNU/Linux [12.12]
🟢 Version database : 10.11.14-MariaDB-0+deb12u2
🟢 Espace disque libre : 82 %
🟢 Connexion active/max/autorisée : 17/36/151
🟢 Taille base de données : 275.28 MB
🟢 Espace disque libre tmp : 82 %
🟢 Mémoire disponible : 76 % (Total 7941 Mo)
🟢 Mémoire suffisante : 0
🟢 Erreur I/O : 0
🟢 Swap disponible : 100 % (Total 975 Mo)
🟢 Swappiness : 10 %
🟢 Charge : 1.79 - 2.3 - 2.16
🟢 Configuration réseau interne : OK
🟢 Configuration réseau externe : OK
🟢 Node : v22.21.0
🟢 Python 3 : Python 3.11.2
🟢 Persistance du cache : OK
🟢 Apache private tmp : OK