zewelor / bt-mqtt-gateway

A simple Python script which provides a Bluetooth to MQTT gateway, easily extensible via custom workers. See https://github.com/zewelor/bt-mqtt-gateway/wiki for more information.
MIT License
550 stars 117 forks source link

[solved] Since the last version I have a problem blescanmulti #99

Closed dckiller51 closed 5 years ago

dckiller51 commented 5 years ago

Hello, I updated the maj. Since if the balance does not communicate BT-GATEWAY no longer works. I have to connect it for it to work.

I also have my two nut finder which stays in home and therefore does not spend more not_home.

sudo ./gateway.py -d 2019-09-05 21:03:26,223 INFO bt-mqtt-gw gateway.py:41:<module> - Starting 2019-09-05 21:03:26,232 DEBUG bt-mqtt-gw.mqtt mqtt.py:28:__init__ - Setting LWT to: btgateway/lwt_top ic 2019-09-05 21:03:27,255 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:77:register_workers - Add ed miscale worker with 300 seconds interval and a 35 seconds timeout 2019-09-05 21:03:30,025 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:77:register_workers - Add ed blescanmulti worker with 60 seconds interval and a 35 seconds timeout 2019-09-05 21:03:30,050 DEBUG bt-mqtt-gw.mqtt mqtt.py:100:callbacks_subscription - Subscribing to: bt gateway/miscale/update_interval 2019-09-05 21:03:30,056 DEBUG bt-mqtt-gw.mqtt mqtt.py:100:callbacks_subscription - Subscribing to: bt gateway/blescan/update_interval 2019-09-05 21:03:30,064 DEBUG bt-mqtt-gw.mqtt mqtt.py:100:callbacks_subscription - Subscribing to: bt gateway/homeassistant/status 2019-09-05 21:03:30,097 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:128:update_all - Updating all workers 2019-09-05 21:03:40,317 ERROR bt-mqtt-gw logger.py:48:log_exception - Fatal error while executing wor ker command: TimeoutError Traceback (most recent call last): File "./gateway.py", line 53, in <module> mqtt.publish(_WORKERS_QUEUE.get(timeout=10).execute()) File "/home/dckiller/bt-mqtt-gateway/workers_manager.py", line 41, in execute messages = self._callback(*self._args) File "/home/dckiller/bt-mqtt-gateway/workers/miscale.py", line 18, in status_update return [MqttMessage(topic=self.format_topic('weight/kg'), payload=self._get_weight())] File "/home/dckiller/bt-mqtt-gateway/workers/miscale.py", line 29, in _get_weight time.sleep(1) File "/usr/local/lib/python3.5/dist-packages/interruptingcow/__init__.py", line 74, in handler raise exception TimeoutError: Retrieving the weight from miscale device c8:47:8c:9f:7b:0a timed out after 5 seconds Traceback (most recent call last): File "./gateway.py", line 63, in <module> raise e File "./gateway.py", line 53, in <module> mqtt.publish(_WORKERS_QUEUE.get(timeout=10).execute()) File "/home/dckiller/bt-mqtt-gateway/workers_manager.py", line 41, in execute messages = self._callback(*self._args) File "/home/dckiller/bt-mqtt-gateway/workers/miscale.py", line 18, in status_update return [MqttMessage(topic=self.format_topic('weight/kg'), payload=self._get_weight())] File "/home/dckiller/bt-mqtt-gateway/workers/miscale.py", line 29, in _get_weight time.sleep(1) File "/usr/local/lib/python3.5/dist-packages/interruptingcow/__init__.py", line 74, in handler raise exception TimeoutError: Retrieving the weight from miscale device c8:47:8c:9f:7b:0a timed out after 5 seconds

Thanks

zewelor commented 5 years ago

I've uploaded fix, please try and report if it works now.

dckiller51 commented 5 years ago

Once on home he does not rebase into no_home.

To update I'm just doing it cd bt-mqtt-gateway git pull origin master

Then I recharge my configuration.yaml. Then I reboot. I've not forgotten anything ?

dckiller51 commented 5 years ago

After update.

The scale is not connected, the nut 1 and 2 are at home

