[2021-10-18 09:47:44][DEBUG][root](Thread-1) : Send to jeedom : {'action': 'heartbeat', 'source': ''} [2021-10-18 09:47:44][DEBUG][root](Thread-1) : Status Code : 200 [2021-10-18 09:47:44][DEBUG][root](Thread-1) : Jeedom reply : {'success': True, 'value': 0} [2021-10-18 09:47:46][DEBUG][root](Thread-3) : Get phone information 180 [2021-10-18 09:47:51][DEBUG][root](Thread-3) : 180 is absent [2021-10-18 09:47:51][DEBUG][root](Thread-3) : lastStateDate: 2021-10-18 10:44:05 [2021-10-18 09:47:51][DEBUG][root](Thread-3) : thresholdDate: 2021-10-18 10:45:05 [2021-10-18 09:47:51][DEBUG][root](Thread-3) : datetime.utcnow(): 2021-10-18 08:47:51.418386 [2021-10-18 09:47:51][DEBUG][root](Thread-3) : is datetime.utcnow() > thresholdDate ? False [2021-10-18 09:47:51][DEBUG][root](Thread-3) : 180 is up to date [2021-10-18 09:47:57][DEBUG][root](Thread-4) : Get phone information 177 [2021-10-18 09:47:57][DEBUG][root](Thread-4) : 177 is present [2021-10-18 09:47:57][DEBUG][root](Thread-4) : 177 is up to date [2021-10-18 09:48:01][DEBUG][root](Thread-3) : Get phone information 180 [2021-10-18 09:48:06][DEBUG][root](Thread-3) : 180 is absent [2021-10-18 09:48:06][DEBUG][root](Thread-3) : lastStateDate: 2021-10-18 10:44:05 [2021-10-18 09:48:06][DEBUG][root](Thread-3) : thresholdDate: 2021-10-18 10:45:05 [2021-10-18 09:48:06][DEBUG][root](Thread-3) : datetime.utcnow(): 2021-10-18 08:48:06.692432 [2021-10-18 09:48:06][DEBUG][root](Thread-3) : is datetime.utcnow() > thresholdDate ? False [2021-10-18 09:48:06][DEBUG][root](Thread-3) : 180 is up to date [2021-10-18 09:48:14][DEBUG][root](Thread-1) : Send to jeedom : {'action': 'heartbeat', 'source': ''} [2021-10-18 09:48:14][DEBUG][root](Thread-1) : Status Code : 200 [2021-10-18 09:48:14][DEBUG][root](Thread-1) : Jeedom reply : {'success': True, 'value': 0} [2021-10-18 09:48:16][DEBUG][root](Thread-3) : Get phone information 180 [2021-10-18 09:48:17][DEBUG][root](Thread-4) : Get phone information 177 [2021-10-18 09:48:21][DEBUG][root](Thread-3) : 180 is absent [2021-10-18 09:48:21][DEBUG][root](Thread-3) : lastStateDate: 2021-10-18 10:44:05 [2021-10-18 09:48:21][DEBUG][root](Thread-3) : thresholdDate: 2021-10-18 10:45:05 [2021-10-18 09:48:21][DEBUG][root](Thread-3) : datetime.utcnow(): 2021-10-18 08:48:21.955934 [2021-10-18 09:48:21][DEBUG][root](Thread-3) : is datetime.utcnow() > thresholdDate ? False [2021-10-18 09:48:21][DEBUG][root](Thread-3) : 180 is up to date [2021-10-18 09:48:22][DEBUG][root](Thread-4) : 177 is present [2021-10-18 09:48:22][DEBUG][root](Thread-4) : 177 is up to date [2021-10-18 09:48:31][DEBUG][root](Thread-3) : Get phone information 180 [2021-10-18 09:48:37][DEBUG][root](Thread-3) : 180 is absent [2021-10-18 09:48:37][DEBUG][root](Thread-3) : lastStateDate: 2021-10-18 10:44:05 [2021-10-18 09:48:37][DEBUG][root](Thread-3) : thresholdDate: 2021-10-18 10:45:05 [2021-10-18 09:48:37][DEBUG][root](Thread-3) : datetime.utcnow(): 2021-10-18 08:48:37.235921 [2021-10-18 09:48:37][DEBUG][root](Thread-3) : is datetime.utcnow() > thresholdDate ? False [2021-10-18 09:48:37][DEBUG][root](Thread-3) : 180 is up to date [2021-10-18 09:48:42][DEBUG][root](Thread-4) : Get phone information 177 [2021-10-18 09:48:43][DEBUG][root](Thread-4) : 177 is present [2021-10-18 09:48:43][DEBUG][root](Thread-4) : 177 is up to date [2021-10-18 09:48:44][DEBUG][root](Thread-1) : Send to jeedom : {'action': 'heartbeat', 'source': ''} [2021-10-18 09:48:45][DEBUG][root](Thread-1) : Status Code : 500 [2021-10-18 09:48:45][ERROR][root](Thread-1) : Error on send request to jeedom, return code 500 - Internal Server Error [2021-10-18 09:48:45][DEBUG][root](Thread-1) : Send to jeedom : {'action': 'heartbeat', 'source': ''} [2021-10-18 09:48:45][DEBUG][root](Thread-1) : Status Code : 500 [2021-10-18 09:48:45][ERROR][root](Thread-1) : Error on send request to jeedom, return code 500 - Internal Server Error [2021-10-18 09:48:45][DEBUG][root](Thread-1) : Send to jeedom : {'action': 'heartbeat', 'source': ''} [2021-10-18 09:48:45][DEBUG][root](Thread-1) : Status Code : 500 [2021-10-18 09:48:45][ERROR][root](Thread-1) : Error on send request to jeedom, return code 500 - Internal Server Error [2021-10-18 09:48:45][ERROR][root](Thread-1) : Error during heartbeat [2021-10-18 09:48:47][DEBUG][root](Thread-3) : Get phone information 180 [2021-10-18 09:48:52][DEBUG][root](Thread-3) : 180 is absent [2021-10-18 09:48:52][DEBUG][root](Thread-3) : lastStateDate: 2021-10-18 10:44:05 [2021-10-18 09:48:52][DEBUG][root](Thread-3) : thresholdDate: 2021-10-18 10:45:05 [2021-10-18 09:48:52][DEBUG][root](Thread-3) : datetime.utcnow(): 2021-10-18 08:48:52.513533 [2021-10-18 09:48:52][DEBUG][root](Thread-3) : is datetime.utcnow() > thresholdDate ? False [2021-10-18 09:48:52][DEBUG][root](Thread-3) : 180 is up to date [2021-10-18 09:49:02][DEBUG][root](Thread-3) : Get phone information 180 [2021-10-18 09:49:03][DEBUG][root](Thread-4) : Get phone information 177 [2021-10-18 09:49:07][DEBUG][root](Thread-3) : 180 is absent [2021-10-18 09:49:07][DEBUG][root](Thread-3) : lastStateDate: 2021-10-18 10:44:05 [2021-10-18 09:49:07][DEBUG][root](Thread-3) : thresholdDate: 2021-10-18 10:45:05 [2021-10-18 09:49:07][DEBUG][root](Thread-3) : datetime.utcnow(): 2021-10-18 08:49:07.762054 [2021-10-18 09:49:07][DEBUG][root](Thread-3) : is datetime.utcnow() > thresholdDate ? False [2021-10-18 09:49:07][DEBUG][root](Thread-3) : 180 is up to date [2021-10-18 09:49:08][DEBUG][root](Thread-4) : 177 is present [2021-10-18 09:49:08][DEBUG][root](Thread-4) : 177 is up to date [2021-10-18 09:49:15][DEBUG][root](Thread-1) : Send to jeedom : {'action': 'heartbeat', 'source': ''} [2021-10-18 09:49:15][DEBUG][root](Thread-1) : Status Code : 500 [2021-10-18 09:49:15][ERROR][root](Thread-1) : Error on send request to jeedom, return code 500 - Internal Server Error [2021-10-18 09:49:15][DEBUG][root](Thread-1) : Send to jeedom : {'action': 'heartbeat', 'source': ''} [2021-10-18 09:49:15][DEBUG][root](Thread-1) : Status Code : 500 [2021-10-18 09:49:15][ERROR][root](Thread-1) : Error on send request to jeedom, return code 500 - Internal Server Error [2021-10-18 09:49:16][DEBUG][root](Thread-1) : Send to jeedom : {'action': 'heartbeat', 'source': ''} [2021-10-18 09:49:16][DEBUG][root](Thread-1) : Status Code : 500 [2021-10-18 09:49:16][ERROR][root](Thread-1) : Error on send request to jeedom, return code 500 - Internal Server Error [2021-10-18 09:49:16][ERROR][root](Thread-1) : Error during heartbeat [2021-10-18 09:49:17][DEBUG][root](Thread-3) : Get phone information 180 [2021-10-18 09:49:23][DEBUG][root](Thread-3) : 180 is absent [2021-10-18 09:49:23][DEBUG][root](Thread-3) : lastStateDate: 2021-10-18 10:44:05 [2021-10-18 09:49:23][DEBUG][root](Thread-3) : thresholdDate: 2021-10-18 10:45:05 [2021-10-18 09:49:23][DEBUG][root](Thread-3) : datetime.utcnow(): 2021-10-18 08:49:23.037933 [2021-10-18 09:49:23][DEBUG][root](Thread-3) : is datetime.utcnow() > thresholdDate ? False [2021-10-18 09:49:23][DEBUG][root](Thread-3) : 180 is up to date [2021-10-18 09:49:28][DEBUG][root](Thread-4) : Get phone information 177 [2021-10-18 09:49:29][DEBUG][root](Thread-4) : 177 is present [2021-10-18 09:49:29][DEBUG][root](Thread-4) : 177 is up to date [2021-10-18 09:49:33][DEBUG][root](Thread-3) : Get phone information 180 [2021-10-18 09:49:38][DEBUG][root](Thread-3) : 180 is absent [2021-10-18 09:49:38][DEBUG][root](Thread-3) : lastStateDate: 2021-10-18 10:44:05 [2021-10-18 09:49:38][DEBUG][root](Thread-3) : thresholdDate: 2021-10-18 10:45:05 [2021-10-18 09:49:38][DEBUG][root](Thread-3) : datetime.utcnow(): 2021-10-18 08:49:38.306854 [2021-10-18 09:49:38][DEBUG][root](Thread-3) : is datetime.utcnow() > thresholdDate ? False [2021-10-18 09:49:38][DEBUG][root](Thread-3) : 180 is up to date [2021-10-18 09:49:38][DEBUG][root](Thread-2) : Message received in socket ---------------------------------------- Exception happened during processing of request from ('192.168.1.1', 44500) Traceback (most recent call last): File "/usr/lib/python3.7/socketserver.py", line 316, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib/python3.7/socketserver.py", line 347, in process_request self.finish_request(request, client_address) File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/lib/python3.7/socketserver.py", line 720, in __init__ self.handle() File "/home/pi/phone_detectiond/resources/phone_detectiond/phone_detectiond.py", line 291, in handle lmessage = dict(message) ValueError: dictionary update sequence element #0 has length 1; 2 is required ---------------------------------------- [2021-10-18 09:49:38][DEBUG][root](Thread-2) : Message received in socket [2021-10-18 09:49:51][INFO][root](MainThread) : Start phone_detectiond [2021-10-18 09:49:51][INFO][root](MainThread) : Log level : debug [2021-10-18 09:49:51][INFO][root](MainThread) : Socket : [2021-10-18 09:49:51][INFO][root](MainThread) : SocketHost : 192.168.1.0 [2021-10-18 09:49:51][INFO][root](MainThread) : SocketPort : 55009 [2021-10-18 09:49:51][INFO][root](MainThread) : PID file : /tmp/phone_detectiond.pid [2021-10-18 09:49:51][INFO][root](MainThread) : Device : hci0 [2021-10-18 09:49:51][INFO][root](MainThread) : Callback : http://192.168.1.1/plugins/phone_detection/core/php/phone_detection.php [2021-10-18 09:49:51][INFO][root](MainThread) : Daemon Name : PiZero [2021-10-18 09:49:51][INFO][root](MainThread) : Interval : 10 [2021-10-18 09:49:51][INFO][root](MainThread) : Present Interval : 20 [2021-10-18 09:49:51][INFO][root](MainThread) : AbsentThreshold: 60 [2021-10-18 09:49:51][INFO][root](MainThread) : Python version : 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0] [2021-10-18 09:49:51][DEBUG][root](MainThread) : Writing PID 766 to /tmp/phone_detectiond.pid [2021-10-18 09:49:51][INFO][root](MainThread) : Create phone_detection daemon [2021-10-18 09:49:51][DEBUG][root](MainThread) : Send to test connection to jeedom [2021-10-18 09:49:51][DEBUG][root](MainThread) : Send to jeedom : {'action': 'test', 'source': 'PiZero'} [2021-10-18 09:49:51][DEBUG][root](MainThread) : Status Code : 200 [2021-10-18 09:49:51][DEBUG][root](MainThread) : Jeedom reply : {'success': True, 'value': 0} [2021-10-18 09:49:51][INFO][root](MainThread) : Start heartbeat thread [2021-10-18 09:49:51][DEBUG][root](Thread-1) : Send to jeedom : {'action': 'heartbeat', 'source': 'PiZero'} [2021-10-18 09:49:51][INFO][root](MainThread) : Use TCP socket for Jeedom -> daemon communication [2021-10-18 09:49:51][INFO][root](MainThread) : Get devices from Jeedom [2021-10-18 09:49:51][DEBUG][root](MainThread) : Send to jeedom : {'action': 'get_devices', 'source': 'PiZero'} [2021-10-18 09:49:51][DEBUG][root](Thread-1) : Status Code : 200 [2021-10-18 09:49:51][DEBUG][root](Thread-1) : Jeedom reply : {'success': True, 'value': 0} [2021-10-18 09:49:51][DEBUG][root](MainThread) : Status Code : 200 [2021-10-18 09:49:51][DEBUG][root](MainThread) : Jeedom reply : {'success': True, 'value': {'180': {'state': False, 'lastValueDate': '2021-10-18 10:49:51', 'name': 'Mobile_Bluetooth_Mag', 'humanName': '[Variables][Mobile_Bluetooth_Mag]', 'id': '180', 'macAddress': '08:aa:55:70:14:36'}, '177': {'state': False, 'lastValueDate': '2021-10-18 10:49:51', 'name': 'Mobile_Bluetooth_Nico', 'humanName': '[Variables][Mobile_Bluetooth_Nico]', 'id': '177', 'macAddress': '24:5A:B5:C4:3B:E2'}}} [2021-10-18 09:49:51][DEBUG][root](MainThread) : Send to jeedom : {'action': 'refresh_group', 'source': 'PiZero'} [2021-10-18 09:49:51][DEBUG][root](MainThread) : Status Code : 200 [2021-10-18 09:49:51][DEBUG][root](MainThread) : Jeedom reply : {'success': True, 'value': 0} [2021-10-18 09:49:51][INFO][root](MainThread) : Start thread detection for Mobile_Bluetooth_Mag [08:aa:55:70:14:36] [2021-10-18 09:49:51][DEBUG][root](MainThread) : Send to jeedom : {'action': 'get_status', 'id': 180, 'source': 'PiZero'} [2021-10-18 09:49:51][DEBUG][root](MainThread) : Status Code : 200 [2021-10-18 09:49:51][DEBUG][root](MainThread) : Jeedom reply : {'success': True, 'value': 0} [2021-10-18 09:49:51][DEBUG][root](MainThread) : Jeedom 180 device status: False [2021-10-18 09:49:51][DEBUG][root](Thread-3) : Get phone information 180 [2021-10-18 09:49:51][INFO][root](MainThread) : Start thread detection for Mobile_Bluetooth_Nico [24:5A:B5:C4:3B:E2] [2021-10-18 09:49:51][DEBUG][root](MainThread) : Send to jeedom : {'action': 'get_status', 'id': 177, 'source': 'PiZero'} [2021-10-18 09:49:52][DEBUG][root](MainThread) : Status Code : 200 [2021-10-18 09:49:52][DEBUG][root](MainThread) : Jeedom reply : {'success': True, 'value': 0} [2021-10-18 09:49:52][DEBUG][root](MainThread) : Jeedom 177 device status: False [2021-10-18 09:49:52][DEBUG][root](Thread-4) : Get phone information 177 [2021-10-18 09:49:52][INFO][root](MainThread) : Start phone_detectiond [2021-10-18 09:49:52][INFO][root](MainThread) : Log level : debug [2021-10-18 09:49:52][INFO][root](MainThread) : Socket : [2021-10-18 09:49:52][INFO][root](MainThread) : SocketHost : 192.168.1.0 [2021-10-18 09:49:52][INFO][root](MainThread) : SocketPort : 55009 [2021-10-18 09:49:52][INFO][root](MainThread) : PID file : /tmp/phone_detectiond.pid [2021-10-18 09:49:52][INFO][root](MainThread) : Device : hci0 [2021-10-18 09:49:52][INFO][root](MainThread) : Callback : http://192.168.1.1/plugins/phone_detection/core/php/phone_detection.php [2021-10-18 09:49:52][INFO][root](MainThread) : Daemon Name : PiZero [2021-10-18 09:49:52][INFO][root](MainThread) : Interval : 10 [2021-10-18 09:49:52][INFO][root](MainThread) : Present Interval : 20 [2021-10-18 09:49:52][INFO][root](MainThread) : AbsentThreshold: 60 [2021-10-18 09:49:52][INFO][root](MainThread) : Python version : 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0] [2021-10-18 09:49:52][DEBUG][root](MainThread) : Writing PID 776 to /tmp/phone_detectiond.pid [2021-10-18 09:49:52][INFO][root](MainThread) : Create phone_detection daemon [2021-10-18 09:49:52][DEBUG][root](MainThread) : Send to test connection to jeedom [2021-10-18 09:49:52][DEBUG][root](MainThread) : Send to jeedom : {'action': 'test', 'source': 'PiZero'} [2021-10-18 09:49:57][DEBUG][root](Thread-3) : 180 is absent [2021-10-18 09:49:57][DEBUG][root](Thread-3) : lastStateDate: 2021-10-18 10:49:51 [2021-10-18 09:49:57][DEBUG][root](Thread-3) : thresholdDate: 2021-10-18 10:50:51 [2021-10-18 09:49:57][DEBUG][root](Thread-3) : datetime.utcnow(): 2021-10-18 08:49:57.361698 [2021-10-18 09:49:57][DEBUG][root](Thread-3) : is datetime.utcnow() > thresholdDate ? False [2021-10-18 09:49:57][DEBUG][root](Thread-3) : 180 is up to date [2021-10-18 09:49:57][DEBUG][root](MainThread) : Status Code : 200 [2021-10-18 09:49:57][DEBUG][root](MainThread) : Jeedom reply : {'success': True, 'value': 0} [2021-10-18 09:49:57][INFO][root](MainThread) : Start heartbeat thread [2021-10-18 09:49:57][DEBUG][root](Thread-1) : Send to jeedom : {'action': 'heartbeat', 'source': 'PiZero'} [2021-10-18 09:49:57][INFO][root](MainThread) : Use TCP socket for Jeedom -> daemon communication Traceback (most recent call last): File "/home/pi/phone_detectiond/resources/phone_detectiond/phone_detectiond.py", line 509, in server = socketserver.TCPServer((args.sockethost, int(args.socketport)), JeedomHandler) File "/usr/lib/python3.7/socketserver.py", line 452, in __init__ self.server_bind() File "/usr/lib/python3.7/socketserver.py", line 466, in server_bind self.socket.bind(self.server_address) OSError: [Errno 98] Address already in use [2021-10-18 09:49:58][DEBUG][root](Thread-4) : 177 is present [2021-10-18 09:49:58][INFO][root](Thread-4) : Set Mobile_Bluetooth_Nico's phone present [2021-10-18 09:49:58][DEBUG][root](Thread-4) : 177 must be update [2021-10-18 09:49:58][DEBUG][root](Thread-4) : Mobile_Bluetooth_Nico status has changed to 'present'! Notify Jeedom. [2021-10-18 09:49:58][DEBUG][root](Thread-4) : device status: True [2021-10-18 09:49:58][DEBUG][root](Thread-4) : Send to jeedom : {'action': 'update_device_status', 'id': 177, 'value': 1, 'source': 'PiZero'} [2021-10-18 09:49:58][DEBUG][root](Thread-4) : Status Code : 200 [2021-10-18 09:49:58][DEBUG][root](Thread-4) : Jeedom reply : {'success': True, 'value': 1} [2021-10-18 09:50:07][DEBUG][root](Thread-3) : Get phone information 180 [2021-10-18 09:50:12][DEBUG][root](Thread-3) : 180 is absent [2021-10-18 09:50:12][DEBUG][root](Thread-3) : lastStateDate: 2021-10-18 10:49:51 [2021-10-18 09:50:12][DEBUG][root](Thread-3) : thresholdDate: 2021-10-18 10:50:51 [2021-10-18 09:50:12][DEBUG][root](Thread-3) : datetime.utcnow(): 2021-10-18 08:50:12.637555 [2021-10-18 09:50:12][DEBUG][root](Thread-3) : is datetime.utcnow() > thresholdDate ? False [2021-10-18 09:50:12][DEBUG][root](Thread-3) : 180 is up to date [2021-10-18 09:50:18][DEBUG][root](Thread-4) : Get phone information 177 [2021-10-18 09:50:18][DEBUG][root](Thread-4) : 177 is present [2021-10-18 09:50:18][DEBUG][root](Thread-4) : 177 is up to date [2021-10-18 09:50:21][DEBUG][root](Thread-1) : Send to jeedom : {'action': 'heartbeat', 'source': 'PiZero'} [2021-10-18 09:50:21][DEBUG][root](Thread-1) : Status Code : 200 [2021-10-18 09:50:21][DEBUG][root](Thread-1) : Jeedom reply : {'success': True, 'value': 0} [2021-10-18 09:50:22][DEBUG][root](Thread-3) : Get phone information 180 [2021-10-18 09:50:27][DEBUG][root](Thread-3) : 180 is absent [2021-10-18 09:50:27][DEBUG][root](Thread-3) : lastStateDate: 2021-10-18 10:49:51 [2021-10-18 09:50:27][DEBUG][root](Thread-3) : thresholdDate: 2021-10-18 10:50:51 [2021-10-18 09:50:27][DEBUG][root](Thread-3) : datetime.utcnow(): 2021-10-18 08:50:27.914472 [2021-10-18 09:50:27][DEBUG][root](Thread-3) : is datetime.utcnow() > thresholdDate ? False [2021-10-18 09:50:27][DEBUG][root](Thread-3) : 180 is up to date [2021-10-18 09:50:37][DEBUG][root](Thread-3) : Get phone information 180 [2021-10-18 09:50:38][DEBUG][root](Thread-4) : Get phone information 177 [2021-10-18 09:50:43][DEBUG][root](Thread-3) : 180 is absent [2021-10-18 09:50:43][DEBUG][root](Thread-3) : lastStateDate: 2021-10-18 10:49:51 [2021-10-18 09:50:43][DEBUG][root](Thread-3) : thresholdDate: 2021-10-18 10:50:51 [2021-10-18 09:50:43][DEBUG][root](Thread-3) : datetime.utcnow(): 2021-10-18 08:50:43.177223 [2021-10-18 09:50:43][DEBUG][root](Thread-3) : is datetime.utcnow() > thresholdDate ? False [2021-10-18 09:50:43][DEBUG][root](Thread-3) : 180 is up to date [2021-10-18 09:50:43][DEBUG][root](Thread-4) : 177 is present [2021-10-18 09:50:43][DEBUG][root](Thread-4) : 177 is up to date [2021-10-18 09:50:51][DEBUG][root](Thread-1) : Send to jeedom : {'action': 'heartbeat', 'source': 'PiZero'} [2021-10-18 09:50:51][DEBUG][root](Thread-1) : Status Code : 200 [2021-10-18 09:50:51][DEBUG][root](Thread-1) : Jeedom reply : {'success': True, 'value': 0}