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
549 stars 117 forks source link

Please add last_seen and per_device_timeout option #166

Open rolfberkenbosch opened 4 years ago

rolfberkenbosch commented 4 years ago

Hi, and thank you for building bt-mqtt-gateway. It is almost working perfect! I missing a few options.

The first thing is the set the timeout for per_device_timeout. Since MiFlora are not the fastest bluetooth device, it can sometime take about 30 seconds before they response. When I change this variable in const.py to 30. It is working.

The second thing I would like to add is the "last_seen" option. After each update of a device I would like to add the last_seen option. For example "last_seen":"2020-04-25T19:52:53+01:00". So you can check when the bt_mqtt_gateway has scant the device for the last time. This can be an handy indicator is some device stops responding. This option is also available at zigbee2mqtt, see: https://www.zigbee2mqtt.io/information/configuration.html

zewelor commented 4 years ago

per device timeout for miflora added here: https://github.com/zewelor/bt-mqtt-gateway/pull/171