2019-09-08 00:32:08,879 INFO bt-mqtt-gw gateway.py:61: - Starting 2019-09-08 00:32:08,887 DEBUG bt-mqtt-gw.mqtt mqtt.py:30:init - Setting LWT to: btgateway/lwt_topic 2019-09-08 00:32:09,892 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:103: register_workers - Added blescanmulti worker with 60 seconds interval and a 35 s econds timeout 2019-09-08 00:32:12,018 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:103: register_workers - Added miscale worker with 300 seconds interval and a 35 secon ds timeout 2019-09-08 00:32:12,042 DEBUG bt-mqtt-gw.mqtt mqtt.py:116:callbacks_subscription - Subscribing to: btgateway/blescan/update_interval 2019-09-08 00:32:12,047 DEBUG bt-mqtt-gw.mqtt mqtt.py:116:callbacks_subscription - Subscribing to: btgateway/miscale/update_interval 2019-09-08 00:32:12,053 DEBUG bt-mqtt-gw.mqtt mqtt.py:116:callbacks_subscription - Subscribing to: btgateway/homeassistant/status 2019-09-08 00:32:12,083 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:171: update_all - Updating all workers 2019-09-08 00:32:12,227 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20 :handleDiscovery - Discovered new device: 8c:f7:10:2a:86:93 2019-09-08 00:32:12,250 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20 :handleDiscovery - Discovered new device: 47:01:47:10:76:46 2019-09-08 00:32:12,266 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20 :handleDiscovery - Discovered new device: 16:66:16:1b:7a:d8 2019-09-08 00:32:12,290 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20 :handleDiscovery - Discovered new device: 72:e1:53:73:95:08 2019-09-08 00:32:12,322 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20 :handleDiscovery - Discovered new device: 65:f3:98:7b:94:51 2019-09-08 00:32:12,378 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20 :handleDiscovery - Discovered new device: 2b:8b:14:7b:38:e6 2019-09-08 00:32:12,506 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20 :handleDiscovery - Discovered new device: 46:76:3a:cc:79:d5 2019-09-08 00:32:12,738 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20 :handleDiscovery - Discovered new device: 59:90:94:c1:b6:3f 2019-09-08 00:32:13,179 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20 :handleDiscovery - Discovered new device: 90:dd:5d:aa:bb:f0 2019-09-08 00:32:22,212 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:64:execute - Execution result of command BlescanmultiWorker.status_update: [{'payload': 'home', 'topic': 'blescan/presence/nut_aurelien'}, {'payload': -74, 'topic': 'blescan/presence/nut_aurelien/rssi'}] 2019-09-08 00:32:32,365 ERROR bt-mqtt-gw logger.py:50:log_exception - Fatal error while executing worker command: DeviceTimeoutError Traceback (most recent call last): File "./gateway.py", line 73, in mqtt.publish(_WORKERS_QUEUE.get(timeout=10).execute()) File "/home/dckiller/bt-mqtt-gateway/workers_manager.py", line 55, in execute messages = self._callback(self._args) File "/home/dckiller/bt-mqtt-gateway/workers/miscale.py", line 22, in status_update topic=self.format_topic("weight/kg"), payload=self._get_weight() File "/home/dckiller/bt-mqtt-gateway/workers/miscale.py", line 42, in _get_weight time.sleep(1) File "/usr/local/lib/python3.5/dist-packages/interruptingcow/init.py", line 74, in handler raise exception exceptions.DeviceTimeoutError: Retrieving the weight from miscale device c8:47:8c:9f:7b:0a timed out after 5 seconds Traceback (most recent call last): File "./gateway.py", line 91, in raise e File "./gateway.py", line 73, in mqtt.publish(_WORKERS_QUEUE.get(timeout=10).execute()) File "/home/dckiller/bt-mqtt-gateway/workers_manager.py", line 55, in execute messages = self._callback(self._args) File "/home/dckiller/bt-mqtt-gateway/workers/miscale.py", line 22, in status_update topic=self.format_topic("weight/kg"), payload=self._get_weight() File "/home/dckiller/bt-mqtt-gateway/workers/miscale.py", line 42, in _get_weight time.sleep(1) File "/usr/local/lib/python3.5/dist-packages/interruptingcow/init.py", line 74, in handler raise exception exceptions.DeviceTimeoutError: Retrieving the weight from miscale device c8:47:8c:9f:7b:0a timed out after 5 seconds

dckiller51 commented 5 years ago

Si je connect la balance, le nut 1 est à la maison et le nut 2 pas à la maison. Apres je rentre avec le nut 2.

