[phone_detection] Besoin de beta testers pour un nouveau plugin

Merci pour cette information je l’ai désactivé pour les essais, je peux donc le remettre en route ?

J’ai mis à jour le plugin vers la version 2019-11-17 10:25:20
J’ai l’impression qu’il faut manuellement arrêter/relancer le plugin ET resauvegarder les téléphones avant que ça ne refonctionne : La log semble montrer la détection fonctionne mais les commandes et le widget ne semblent pas synchronisés

Sinon j’ai vu ça

[Sun Nov 17 17:17:50.759517 2019] [php7:notice] [pid 3465] [client 127.0.0.1:36610] PHP Notice:  Undefined index: id in /var/www/html/plugins/phone_detection/core/php/phone_detection.php on line 15
[Sun Nov 17 17:17:50.774420 2019] [php7:notice] [pid 8304] [client 127.0.0.1:36612] PHP Notice:  Undefined index: id in /var/www/html/plugins/phone_detection/core/php/phone_detection.php on line 15

Hello,

J’ai peut-être oublié de relancer le démon à la fin de la procédure d’update… cependant, il ne devrait pas être nécessaire de faire un save des périphériques car au démarrage du démon, il va chercher tous les téléphones enregistrés et actifs.

Bonjour,
je viens de tester le plugin…
creation de mon tel OK, il est détécté…
je coupe le bluetooth de mon tel… toujours detecté… j’ai rafraichi… pareil, j’ai relancé le demon, pareil
mon log en debug:

