Page 4 sur 28

Re: [DzVents] LiveBox 4

Publié : 27 nov. 2018, 23:02
par pat054
je n'arrive pas à lancer le scrypt : Python donne une "invalid syntax" sur le 1er slach de : myBashDir=/var/tmp

Re: [DzVents] LiveBox 4

Publié : 28 nov. 2018, 11:48
par Neutrino
C'est du Bash, pas du python :D

Re: [DzVents] LiveBox 4

Publié : 28 nov. 2018, 15:24
par pat054
Bonjour Neutrino,

je viens de t'envoyer en MP le résultat des 3 fichiers

Pat

Re: [DzVents] LiveBox 3 et 4

Publié : 02 déc. 2018, 12:52
par Neutrino
Misa à jour du Premier post avec la compatibilité LiveBox 3/play ;).

Re: [DzVents] LiveBox 3 et 4

Publié : 02 déc. 2018, 12:52
par Neutrino
Mise à jour du Premier post avec la compatibilité LiveBox 3/play ;).

Re: [DzVents] LiveBox 3 et 4

Publié : 08 déc. 2018, 21:23
par georges54
Bonjour,
Je suis en Domoticz Version: 3.8153 et je ne souhaite pas changer de version (stabilité).
Le script me retourne les erreurs :
Error: dzVents: Error: Livebox 1.8: An error occured when calling event handler livebox
Error: dzVents: Error: Livebox 1.8: /home/pi/domoticz/scripts/dzVents/scripts/livebox.lua:174: attempt to index local 'item' (a nil value)
Y-a-t-il une solution pour faire fonctionner ce script sans changer de version ?
Merci d'avance

Re: [DzVents] LiveBox 3 et 4

Publié : 08 déc. 2018, 22:00
par Neutrino
Bonjour,

Je t'avoue ne pas avoir l'utilité ni la motivation de l'adapter à une version précédente de DzVents, sachant que je ne pourrai pas tester.
J'utilise pas mal de fonction de la version 2.4 à retrouver ici : https://www.domoticz.com/wiki/DzVents:_ ... Change_log

Re: [DzVents] LiveBox 3 et 4

Publié : 09 déc. 2018, 13:50
par pat054
Bonjour Neutrino,

je reviens sur le sujet. Voilà j'ai ceci dans mon LOG Domoticz à savoir 2 erreurs :

Code : Tout sélectionner

2018-12-09 13:45:00.138 Status: dzVents: Info: Livebox 1.8: ------ Start external script: livebox_play.lua:, trigger: every 1 minutes
2018-12-09 13:45:04.395 Status: dzVents: Info: Livebox 1.8: ATM Down: 9029
2018-12-09 13:45:04.427 Status: dzVents: Info: Livebox 1.8: ATM Up: 1013
2018-12-09 13:45:04.429 Status: dzVents: Info: Livebox 1.8: Attn : 38.2 dB
2018-12-09 13:45:04.431 Status: dzVents: Info: Livebox 1.8: Marge d'Attn : 8.2 dB
2018-12-09 13:45:04.433 Status: dzVents: Info: Livebox 1.8: Uptime : 0:00:28:28
2018-12-09 13:45:04.441 Status: dzVents: Info: Livebox 1.8: Internet : up
2018-12-09 13:45:04.443 Status: dzVents: Info: Livebox 1.8: IPv6 :
2018-12-09 13:45:04.446 Status: dzVents: Info: Livebox 1.8: IP WAN : 90.xx.xx.xx
2018-12-09 13:45:04.451 Status: dzVents: Info: Livebox 1.8: VoIP : Up
2018-12-09 13:45:04.453 Status: dzVents: Info: Livebox 1.8: TV : Available
2018-12-09 13:45:04.488 Status: dzVents: Info: Livebox 1.8: Wifi 2.4 Ghz : Up
2018-12-09 13:45:04.490 Status: dzVents: Error (2.4.9): Livebox 1.8: An error occured when calling event handler livebox_play
2018-12-09 13:45:04.490 Status: dzVents: Error (2.4.9): Livebox 1.8: /home/pi/domoticz/scripts/dzVents/scripts/livebox_play.lua:295: attempt to index field 'eth6' (a nil value)
2018-12-09 13:45:04.490 Status: dzVents: Info: Livebox 1.8: ------ Finished livebox_play.lua
Quel est ton diagnosticz?

Encore merci pour ce scrypt, cordialement.
Pat

Re: [DzVents] LiveBox 3 et 4

Publié : 09 déc. 2018, 14:36
par Neutrino
Je ne savais pas que la v3 avait le wifi 5GHz :lol:
Il doit avoir un autre nom que sur la v4.
En attendant, tu peux mettre wifi5 = nil
Envoie moi le fichier LAN.txt résultant de ce script stp.

Code : Tout sélectionner

#!/bin/bash

###########################################
# Firmware Livebox 4 = 3.4.10 g0-f-sip-fr #
#     Script mis a jour le 06/04/2018     #
###########################################
#Source : 	https://www.alex-braga.fr/ressources_externe/xdslbox_3.4.10.sh
#			https://github.com/rene-d/sysbus

#############################
# Declaration des variables #
#############################
myLivebox="192.168.1.1"
myPassword="motdepasse"

myBashDir=/var/tmp

myOutput=$myBashDir/myOutput.txt
myCookies=$myBashDir/myCookies.txt

########################################
# Connexion et recuperation du cookies #
########################################
curl -s -o "$myOutput" -X POST -c "$myCookies" -H 'Content-Type: application/x-sah-ws-4-call+json' -H 'Authorization: X-Sah-Login' -d "{\"service\":\"sah.Device.Information\",\"method\":\"createContext\",\"parameters\":{\"applicationName\":\"so_sdkut\",\"username\":\"admin\",\"password\":\"$myPassword\"}}" http://$myLivebox/ws > /dev/null

##################################################
# Lecture du cookies pour utilisation ulterieure #
##################################################
myContextID=$(tail -n1 "$myOutput" | sed 's/{"status":0,"data":{"contextID":"//1'| sed 's/",//1' | sed 's/"groups":"http,admin//1' | sed 's/"}}//1')

###############################################################################################
# Envoi des commandes pour recuperer les informtations et ecriture dans un fichier TXT separe #
###############################################################################################
getMIBs=`curl -s -b "$myCookies" -X POST -H 'Content-Type: application/x-sah-ws-4-call+json' -H "X-Context: $myContextID" -d "{\"service\":\"NeMo.Intf.lan\",\"method\":\"getMIBs\",\"parameters\":{}}" http://$myLivebox/ws`
echo $getMIBs > $myBashDir/LAN.txt




#######################################################
# Deconnexion et suppression des fichiers temporaires #
#######################################################
curl -s -b "$myCookies" -X POST http://$myLivebox/logout
rm "$myCookies" "$myOutput"

Re: [DzVents] LiveBox 3 et 4

Publié : 09 déc. 2018, 15:17
par pat054
voir tes MP, j'espère que ce sont ces fichiers que tu attends de ma part.