2019-09-08 00:37:00,891 INFO bt-mqtt-gw gateway.py:61: - Starting 2019-09-08 00:37:00,902 DEBUG bt-mqtt-gw.mqtt mqtt.py:30:init - Setting LWT to: btgateway/lwt_topic 2019-09-08 00:37:01,978 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:103:register_workers - Added miscale worker with 300 seconds interval and a 35 seconds timeout 2019-09-08 00:37:07,015 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:103:register_workers - Added blescanmulti worker with 60 seconds interval and a 35 seconds timeout 2019-09-08 00:37:07,050 DEBUG bt-mqtt-gw.mqtt mqtt.py:116:callbacks_subscription - Subscribing to: btgateway/miscale/update_interval 2019-09-08 00:37:07,062 DEBUG bt-mqtt-gw.mqtt mqtt.py:116:callbacks_subscription - Subscribing to: btgateway/blescan/update_interval 2019-09-08 00:37:07,076 DEBUG bt-mqtt-gw.mqtt mqtt.py:116:callbacks_subscription - Subscribing to: btgateway/homeassistant/status 2019-09-08 00:37:07,127 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:171:update_all - Updating all workers 2019-09-08 00:37:12,332 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:64:execute - Execution result of command MiscaleWorker.status_update: [{'topic': 'miscale/weight/kg', 'payload': 70.55}] 2019-09-08 00:37:12,457 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 8c:f7:10:2a:86:93 2019-09-08 00:37:12,481 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 2b:8b:14:7b:38:e6 2019-09-08 00:37:12,697 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 59:90:94:c1:b6:3f 2019-09-08 00:37:12,937 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 47:01:47:10:76:46 2019-09-08 00:37:12,985 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 65:f3:98:7b:94:51 2019-09-08 00:37:13,027 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 90:dd:5d:aa:bb:f0 2019-09-08 00:37:13,327 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: c8:47:8c:9f:7b:0a 2019-09-08 00:37:13,362 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 16:66:16:1b:7a:d8 2019-09-08 00:37:13,619 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 46:76:3a:cc:79:d5 2019-09-08 00:37:14,043 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 72:e1:53:73:95:08 2019-09-08 00:37:22,445 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:64:execute - Execution result of command BlescanmultiWorker.status_update: [{'topic': 'blescan/presence/nut_aurelien', 'payload': 'home'}, {'topic': 'blescan/presence/nut_aurelien/rssi', 'payload': -62}] 2019-09-08 00:38:17,192 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:64:execute - Execution result of command BlescanmultiWorker.status_update: [] 2019-09-08 00:39:07,297 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 90:dd:5d:aa:bb:f0 2019-09-08 00:39:07,329 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 3c:7d:e6:fa:2f:89 2019-09-08 00:39:07,352 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 59:90:94:c1:b6:3f 2019-09-08 00:39:07,368 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 16:66:16:1b:7a:d8 2019-09-08 00:39:07,393 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: c8:47:8c:9f:7b:0a 2019-09-08 00:39:07,507 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 8c:f7:10:2a:86:93 2019-09-08 00:39:07,606 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 65:f3:98:7b:94:51 2019-09-08 00:39:07,790 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 47:01:47:10:76:46 2019-09-08 00:39:08,106 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 72:e1:53:73:95:08 2019-09-08 00:39:08,602 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 46:76:3a:cc:79:d5 2019-09-08 00:39:17,264 ERROR bt-mqtt-gw logger.py:50:log_exception - Fatal error while executing worker command: BTLEDisconnectError Traceback (most recent call last): File "./gateway.py", line 73, in mqtt.publish(_WORKERS_QUEUE.get(timeout=10).execute()) File "/home/dckiller/bt-mqtt-gateway/workers_manager.py", line 55, in execute messages = self._callback(self._args) File "/home/dckiller/bt-mqtt-gateway/workers/blescanmulti.py", line 112, in status_update float(self.scan_timeout), passive=booleanize(self.scan_passive) File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 854, in scan self.stop() File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 803, in stop self._mgmtCmd(self._cmd()+"end") File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 309, in _mgmtCmd rsp = self._waitResp('mgmt') File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 362, in _waitResp raise BTLEDisconnectError("Device disconnected", resp) bluepy.btle.BTLEDisconnectError: Device disconnected Traceback (most recent call last): File "./gateway.py", line 91, in raise e File "./gateway.py", line 73, in mqtt.publish(_WORKERS_QUEUE.get(timeout=10).execute()) File "/home/dckiller/bt-mqtt-gateway/workers_manager.py", line 55, in execute messages = self._callback(self._args) File "/home/dckiller/bt-mqtt-gateway/workers/blescanmulti.py", line 112, in status_update float(self.scan_timeout), passive=booleanize(self.scan_passive) File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 854, in scan self.stop() File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 803, in stop self._mgmtCmd(self._cmd()+"end") File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 309, in _mgmtCmd rsp = self._waitResp('mgmt') File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 362, in _waitResp raise BTLEDisconnectError("Device disconnected", resp) bluepy.btle.BTLEDisconnectError: Device disconnected