[2019-11-18 08:34:32][INFO] : Lancement démon phone_detection : /usr/bin/python3 /var/www/html/plugins/phone_detection/core/class/../../resources/phone_detectiond/phone_detectiond.py  --device hci0 --loglevel debug --apikey qIcYq2Kw7ybq81X7SIWaHVCemt8XXXXX --pidfile /tmp/jeedom/phone_detection/daemon.pid --socket /tmp/jeedom/phone_detection/daemon.sock --callback http://127.0.0.1:80/plugins/phone_detection/core/php/phone_detection.php --interval 10 --present_interval 30 --absentThreshold 180
[2019-11-18 08:34:32][INFO][root](MainThread) : Start phone_detectiond
[2019-11-18 08:34:32][INFO][root](MainThread) : Log level : debug
[2019-11-18 08:34:32][INFO][root](MainThread) : Socket : /tmp/jeedom/phone_detection/daemon.sock
[2019-11-18 08:34:32][INFO][root](MainThread) : PID file : /tmp/jeedom/phone_detection/daemon.pid
[2019-11-18 08:34:32][INFO][root](MainThread) : Device : hci0
[2019-11-18 08:34:32][INFO][root](MainThread) : Callback : http://127.0.0.1:80/plugins/phone_detection/core/php/phone_detection.php
[2019-11-18 08:34:32][INFO][root](MainThread) : Interval : 10
[2019-11-18 08:34:32][INFO][root](MainThread) : Present Interval : 30
[2019-11-18 08:34:32][INFO][root](MainThread) : AbsentThreshold: 180
[2019-11-18 08:34:32][INFO][root](MainThread) : Python version : 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516]
[2019-11-18 08:34:32][DEBUG][root](MainThread) : Writing PID 13826 to /tmp/jeedom/phone_detection/daemon.pid
[2019-11-18 08:34:32][INFO][root](MainThread) : Create phone_detection daemon
[2019-11-18 08:34:32][DEBUG][root](MainThread) : Send to test to jeedom
[2019-11-18 08:34:32][DEBUG][root](MainThread) : Send to jeedom :  {'action': 'test'}
[2019-11-18 08:34:32][DEBUG] : id:
[2019-11-18 08:34:32][DEBUG][root](MainThread) : Status Code :  200
[2019-11-18 08:34:32][DEBUG][root](MainThread) : Jeedom reply :  {'success': True, 'value': 0}
[2019-11-18 08:34:32][INFO][root](MainThread) : Get devices from Jeedom
[2019-11-18 08:34:32][DEBUG][root](MainThread) : Send to jeedom :  {'action': 'get_devices'}
[2019-11-18 08:34:32][DEBUG] : id:
[2019-11-18 08:34:32][DEBUG][root](MainThread) : Status Code :  200
[2019-11-18 08:34:32][DEBUG][root](MainThread) : Jeedom reply :  {'success': True, 'value': None}
[2019-11-18 08:34:33][INFO] : Démon phone_detection lancé
[2019-11-18 08:36:51][DEBUG] : postInsert()
[2019-11-18 08:38:10][DEBUG] : postUpdate()
[2019-11-18 08:38:10][INFO] : deviceType must be set to phone
[2019-11-18 08:38:10][DEBUG] : postUpdate()
[2019-11-18 08:38:10][DEBUG] : callDeamon update_device Array (     [0] => 53     [1] => TEL_Steph_GalaxyS7     [2] => 3C:BB:FD:6D:XX:XX )
[2019-11-18 08:38:10][DEBUG] : error 0 :
Traceback (most recent call last):
File "/var/www/html/plugins/phone_detection/core/class/../../resources/phone_detectiond/phone_detectiond.py", line 396, in <module>
DEVICES = jc.getDevices()
File "/var/www/html/plugins/phone_detection/core/class/../../resources/phone_detectiond/phone_detectiond.py", line 235, in getDevices
for key in devices["value"]:
TypeError: 'NoneType' object is not iterable
[2019-11-18 08:38:10][DEBUG][root](Thread-1) : Message received in socket
[2019-11-18 08:38:10][DEBUG][root](Thread-1) : {'action': 'update_device', 'args': ['53', 'TEL_Steph_GalaxyS7', '3C:BB:FD:6D:XX:XX']}
[2019-11-18 08:38:10][DEBUG][root](Thread-1) : Add new device in device.json
[2019-11-18 08:38:10][INFO][root](Thread-1) : Start thread detection for TEL_Steph_GalaxyS7 [3C:BB:FD:6D:XX:XX]
[2019-11-18 08:38:10][DEBUG][root](Thread-1) : Send to jeedom :  {'id': 53, 'action': 'get_status'}
[2019-11-18 08:38:10][DEBUG] : id: 53
[2019-11-18 08:38:10][DEBUG][root](Thread-1) : Status Code :  200
[2019-11-18 08:38:10][DEBUG][root](Thread-1) : Jeedom reply :  {'success': True, 'value': ''}
[2019-11-18 08:38:10][DEBUG][root](Thread-1) : Jeedom 53 device status: False
[2019-11-18 08:38:10][DEBUG] : result callDeamon Array (     [success] => 1     [result] => Insert OK )
[2019-11-18 08:38:10][DEBUG][root](Thread-2) : Get phone information 53
[2019-11-18 08:38:10][DEBUG] : create Global Group device
[2019-11-18 08:38:10][DEBUG] : 	--> set Name
[2019-11-18 08:38:10][DEBUG] : 	--> set eqTypeName
[2019-11-18 08:38:10][DEBUG] : 	--> set deviceType
[2019-11-18 08:38:10][DEBUG] : 	--> set visible = 0
[2019-11-18 08:38:10][DEBUG] : 	--> set enable = 1
[2019-11-18 08:38:10][DEBUG] : 	--> set category
[2019-11-18 08:38:10][DEBUG] : 	--> set group id
[2019-11-18 08:38:10][DEBUG] : postInsert()
[2019-11-18 08:38:10][DEBUG] : callDeamon update_device Array (     [0] => 53     [1] => TEL_Steph_GalaxyS7     [2] => 3C:BB:FD:6D:XX:XX )
[2019-11-18 08:38:10][DEBUG] : error 0 :
[2019-11-18 08:38:10][DEBUG][root](Thread-1) : Message received in socket
[2019-11-18 08:38:10][DEBUG][root](Thread-1) : {'action': 'update_device', 'args': ['53', 'TEL_Steph_GalaxyS7', '3C:BB:FD:6D:XX:XX']}
[2019-11-18 08:38:10][DEBUG][root](Thread-1) : Update device in device.json
[2019-11-18 08:38:10][DEBUG] : result callDeamon Array (     [success] => 1     [result] => Update OK )
[2019-11-18 08:38:10][DEBUG][root](Thread-2) : 53 is present
[2019-11-18 08:38:10][INFO][root](Thread-2) : Set TEL_Steph_GalaxyS7's phone present
[2019-11-18 08:38:10][DEBUG][root](Thread-2) : 53 must be update
[2019-11-18 08:38:10][DEBUG][root](Thread-2) : TEL_Steph_GalaxyS7 status has changed to 'present'! Notify Jeedom.
[2019-11-18 08:38:10][DEBUG][root](Thread-2) : device status: True
[2019-11-18 08:38:10][DEBUG][root](Thread-2) : Send to jeedom :  {'value': 1, 'id': 53, 'action': 'update_device_status'}
[2019-11-18 08:38:10][DEBUG] : id: 53
[2019-11-18 08:38:10][DEBUG] : value: 1
[2019-11-18 08:38:10][DEBUG] : Device Name: [Monitoring][TEL_Steph_GalaxyS7]
[2019-11-18 08:38:10][DEBUG] : State property name: [Monitoring][TEL_Steph_GalaxyS7][Etat]
[2019-11-18 08:38:10][INFO] : updateGlobalDevice()
[2019-11-18 08:38:10][DEBUG][root](Thread-2) : Status Code :  200
[2019-11-18 08:38:10][DEBUG][root](Thread-2) : Jeedom reply :  {'success': True, 'value': 1}
[2019-11-18 08:38:17][DEBUG] : postUpdate()
[2019-11-18 08:38:17][DEBUG] : callDeamon update_device Array (     [0] => 53     [1] => TEL_Steph_GalaxyS7     [2] => 3C:BB:FD:6D:XX:XX )
[2019-11-18 08:38:17][DEBUG] : error 0 :
[2019-11-18 08:38:17][DEBUG][root](Thread-1) : Message received in socket
[2019-11-18 08:38:17][DEBUG][root](Thread-1) : {'action': 'update_device', 'args': ['53', 'TEL_Steph_GalaxyS7', '3C:BB:FD:6D:XX:XX']}
[2019-11-18 08:38:17][DEBUG][root](Thread-1) : Update device in device.json
[2019-11-18 08:38:17][DEBUG] : result callDeamon Array (     [success] => 1     [result] => Update OK )
[2019-11-18 08:38:40][DEBUG][root](Thread-2) : Get phone information 53
[2019-11-18 08:38:41][DEBUG][root](Thread-2) : 53 is present
[2019-11-18 08:38:41][DEBUG][root](Thread-2) : 53 is up to date
[2019-11-18 08:39:11][DEBUG][root](Thread-2) : Get phone information 53
[2019-11-18 08:39:16][DEBUG][root](Thread-2) : 53 is absent
[2019-11-18 08:39:16][DEBUG][root](Thread-2) : lastStateDate: 2019-11-18 07:38:41.432911
[2019-11-18 08:39:16][DEBUG][root](Thread-2) : thresholdDate: 2019-11-18 07:41:41.432911
[2019-11-18 08:39:16][DEBUG][root](Thread-2) : datetime.utcnow(): 2019-11-18 07:39:16.693378
[2019-11-18 08:39:16][DEBUG][root](Thread-2) : is datetime.utcnow() > thresholdDate ? False
[2019-11-18 08:39:16][DEBUG][root](Thread-2) : 53 is up to date
[2019-11-18 08:39:36][DEBUG][root](MainThread) : Signal 15 caught, exiting...
[2019-11-18 08:39:36][INFO][root](MainThread) : =========== Shutdown ===========
[2019-11-18 08:39:36][INFO][root](MainThread) : Stopping all threads
[2019-11-18 08:39:36][INFO][root](MainThread) : 	==> TEL_Steph_GalaxyS7
[2019-11-18 08:39:36][INFO][root](MainThread) : Stop thread detection for TEL_Steph_GalaxyS7 [3C:BB:FD:6D:XX:XX]
[2019-11-18 08:39:36][INFO][root](MainThread) : Shutting down local server
[2019-11-18 08:39:36][INFO][root](MainThread) : Removing Socket file /tmp/jeedom/phone_detection/daemon.sock
[2019-11-18 08:39:36][INFO][root](MainThread) : Removing PID file /tmp/jeedom/phone_detection/daemon.pid
[2019-11-18 08:39:36][INFO][root](MainThread) : Exit 0
[2019-11-18 08:39:36][INFO][root](MainThread) : =================================
Signal 15 caught, exiting...
[2019-11-18 08:39:37][INFO] : Lancement démon phone_detection : /usr/bin/python3 /var/www/html/plugins/phone_detection/core/class/../../resources/phone_detectiond/phone_detectiond.py  --device hci0 --loglevel debug --apikey qIcYq2Kw7ybq81X7SIWaHVCemt8XXXX --pidfile /tmp/jeedom/phone_detection/daemon.pid --socket /tmp/jeedom/phone_detection/daemon.sock --callback http://127.0.0.1:80/plugins/phone_detection/core/php/phone_detection.php --interval 10 --present_interval 30 --absentThreshold 60
[2019-11-18 08:39:37][INFO][root](MainThread) : Start phone_detectiond
[2019-11-18 08:39:37][INFO][root](MainThread) : Log level : debug
[2019-11-18 08:39:37][INFO][root](MainThread) : Socket : /tmp/jeedom/phone_detection/daemon.sock
[2019-11-18 08:39:37][INFO][root](MainThread) : PID file : /tmp/jeedom/phone_detection/daemon.pid
[2019-11-18 08:39:37][INFO][root](MainThread) : Device : hci0
[2019-11-18 08:39:37][INFO][root](MainThread) : Callback : http://127.0.0.1:80/plugins/phone_detection/core/php/phone_detection.php
[2019-11-18 08:39:37][INFO][root](MainThread) : Interval : 10
[2019-11-18 08:39:37][INFO][root](MainThread) : Present Interval : 30
[2019-11-18 08:39:37][INFO][root](MainThread) : AbsentThreshold: 60
[2019-11-18 08:39:37][INFO][root](MainThread) : Python version : 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516]
[2019-11-18 08:39:37][DEBUG][root](MainThread) : Writing PID 16540 to /tmp/jeedom/phone_detection/daemon.pid
[2019-11-18 08:39:37][INFO][root](MainThread) : Create phone_detection daemon
[2019-11-18 08:39:37][DEBUG][root](MainThread) : Send to test to jeedom
[2019-11-18 08:39:37][DEBUG][root](MainThread) : Send to jeedom :  {'action': 'test'}
[2019-11-18 08:39:37][DEBUG] : id:
[2019-11-18 08:39:37][DEBUG][root](MainThread) : Status Code :  200
[2019-11-18 08:39:37][DEBUG][root](MainThread) : Jeedom reply :  {'value': 0, 'success': True}
[2019-11-18 08:39:37][INFO][root](MainThread) : Get devices from Jeedom
[2019-11-18 08:39:37][DEBUG][root](MainThread) : Send to jeedom :  {'action': 'get_devices'}
[2019-11-18 08:39:37][DEBUG] : id:
[2019-11-18 08:39:37][DEBUG][root](MainThread) : Status Code :  200
[2019-11-18 08:39:37][DEBUG][root](MainThread) : Jeedom reply :  {'value': {'53': {'id': '53', 'name': 'TEL_Steph_GalaxyS7', 'humanName': '[Monitoring][TEL_Steph_GalaxyS7]', 'state': True, 'lastValueDate': '2019-11-18 08:38:10', 'macAddress': '3C:BB:FD:6D:XX:XX'}}, 'success': True}
[2019-11-18 08:39:38][INFO] : Démon phone_detection lancé
[2019-11-18 08:40:24][DEBUG] : cmdId:refresh
[2019-11-18 08:40:24][DEBUG] : eqLogic Id:53
[2019-11-18 08:40:24][DEBUG] : mac address: 3C:BB:FD:6D:XX:XX
[2019-11-18 08:40:24][INFO] : BT Device: hci0
[2019-11-18 08:40:29][DEBUG] : device name:
[2019-11-18 08:40:29][DEBUG] : device state: 0
[2019-11-18 08:40:29][INFO] : updateGlobalDevice()
Traceback (most recent call last):
File "/var/www/html/plugins/phone_detection/core/class/../../resources/phone_detectiond/phone_detectiond.py", line 396, in <module>
DEVICES = jc.getDevices()
File "/var/www/html/plugins/phone_detection/core/class/../../resources/phone_detectiond/phone_detectiond.py", line 240, in getDevices
r[key].lastStateDate = datetime.fromisoformat(item['lastValueDate'])
AttributeError: type object 'datetime.datetime' has no attribute 'fromisoformat'
[2019-11-18 08:41:53][DEBUG][root](MainThread) : Signal 15 caught, exiting...
[2019-11-18 08:41:53][INFO][root](MainThread) : =========== Shutdown ===========
[2019-11-18 08:41:53][INFO][root](MainThread) : Stopping all threads
[2019-11-18 08:41:53][INFO][root](MainThread) : Shutting down local server
[2019-11-18 08:41:53][INFO][root](MainThread) : Removing Socket file /tmp/jeedom/phone_detection/daemon.sock
[2019-11-18 08:41:53][INFO][root](MainThread) : Removing PID file /tmp/jeedom/phone_detection/daemon.pid
[2019-11-18 08:41:53][INFO][root](MainThread) : Exit 0
[2019-11-18 08:41:53][INFO][root](MainThread) : =================================
Signal 15 caught, exiting...
[2019-11-18 08:41:54][INFO] : Lancement démon phone_detection : /usr/bin/python3 /var/www/html/plugins/phone_detection/core/class/../../resources/phone_detectiond/phone_detectiond.py  --device hci0 --loglevel debug --apikey qIcYq2Kw7ybq81X7SIWaHVCemtXXXXX --pidfile /tmp/jeedom/phone_detection/daemon.pid --socket /tmp/jeedom/phone_detection/daemon.sock --callback http://127.0.0.1:80/plugins/phone_detection/core/php/phone_detection.php --interval 10 --present_interval 30 --absentThreshold 60
[2019-11-18 08:41:54][INFO][root](MainThread) : Start phone_detectiond
[2019-11-18 08:41:54][INFO][root](MainThread) : Log level : debug
[2019-11-18 08:41:54][INFO][root](MainThread) : Socket : /tmp/jeedom/phone_detection/daemon.sock
[2019-11-18 08:41:54][INFO][root](MainThread) : PID file : /tmp/jeedom/phone_detection/daemon.pid
[2019-11-18 08:41:54][INFO][root](MainThread) : Device : hci0
[2019-11-18 08:41:54][INFO][root](MainThread) : Callback : http://127.0.0.1:80/plugins/phone_detection/core/php/phone_detection.php
[2019-11-18 08:41:54][INFO][root](MainThread) : Interval : 10
[2019-11-18 08:41:54][INFO][root](MainThread) : Present Interval : 30
[2019-11-18 08:41:54][INFO][root](MainThread) : AbsentThreshold: 60
[2019-11-18 08:41:54][INFO][root](MainThread) : Python version : 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516]
[2019-11-18 08:41:54][DEBUG][root](MainThread) : Writing PID 18397 to /tmp/jeedom/phone_detection/daemon.pid
[2019-11-18 08:41:54][INFO][root](MainThread) : Create phone_detection daemon
[2019-11-18 08:41:54][DEBUG][root](MainThread) : Send to test to jeedom
[2019-11-18 08:41:54][DEBUG][root](MainThread) : Send to jeedom :  {'action': 'test'}
[2019-11-18 08:41:54][DEBUG] : id:
[2019-11-18 08:41:54][DEBUG][root](MainThread) : Status Code :  200
[2019-11-18 08:41:54][DEBUG][root](MainThread) : Jeedom reply :  {'success': True, 'value': 0}
[2019-11-18 08:41:54][INFO][root](MainThread) : Get devices from Jeedom
[2019-11-18 08:41:54][DEBUG][root](MainThread) : Send to jeedom :  {'action': 'get_devices'}
[2019-11-18 08:41:54][DEBUG] : id:
[2019-11-18 08:41:54][DEBUG][root](MainThread) : Status Code :  200
[2019-11-18 08:41:54][DEBUG][root](MainThread) : Jeedom reply :  {'success': True, 'value': {'53': {'state': True, 'macAddress': '3C:BB:FD:6D:XX:XX', 'lastValueDate': '2019-11-18 08:38:10', 'name': 'TEL_Steph_GalaxyS7', 'id': '53', 'humanName': '[Monitoring][TEL_Steph_GalaxyS7]'}}}
[2019-11-18 08:41:55][INFO] : Démon phone_detection lancé
[2019-11-18 08:42:57][DEBUG] : cmdId:refresh
[2019-11-18 08:42:57][DEBUG] : eqLogic Id:53
[2019-11-18 08:42:57][DEBUG] : mac address: 3C:BB:FD:6D:XX:XX
[2019-11-18 08:42:57][INFO] : BT Device: hci0
[2019-11-18 08:43:02][DEBUG] : device name:
[2019-11-18 08:43:02][DEBUG] : device state: 0
[2019-11-18 08:43:02][INFO] : updateGlobalDevice()

