Bonjour à tous,
Je viens de voir qu’une version 1 de l’API pour attaquer les prise CPLs Devolo (WIFI) était sortie :
J’ai reussi assez facilement à recuperer des infos de mes Devolos :
exemple :
----------------------------------------------------------
NB clients WIFI : 5
* 48:55:19:16:38:FA
* 98:F4:AB:F2:47:5A
* 98:F4:AB:F2:49:4F
* 98:F4:AB:F2:8D:58
* 98:F4:AB:F3:C5:A4
Prises DEVOLO voisines : 5
* Piscine ( devolo Magic 1 WiFi mini ) --> TX : 344 Mbits, RX : 151 Mbits
* Box ( devolo Magic 1 LAN 1-1 ) --> TX : 151 Mbits, RX : 344 Mbits
* Cuisine ( devolo Magic 1 WiFi mini ) --> TX : 207 Mbits, RX : 337 Mbits
* Billard ( devolo Magic 1 WiFi mini ) --> TX : 224 Mbits, RX : 685 Mbits
* TV ( devolo Magic 1 WiFi mini ) --> TX : 163 Mbits, RX : 378 Mbits
----------------------------------------------------------
En l’occurence, sur un de mes Devolos,
- Le nb de devices WIFI connectés et leur adresse mac
- Les prises CPL voisines avec leur version, le modele, les tx de transfert, …
Le script que j’ai fait :
import sys
from devolo_plc_api import Device
# IP of the device to query
IP = sys.argv[1]
# Password, if the device has one. It is the same as the Web-UI has. It no password is set, you can remove the password
# parameter or set it to None.
PASSWORD = "None"
def run():
with Device(ip=IP) as dpa:
# Set the password
dpa.password = PASSWORD
network = dpa.plcnet.get_network_overview()
connected_stations = dpa.device.get_wifi_connected_station()
print('----------------------------------------------------------')
print("NB clients WIFI :",len(connected_stations))
for i in range(0, len(connected_stations), 1):
print(' *', connected_stations[i].mac_address)
print("")
print("Prises DEVOLO voisines :",len(network.devices))
for i in range(0, len(network.devices), 1):
print(" *",network.devices[i].user_device_name,"(",network.devices[i].product_name,") --> TX :",round(network.data_rates[i].tx_rate),"Mbits, RX :",round(network.data_rates[i].rx_rate),"Mbits")
print('----------------------------------------------------------')
if __name__ == "__main__":
run()
On peut aussi gerer le wifi, les led, la mise à jour, le reboot, …
Bref, ca me parait interessant, MAIS … Je ne suis pas developpeur
Donc si un dev etait interessé pour faire un plugin, ca serait cool.
A disposition pour aider et tester
Norbert