dckiller51 commented 5 years ago

If I disable the balance in the configuration.yaml file. No problem

2019-09-08 00:45:39,451 INFO bt-mqtt-gw gateway.py:61: - Starting 2019-09-08 00:45:39,459 DEBUG bt-mqtt-gw.mqtt mqtt.py:30:init - Setting LWT to: btgateway/lwt_topic 2019-09-08 00:45:40,383 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:103:register_workers - Added blescanmulti worker with 60 seconds interval and a 35 seconds timeout 2019-09-08 00:45:42,061 DEBUG bt-mqtt-gw.mqtt mqtt.py:116:callbacks_subscription - Subscribing to: btgateway/blescan/update_interval 2019-09-08 00:45:42,068 DEBUG bt-mqtt-gw.mqtt mqtt.py:116:callbacks_subscription - Subscribing to: btgateway/homeassistant/status 2019-09-08 00:45:42,091 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:171:update_all - Updating all workers 2019-09-08 00:45:42,173 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 90:dd:5d:aa:bb:f0 2019-09-08 00:45:42,197 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 8c:f7:10:2a:86:93 2019-09-08 00:45:42,221 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 75:19:2f:93:8a:ca 2019-09-08 00:45:42,245 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 3c:7d:e6:fa:2f:89 2019-09-08 00:45:42,285 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 16:66:16:1b:7a:d8 2019-09-08 00:45:42,325 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 47:01:47:10:76:46 2019-09-08 00:45:42,709 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 72:e1:53:73:95:08 2019-09-08 00:45:42,781 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 46:76:3a:cc:79:d5 2019-09-08 00:45:42,805 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 6d:c1:17:b9:50:f1 2019-09-08 00:45:42,917 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: c8:47:8c:9f:7b:0a 2019-09-08 00:45:52,168 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:64:execute - Execution result of command BlescanmultiWorker.status_update: [{'topic': 'blescan/presence/nut_aurelien', 'payload': 'home'}, {'topic': 'blescan/presence/nut_aurelien/rssi', 'payload': -74}] 2019-09-08 00:46:42,198 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 3c:7d:e6:fa:2f:89 2019-09-08 00:46:42,222 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 8c:f7:10:2a:86:93 2019-09-08 00:46:42,247 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 90:dd:5d:aa:bb:f0 2019-09-08 00:46:42,494 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 6d:c1:17:b9:50:f1 2019-09-08 00:46:42,518 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 42:b3:d5:35:eb:c8 2019-09-08 00:46:42,566 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 6d:56:64:43:ed:3e 2019-09-08 00:46:42,598 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 75:19:2f:93:8a:ca 2019-09-08 00:46:42,662 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 16:66:16:1b:7a:d8 2019-09-08 00:46:43,006 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 46:76:3a:cc:79:d5 2019-09-08 00:46:43,542 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: c8:47:8c:9f:7b:0a 2019-09-08 00:46:52,162 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:64:execute - Execution result of command BlescanmultiWorker.status_update: [] 2019-09-08 00:47:42,190 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 2b:36:d5:f6:f3:30 2019-09-08 00:47:42,213 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 42:b3:d5:35:eb:c8 2019-09-08 00:47:42,245 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 8c:f7:10:2a:86:93 2019-09-08 00:47:42,445 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 6d:c1:17:b9:50:f1 2019-09-08 00:47:42,461 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 90:dd:5d:aa:bb:f0 2019-09-08 00:47:42,693 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 16:66:16:1b:7a:d8 2019-09-08 00:47:42,757 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 75:19:2f:93:8a:ca 2019-09-08 00:47:42,958 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 4d:76:3a:c9:4c:9a 2019-09-08 00:47:43,158 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: c8:47:8c:9f:7b:0a 2019-09-08 00:47:43,246 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 46:76:3a:cc:79:d5 2019-09-08 00:47:43,312 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 6d:56:64:43:ed:3e 2019-09-08 00:47:52,185 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:64:execute - Execution result of command BlescanmultiWorker.status_update: [{'topic': 'blescan/presence/nut_siham', 'payload': 'home'}, {'topic': 'blescan/presence/nut_siham/rssi', 'payload': -81}] 2019-09-08 00:48:42,214 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 16:66:16:1b:7a:d8 2019-09-08 00:48:42,252 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 2b:36:d5:f6:f3:30 2019-09-08 00:48:42,277 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 8c:f7:10:2a:86:93 2019-09-08 00:48:42,324 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 90:dd:5d:aa:bb:f0 2019-09-08 00:48:42,348 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 6d:c1:17:b9:50:f1 2019-09-08 00:48:42,460 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 42:b3:d5:35:eb:c8 2019-09-08 00:48:42,637 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 75:19:2f:93:8a:ca 2019-09-08 00:48:43,429 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 46:76:3a:cc:79:d5 2019-09-08 00:48:43,453 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 6d:56:64:43:ed:3e 2019-09-08 00:48:43,766 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: c8:47:8c:9f:7b:0a 2019-09-08 00:48:52,250 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:64:execute - Execution result of command BlescanmultiWorker.status_update: [] 2019-09-08 00:49:42,213 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 75:19:2f:93:8a:ca 2019-09-08 00:49:42,236 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 16:66:16:1b:7a:d8 2019-09-08 00:49:42,260 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 8c:f7:10:2a:86:93 2019-09-08 00:49:42,284 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 2b:36:d5:f6:f3:30 2019-09-08 00:49:42,308 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 46:76:3a:cc:79:d5 2019-09-08 00:49:42,334 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 42:b3:d5:35:eb:c8 2019-09-08 00:49:42,516 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 6d:c1:17:b9:50:f1 2019-09-08 00:49:42,532 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 90:dd:5d:aa:bb:f0 2019-09-08 00:49:43,893 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 6d:56:64:43:ed:3e 2019-09-08 00:49:45,445 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: c8:47:8c:9f:7b:0a 2019-09-08 00:49:52,234 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:64:execute - Execution result of command BlescanmultiWorker.status_update: []