Il y a un délai de 180 secondes (configurable) pour considérer un téléphone non présent… dans l’exemple ci-dessus, il y a à peine 60 secondes.

Sébastien

ma configuration est bien sur 60 secondes mais il ne se passe rien

Traceback (most recent call last):
File "/var/www/html/plugins/phone_detection/core/class/../../resources/phone_detectiond/phone_detectiond.py", line 396, in <module>
DEVICES = jc.getDevices()
File "/var/www/html/plugins/phone_detection/core/class/../../resources/phone_detectiond/phone_detectiond.py", line 240, in getDevices
r[key].lastStateDate = datetime.fromisoformat(item['lastValueDate'])
AttributeError: type object 'datetime.datetime' has no attribute 'fromisoformat'
[2019-11-18 15:19:34][DEBUG][root](MainThread) : Signal 15 caught, exiting...
[2019-11-18 15:19:34][INFO][root](MainThread) : =========== Shutdown ===========
[2019-11-18 15:19:34][INFO][root](MainThread) : Stopping all threads
[2019-11-18 15:19:34][INFO][root](MainThread) : Shutting down local server
[2019-11-18 15:19:35][INFO][root](MainThread) : Removing Socket file /tmp/jeedom/phone_detection/daemon.sock
[2019-11-18 15:19:35][INFO][root](MainThread) : Removing PID file /tmp/jeedom/phone_detection/daemon.pid
[2019-11-18 15:19:35][INFO][root](MainThread) : Exit 0
[2019-11-18 15:19:35][INFO][root](MainThread) : =================================
Signal 15 caught, exiting...
[2019-11-18 15:19:35][INFO] : Lancement démon phone_detection : /usr/bin/python3 /var/www/html/plugins/phone_detection/core/class/../../resources/phone_detectiond/phone_detectiond.py  --device hci0 --loglevel debug --apikey qIcYq2Kw7ybq81X7SIWaHVCemt8XX:XX --pidfile /tmp/jeedom/phone_detection/daemon.pid --socket /tmp/jeedom/phone_detection/daemon.sock --callback http://127.0.0.1:80/plugins/phone_detection/core/php/phone_detection.php --interval 10 --present_interval 30 --absentThreshold 60
[2019-11-18 15:19:37][INFO][root](MainThread) : Start phone_detectiond
[2019-11-18 15:19:37][INFO][root](MainThread) : Log level : debug
[2019-11-18 15:19:37][INFO][root](MainThread) : Socket : /tmp/jeedom/phone_detection/daemon.sock
[2019-11-18 15:19:37][INFO][root](MainThread) : PID file : /tmp/jeedom/phone_detection/daemon.pid
[2019-11-18 15:19:37][INFO][root](MainThread) : Device : hci0
[2019-11-18 15:19:37][INFO][root](MainThread) : Callback : http://127.0.0.1:80/plugins/phone_detection/core/php/phone_detection.php
[2019-11-18 15:19:37][INFO][root](MainThread) : Interval : 10
[2019-11-18 15:19:37][INFO][root](MainThread) : Present Interval : 30
[2019-11-18 15:19:37][INFO][root](MainThread) : AbsentThreshold: 60
[2019-11-18 15:19:37][INFO][root](MainThread) : Python version : 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516]
[2019-11-18 15:19:37][DEBUG][root](MainThread) : Writing PID 27420 to /tmp/jeedom/phone_detection/daemon.pid
[2019-11-18 15:19:37][INFO][root](MainThread) : Create phone_detection daemon
[2019-11-18 15:19:37][DEBUG][root](MainThread) : Send to test to jeedom
[2019-11-18 15:19:37][DEBUG][root](MainThread) : Send to jeedom :  {'action': 'test'}
[2019-11-18 15:19:37][DEBUG] : id:
[2019-11-18 15:19:37][DEBUG][root](MainThread) : Status Code :  200
[2019-11-18 15:19:37][DEBUG][root](MainThread) : Jeedom reply :  {'success': True, 'value': 0}
[2019-11-18 15:19:37][INFO][root](MainThread) : Get devices from Jeedom
[2019-11-18 15:19:37][DEBUG][root](MainThread) : Send to jeedom :  {'action': 'get_devices'}
[2019-11-18 15:19:37][DEBUG] : id:
[2019-11-18 15:19:37][DEBUG][root](MainThread) : Status Code :  200
[2019-11-18 15:19:37][DEBUG][root](MainThread) : Jeedom reply :  {'success': True, 'value': {'53': {'humanName': '[Monitoring][TEL_Steph_GalaxyS7]', 'id': '53', 'lastValueDate': '2019-11-18 08:38:10', 'state': True, 'name': 'TEL_Steph_GalaxyS7', 'macAddress': '3C:BB:FD:6D:XX:XX'}}}
[2019-11-18 15:19:37][INFO] : Démon phone_detection lancé
[2019-11-18 15:20:40][DEBUG] : cmdId:refresh
[2019-11-18 15:20:40][DEBUG] : eqLogic Id:53
[2019-11-18 15:20:40][DEBUG] : mac address: 3C:BB:FD:6D:XX:XX
[2019-11-18 15:20:40][INFO] : BT Device: hci0
[2019-11-18 15:20:41][DEBUG] : device name: Samsung Galaxy S7 edge
[2019-11-18 15:20:41][DEBUG] : device state: 1
[2019-11-18 15:20:41][INFO] : updateGlobalDevice()
[2019-11-18 15:38:25][DEBUG] : cmdId:refresh
[2019-11-18 15:38:25][DEBUG] : eqLogic Id:53
[2019-11-18 15:38:25][DEBUG] : mac address: 3C:BB:FD:6D:XX:XX
[2019-11-18 15:38:25][INFO] : BT Device: hci0
[2019-11-18 15:38:30][DEBUG] : device name:
[2019-11-18 15:38:30][DEBUG] : device state: 0
[2019-11-18 15:38:30][INFO] : updateGlobalDevice()