joselito11 commented 5 years ago

With last update finally Chipolo with blescanmulti: works without false triggers! No one other BT script,... for HA can do this! Great work @zewelor! It is possible to eliminate/shorten long false trigger when HA restarts?

zewelor commented 5 years ago

@dckiller51 I've pushed another fix for miscale, please try it now.

@joselito11 Post mqtt messages, around ha restart, and HA sensor config.

dckiller51 commented 5 years ago

when you go from home to not_home an error occurs.

My file mqtt hassio. May be an error on this side

broker: !sercet ip_hassio username: !secret mqtt_user password: !secret mqtt_pwd discovery: true discovery_prefix: homeassistant birth_message: topic: 'homeassistant/status' payload: 'online' will_message: topic: 'homeassistant/status' payload: 'offline'

2019-09-08 22:27:25,902 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 5d:91:58:8d:ab:28 2019-09-08 22:27:26,424 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 64:a8:2e:6b:b4:a0 2019-09-08 22:27:26,576 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 46:76:3a:cc:79:d5 2019-09-08 22:27:27,853 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 6d:26:6d:8d:24:0b 2019-09-08 22:27:35,521 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:64:execute - Execution result of command BlescanmultiWorker.status_update: [] 2019-09-08 22:28:25,591 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 5d:91:58:8d:ab:28 2019-09-08 22:28:25,614 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 8c:f7:10:2a:86:93 2019-09-08 22:28:25,638 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 46:da:14:65:cb:8b 2019-09-08 22:28:25,662 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 22:3f:77:8f:52:bc 2019-09-08 22:28:25,678 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 90:dd:5d:aa:bb:f0 2019-09-08 22:28:25,750 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 64:a8:2e:6b:b4:a0 2019-09-08 22:28:26,182 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 33:09:91:aa:39:fa 2019-09-08 22:28:26,509 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 6d:26:6d:8d:24:0b 2019-09-08 22:28:26,877 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 46:76:3a:cc:79:d5 2019-09-08 22:28:35,557 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:64:execute - Execution result of command BlescanmultiWorker.status_update: [] 2019-09-08 22:29:25,559 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 46:da:14:65:cb:8b 2019-09-08 22:29:25,574 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 90:dd:5d:aa:bb:f0 2019-09-08 22:29:25,598 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 5d:91:58:8d:ab:28 2019-09-08 22:29:25,646 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 46:76:3a:cc:79:d5 2019-09-08 22:29:25,694 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 22:3f:77:8f:52:bc 2019-09-08 22:29:25,718 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 8c:f7:10:2a:86:93 2019-09-08 22:29:26,357 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 33:09:91:aa:39:fa 2019-09-08 22:29:26,967 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 6d:26:6d:8d:24:0b 2019-09-08 22:29:27,032 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 4d:76:3a:c9:4c:9a 2019-09-08 22:29:27,727 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 64:a8:2e:6b:b4:a0 2019-09-08 22:29:35,544 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:64:execute - Execution result of command BlescanmultiWorker.status_update: [{'payload': 'home', 'topic': 'blescan/presence/nut_siham'}, {'payload': -83, 'topic': 'blescan/presence/nut_siham/rssi'}] 2019-09-08 22:30:34,711 ERROR bt-mqtt-gw logger.py:50:log_exception - Retrieving the weight from miscale device c8:47:8c:9f:7b:0a timed out after 5 seconds Traceback (most recent call last): File "./gateway.py", line 73, in mqtt.publish(_WORKERS_QUEUE.get(timeout=10).execute()) File "/home/dckiller/bt-mqtt-gateway/workers_manager.py", line 55, in execute messages = self._callback(self._args) File "/home/dckiller/bt-mqtt-gateway/workers/miscale.py", line 22, in status_update topic=self.format_topic("weight/kg"), payload=self._get_weight() File "/home/dckiller/bt-mqtt-gateway/workers/miscale.py", line 42, in _get_weight time.sleep(1) File "/usr/local/lib/python3.5/dist-packages/interruptingcow/init.py", line 74, in handler raise exception exceptions.DeviceTimeoutError: Retrieving the weight from miscale device c8:47:8c:9f:7b:0a timed out after 5 seconds 2019-09-08 22:30:34,887 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 67:2b:2d:58:c9:76 2019-09-08 22:30:34,910 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 22:3f:77:8f:52:bc 2019-09-08 22:30:34,934 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 90:dd:5d:aa:bb:f0 2019-09-08 22:30:34,958 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 8c:f7:10:2a:86:93 2019-09-08 22:30:34,982 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 70:aa:e7:b4:d3:b8 2019-09-08 22:30:35,456 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 33:09:91:aa:39:fa 2019-09-08 22:30:35,479 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 46:76:3a:cc:79:d5 2019-09-08 22:30:36,420 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 64:a8:2e:6b:b4:a0 2019-09-08 22:30:37,376 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 47:1b:1f:a9:7e:42 2019-09-08 22:30:44,881 DEBUG bt-mqtt-gw.workers_manager workers_manager.py:64:execute - Execution result of command BlescanmultiWorker.status_update: [] 2019-09-08 22:31:25,550 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 70:aa:e7:b4:d3:b8 2019-09-08 22:31:25,574 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 8c:f7:10:2a:86:93 2019-09-08 22:31:25,606 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 22:3f:77:8f:52:bc 2019-09-08 22:31:25,670 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 90:dd:5d:aa:bb:f0 2019-09-08 22:31:25,854 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 67:2b:2d:58:c9:76 2019-09-08 22:31:25,870 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 33:09:91:aa:39:fa 2019-09-08 22:31:26,484 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 64:a8:2e:6b:b4:a0 2019-09-08 22:31:27,487 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 46:76:3a:cc:79:d5 2019-09-08 22:31:28,397 DEBUG bt-mqtt-gw.workers.blescanmulti blescanmulti.py:20:handleDiscovery - Discovered new device: 47:1b:1f:a9:7e:42 2019-09-08 22:32:00,376 ERROR bt-mqtt-gw logger.py:50:log_exception - Execution of command BlescanmultiWorker.status_update timed out after 35 seconds Traceback (most recent call last): File "./gateway.py", line 73, in mqtt.publish(_WORKERS_QUEUE.get(timeout=10).execute()) File "/home/dckiller/bt-mqtt-gateway/workers_manager.py", line 62, in execute raise e File "/home/dckiller/bt-mqtt-gateway/workers_manager.py", line 55, in execute messages = self._callback(self._args) File "/home/dckiller/bt-mqtt-gateway/workers/blescanmulti.py", line 112, in status_update float(self.scan_timeout), passive=booleanize(self.scan_passive) File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 854, in scan self.stop() File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 803, in stop self._mgmtCmd(self._cmd()+"end") File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 309, in _mgmtCmd rsp = self._waitResp('mgmt') File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 361, in _waitResp self._stopHelper() File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 294, in _stopHelper self._helper.wait() File "/usr/lib/python3.5/subprocess.py", line 1389, in wait (pid, sts) = self._try_wait(0) File "/usr/lib/python3.5/subprocess.py", line 1339, in _try_wait (pid, sts) = os.waitpid(self.pid, wait_flags) File "/usr/local/lib/python3.5/dist-packages/interruptingcow/init.py", line 74, in handler raise exception exceptions.WorkerTimeoutError: Execution of command BlescanmultiWorker.status_update timed out after 35 seconds 2019-09-08 22:32:25,428 ERROR bt-mqtt-gw logger.py:50:log_exception - Fatal error while executing worker command: BTLEInternalError Traceback (most recent call last): File "./gateway.py", line 73, in mqtt.publish(_WORKERS_QUEUE.get(timeout=10).execute()) File "/home/dckiller/bt-mqtt-gateway/workers_manager.py", line 55, in execute messages = self._callback(self._args) File "/home/dckiller/bt-mqtt-gateway/workers/blescanmulti.py", line 112, in status_update float(self.scan_timeout), passive=booleanize(self.scan_passive) File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 852, in scan self.start(passive=passive) File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 790, in start self._mgmtCmd("le on") File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 309, in _mgmtCmd rsp = self._waitResp('mgmt') File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 339, in _waitResp raise BTLEInternalError("Helper exited") bluepy.btle.BTLEInternalError: Helper exited Traceback (most recent call last): File "./gateway.py", line 91, in raise e File "./gateway.py", line 73, in mqtt.publish(_WORKERS_QUEUE.get(timeout=10).execute()) File "/home/dckiller/bt-mqtt-gateway/workers_manager.py", line 55, in execute messages = self._callback(self._args) File "/home/dckiller/bt-mqtt-gateway/workers/blescanmulti.py", line 112, in status_update float(self.scan_timeout), passive=booleanize(self.scan_passive) File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 852, in scan self.start(passive=passive) File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 790, in start self._mgmtCmd("le on") File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 309, in _mgmtCmd rsp = self._waitResp('mgmt') File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 339, in _waitResp raise BTLEInternalError("Helper exited") bluepy.btle.BTLEInternalError: Helper exited

dckiller51 commented 5 years ago

By letting turn I have the nut which is good not_home pass. I think that must work.

Sorry my english

dckiller51 commented 5 years ago

It works now. Thank you. It remains for me to solve the problem after the restart of Hassio my nut remains unknown until a change of state. File configuration.yaml hassio

broker: !secret ip_hassio username: !secret mqtt_user password: !secret mqtt_pwd discovery: true discovery_prefix: homeassistant birth_message: topic: 'homeassistant/status' payload: 'online' will_message: topic: 'homeassistant/status' payload: 'offline'

File config.yaml bt-gateway

topic_prefix: btgateway client_id: bt-mqtt-gateway availability_topic: lwt_topic manager: sensor_config: topic: homeassistant retain: true topic_subscription: update_all: topic: homeassistant/status payload: online command_timeout: 35

joselito11 commented 5 years ago

@zewelor

-- Logs begin at Thu 2016-11-03 18:16:43 CET. --
Sep 10 23:05:48 OMVtilen systemd[1]: Started Bluetooth MQTT gateway.
-- Subject: Unit bt-mqtt-gateway.service has finished start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit bt-mqtt-gateway.service has finished starting up.
-- 
-- The start-up result is done.
Sep 10 23:06:01 OMVtilen gateway.py[987]: 23:06:01 Starting
Sep 10 23:06:20 OMVtilen gateway.py[987]: Traceback (most recent call last):
Sep 10 23:06:20 OMVtilen gateway.py[987]:   File "/root/gateway.py", line 67, in <module>
Sep 10 23:06:20 OMVtilen gateway.py[987]:     manager.register_workers(global_topic_prefix).start(mqtt)
Sep 10 23:06:20 OMVtilen gateway.py[987]:   File "/root/workers_manager.py", line 156, in start
Sep 10 23:06:20 OMVtilen gateway.py[987]:     mqtt.callbacks_subscription(self._mqtt_callbacks)
Sep 10 23:06:20 OMVtilen gateway.py[987]:   File "/root/mqtt.py", line 112, in callbacks_subscription
Sep 10 23:06:20 OMVtilen gateway.py[987]:     self.mqttc.connect(self.hostname, port=self.port)
Sep 10 23:06:20 OMVtilen gateway.py[987]:   File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 839, in connect
Sep 10 23:06:20 OMVtilen gateway.py[987]:     return self.reconnect()
Sep 10 23:06:20 OMVtilen gateway.py[987]:   File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 962, in reconnect
Sep 10 23:06:20 OMVtilen gateway.py[987]:     sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0))
Sep 10 23:06:20 OMVtilen gateway.py[987]:   File "/usr/lib/python3.5/socket.py", line 694, in create_connection
Sep 10 23:06:20 OMVtilen gateway.py[987]:     for res in getaddrinfo(host, port, 0, SOCK_STREAM):
Sep 10 23:06:20 OMVtilen gateway.py[987]:   File "/usr/lib/python3.5/socket.py", line 733, in getaddrinfo
Sep 10 23:06:20 OMVtilen gateway.py[987]:     for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
Sep 10 23:06:20 OMVtilen gateway.py[987]: socket.gaierror: [Errno -2] Name or service not known
Sep 10 23:06:21 OMVtilen systemd[1]: bt-mqtt-gateway.service: Main process exited, code=exited, status=1/FAILURE
Sep 10 23:06:21 OMVtilen systemd[1]: bt-mqtt-gateway.service: Unit entered failed state.
Sep 10 23:06:21 OMVtilen systemd[1]: bt-mqtt-gateway.service: Failed with result 'exit-code'.
Sep 10 23:06:21 OMVtilen systemd[1]: bt-mqtt-gateway.service: Service hold-off time over, scheduling restart.
Sep 10 23:06:21 OMVtilen systemd[1]: Stopped Bluetooth MQTT gateway.
-- Subject: Unit bt-mqtt-gateway.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit bt-mqtt-gateway.service has finished shutting down.
Sep 10 23:06:21 OMVtilen systemd[1]: Started Bluetooth MQTT gateway.
-- Subject: Unit bt-mqtt-gateway.service has finished start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit bt-mqtt-gateway.service has finished starting up.
-- 
-- The start-up result is done.
Sep 10 23:06:24 OMVtilen gateway.py[2074]: 23:06:24 Starting