le bluettoth de mon tel est coupé depuis plus d’1h et le plugin le voie tjrs « true »

Bonjour,

Ce soir en arrivant, plantage du plugin…


[2019-11-18 08:36:34][INFO][root](Thread-2) : Set "OnePlusPro 7 BT" phone absent
[2019-11-18 08:36:34][INFO] : updateGlobalDevice()
[2019-11-18 17:49:52][INFO][root](Thread-2) : Set OnePlusPro 7 BT's phone present
/usr/lib/python3/dist-packages/urllib3/connectionpool.py:849: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)
[2019-11-18 17:49:52][ERROR][root](Thread-2) : Error during update status

Après 30 minutes, statut toujours à 0
Redémarrage manuel qui donne une petite errreur coté apache

[Mon Nov 18 18:21:01.743066 2019] [php7:notice] [pid 19327] [client 127.0.0.1:32924] PHP Notice:  Undefined variable: success in /var/www/html/plugins/phone_detection/core/php/phone_detection.php on line 83

et qui boucle coté log du demon

[2019-11-18 17:49:52][ERROR][root](Thread-2) : Error during update status
[2019-11-18 18:21:00][INFO][root](MainThread) : =========== Shutdown ===========
[2019-11-18 18:21:00][INFO][root](MainThread) : Stopping all threads
[2019-11-18 18:21:00][INFO][root](MainThread) : 	==> OnePlusPro 7 BT
[2019-11-18 18:21:00][INFO][root](MainThread) : Stop thread detection for OnePlusPro 7 BT [40:01:C5:06:78:C1]
[2019-11-18 18:21:00][INFO][root](MainThread) : Shutting down local server
[2019-11-18 18:21:00][INFO][root](MainThread) : Removing Socket file /tmp/jeedom/phone_detection/daemon.sock
[2019-11-18 18:21:00][INFO][root](MainThread) : Removing PID file /tmp/jeedom/phone_detection/daemon.pid
[2019-11-18 18:21:00][INFO][root](MainThread) : Exit 0
[2019-11-18 18:21:00][INFO][root](MainThread) : =================================
Signal 15 caught, exiting...
[2019-11-18 18:21:01][INFO] : Lancement démon phone_detection : /usr/bin/python3 /var/www/html/plugins/phone_detection/core/class/../../resources/phone_detectiond/phone_detectiond.py  --device hci0 --loglevel info --apikey DtyeOsTi9wJUe12ZJ6TOxauGXRVKlqMN --pidfile /tmp/jeedom/phone_detection/daemon.pid --socket /tmp/jeedom/phone_detection/daemon.sock --callback http://127.0.0.1:80/plugins/phone_detection/core/php/phone_detection.php --interval 10 --present_interval 30 --absentThreshold 180
[2019-11-18 18:21:01][INFO][root](MainThread) : Start phone_detectiond
[2019-11-18 18:21:01][INFO][root](MainThread) : Log level : info
[2019-11-18 18:21:01][INFO][root](MainThread) : Socket : /tmp/jeedom/phone_detection/daemon.sock
[2019-11-18 18:21:01][INFO][root](MainThread) : PID file : /tmp/jeedom/phone_detection/daemon.pid
[2019-11-18 18:21:01][INFO][root](MainThread) : Device : hci0
[2019-11-18 18:21:01][INFO][root](MainThread) : Callback : http://127.0.0.1:80/plugins/phone_detection/core/php/phone_detection.php
[2019-11-18 18:21:01][INFO][root](MainThread) : Interval : 10
[2019-11-18 18:21:01][INFO][root](MainThread) : Present Interval : 30
[2019-11-18 18:21:01][INFO][root](MainThread) : AbsentThreshold: 180
[2019-11-18 18:21:01][INFO][root](MainThread) : Python version : 3.7.3 (default, Apr  3 2019, 05:39:12) 
[GCC 8.2.0]
[2019-11-18 18:21:01][INFO][root](MainThread) : Create phone_detection daemon
/usr/lib/python3/dist-packages/urllib3/connectionpool.py:849: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)
[2019-11-18 18:21:01][ERROR][root](MainThread) : Calling jeedom failed
[2019-11-18 18:21:06][ERROR] : Impossible de lancer le démon phone_detection, relancer le démon en debug et vérifiez la log
[2019-11-18 18:21:55][INFO] : BT Device: hci0
[2019-11-18 18:21:57][INFO] : updateGlobalDevice()
[2019-11-18 18:21:57][INFO] : BT Device: hci0
[2019-11-18 18:21:58][INFO] : updateGlobalDevice()
[2019-11-18 18:25:03][INFO] : Lancement démon phone_detection : /usr/bin/python3 /var/www/html/plugins/phone_detection/core/class/../../resources/phone_detectiond/phone_detectiond.py  --device hci0 --loglevel info --apikey DtyeOsTi9wJUe12ZJ6TOxauGXRVKlqMN --pidfile /tmp/jeedom/phone_detection/daemon.pid --socket /tmp/jeedom/phone_detection/daemon.sock --callback http://127.0.0.1:80/plugins/phone_detection/core/php/phone_detection.php --interval 10 --present_interval 30 --absentThreshold 180
[2019-11-18 18:25:04][INFO][root](MainThread) : Start phone_detectiond
[2019-11-18 18:25:04][INFO][root](MainThread) : Log level : info
[2019-11-18 18:25:04][INFO][root](MainThread) : Socket : /tmp/jeedom/phone_detection/daemon.sock
[2019-11-18 18:25:04][INFO][root](MainThread) : PID file : /tmp/jeedom/phone_detection/daemon.pid
[2019-11-18 18:25:04][INFO][root](MainThread) : Device : hci0
[2019-11-18 18:25:04][INFO][root](MainThread) : Callback : http://127.0.0.1:80/plugins/phone_detection/core/php/phone_detection.php
[2019-11-18 18:25:04][INFO][root](MainThread) : Interval : 10
[2019-11-18 18:25:04][INFO][root](MainThread) : Present Interval : 30
[2019-11-18 18:25:04][INFO][root](MainThread) : AbsentThreshold: 180
[2019-11-18 18:25:04][INFO][root](MainThread) : Python version : 3.7.3 (default, Apr  3 2019, 05:39:12) 
[GCC 8.2.0]
[2019-11-18 18:25:04][INFO][root](MainThread) : Create phone_detection daemon
/usr/lib/python3/dist-packages/urllib3/connectionpool.py:849: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)
[2019-11-18 18:25:04][ERROR][root](MainThread) : Calling jeedom failed
[2019-11-18 18:25:04][INFO] : Démon phone_detection lancé