- platform: mqtt
    state_topic: blescan/presence/beacon
    name: "chipoloBT"

  - platform: mqtt
    state_topic: blescan/presence/beacon/rssi
    name: "chipoloBTrssi"

  - platform: template
    sensors:
      chipolo_distance:
        friendly_name: "Odaljenost Chipolo"
        value_template: >
          {% if is_state("sensor.chipolobt", "home") %}
            {{(10**((-60-(states.sensor.realistic_chipolo_rssi.state | int)) / 30)) | round(2)}}
          {% endif %}
        unit_of_measurement: 'm'
        icon_template: mdi:counter

  - platform: filter
    name: "Realistic Chipolo RSSI"
    entity_id: sensor.chipolobtrssi
    filters:
    - filter: outlier
      window_size: 4
      radius: 4.0
    - filter: lowpass
      time_constant: 10
      precision: 2 

Also run script manual after restart, but still no message after few minutes. I run script on rPI with OMV, HA is on NUC

zewelor commented 5 years ago

@joselito11 Looks like you don't connect to mqtt server. Check host / ip in configuration.

joselito11 commented 5 years ago

It looks so, but I have 2 workers, oralb toothbrush is working and reporting, also when is ble unknown.

joselito11 commented 5 years ago

With last update blescanmulti needs only 22minutes to report again, much better!

dckiller51 commented 5 years ago

It works well now before closing ticket do you know how I can reboot the gateway remotely via home assitant.

The nut does not go back after the reboot of home assistant even with the birth_message.

SSH command ....

dckiller51 commented 5 years ago

Closed