Allez, on doit pas être loin d’une solution définitive

Question d un novice: faut t il un adaptateur bluetooth sur le boitier ? ou bien c est different ?

Dans la mesure où il faut saisir la mac address bluetooth, tu voudrais que ça marche comment ?

Bonjour
Moi j’ai ça comme erreur.
Signal 15 caught, exiting…
Traceback (most recent call last):
File « /var/www/html/plugins/phone_detection/core/class/…/…/resources/phone_detectiond/phone_detectiond.py », line 396, in
DEVICES = jc.getDevices()
File « /var/www/html/plugins/phone_detection/core/class/…/…/resources/phone_detectiond/phone_detectiond.py », line 240, in getDevices
r[key].lastStateDate = datetime.fromisoformat(item[‹ lastValueDate ›])
AttributeError: type object ‹ datetime.datetime › has no attribute ‹ fromisoformat ›
Signal 15 caught, exiting…

Merci

Deuxième jour sans plantage, je l’utilise pour faire de la présence et il va très bien en plus mes 2 téléphones sont bien détectés…

1 « J'aime »

Bonjour à tous,

Merci pour vos retours.
Désolé, si je n’ai pas été très réactif ces derniers jours : j’ai eu beaucoup de boulot et peu de temps pour corriger et/ou faire évoluer le plugin.

En vrac :

  • L’erreur AttributeError: type object ‘datetime.datetime’ has no attribute ‘fromisoformat’ doit venir d’une dépendance Python manquante, je vais forcer son installation dans les dépendances
  • L’erreur [Mon Nov 18 18:21:01.743066 2019] [php7:notice] [pid 19327] [client 127.0.0.1:32924] PHP Notice: Undefined variable: success in /var/www/html/plugins/phone_detection/core/php/phone_detection.php on line 83 est incompréhensible : toutes les variables sont déclarées et initialisées

là, il y a quelque chose que je ne comprends pas : la log que tu partages montre bien la détection du téléphone (device state : 1 et affichage de son nom) puis une perte de connexion (device state : 0 et nom introuvable)… donc normalement, le démon fonctionne… je creuse pour trouver d’où ça vient

Côté nouvelles fonctionnalités, je vais essayer d’ajouter la détection de périphérique BLE (type montre/bracelet connecté)

Sébastien

2 « J'aime »

le problème est que le daemon ne tourne pas… mon dernier relevé dans les log date du 18/11/2019 15:38
pas de mise a jour…

Es-tu essayer de le relancer et de le mettre en automatique ?

voilà ma conf

Etonnant… et tu n’as rien dans les logs ?
Tu peux le relancer ?

Quelles versions utilises-tu ?

  • Jeedom
  • Debian
  • Python
  • php

@Sebastien_Ferrand
voilà ce que j’ai.
image


Log des dépendance du plugin

log apés redemarrage du daemon

Tout à l’air de démarrer correctement pourtant :thinking::face_with_raised_eyebrow:

si ca peut aider dans le log http.error

Thu Nov 21 16:21:16.191624 2019] [:error] [pid 23419] [client 127.0.0.1:38104] PHP Notice:  Undefined index: id in /var/www/html/plugins/phone_detection/core/php/phone_detection.php on line 15
[Thu Nov 21 16:21:16.221515 2019] [:error] [pid 20869] [client 127.0.0.1:38106] PHP Notice:  Undefined index: id in /var/www/html/plugins/phone_detection/core/php/phone_detection.php on line 15

et il est 17:36 et le log Phone_detection est tjrs a 16:21

Merci pour ton aide…

Je viens de fixer ce bug, normalement, ça devrait aller plus loin maintenant.
Bizarrement, avec PHP7.3, cette erreur ne remonte pas !

Sébastien