Time_between doesn't work in python version

Hello

I first want to congratulate you for the great job!
I have 2 theengs antennas, one local on docker and the other on a remote pizero with python 3.9.2 / debian 11.
I’m looking for a way to limit de frequency of messages as the antennas are very reactive and saturate my broker!

Whereas the docker version correctly takes "time_between": 60 into account it has no effect on the python version running on my remote antenna.

As you can see on the screenshot below the # of received messages for the remote antenna is far higher and increments almost every second… (I’ve restarted both antennas simultaneously)

theengs

Any suggestions?
Thanks

Would you mind making another screenshot, or copy and paste, but with both BTtoMQTT actually being populated with their settings, including their interval, intervalacts etc. in ms.

And obviously Theengs Gateway doesn’t have that, only OpenMQTTGateway :wink: so could you have a look in the theengsgw.conf configuration file of the remote Gateway for its “ble_time_between_scans” value?

Also, due to the non-default (sub)topic and remote structure, how did you issue the remote Python version time_between?

It could well be that you used the non-working --time_between, whereas the abbreviated -tb does work correctly.There is a documentation vs. implementation discrepancy, which has recently been fixed in the development branch docs.

Hello

My mistake the time_between value was incorrect on the remote py antenna, it’s far better now eg 2-4 messages/min:

20/05/2024 12:28:19 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -63, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:28:19(-0.05 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -63, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:27:14(-64.87 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -62, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:27:14(-0.04 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -62, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:26:07(-66.33 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -66, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:26:07(-0.06 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -66, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:25:02(-65.37 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -64, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:25:02(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -64, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:25:02(-0.21 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -51, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:25:02(-0.05 seconds) 

Still it seems I have the same problem on the docker version. Here’s my docker-compose.yml:

services:
  theengs:
    container_name: theengs
    image: theengs/gateway
    network_mode: host
    privileged: true
    restart: unless-stopped
    environment:
      MQTT_HOST: localhost
      MQTT_USERNAME: jeedom
      MQTT_PASSWORD: xxxxx
      MQTT_PUB_TOPIC: theengs/tgw_local/BTtoMQTT
      MQTT_SUB_TOPIC: theengs/tgw_local/commands
      LWT_TOPIC: theengs/tgw_local/LWT
#     PUBLISH_ALL: true
      TIME_BETWEEN: 60
      SCAN_TIME: 5
      LOG_LEVEL: WARNING
      DISCOVERY_DEVICE_NAME: tgw_local
      DISCOVERY_FILTER: "[IBEACON,GAEN,MS-CDP]"
#     SCANNING_MODE: active
      ADAPTER: hci0
    volumes:
      - /var/lib/docker/store/theengs/:/config/
      - /var/run/dbus:/var/run/dbus
    healthcheck:
      test: 'hciconfig|awk "/hci0/{ print $0 }" || exit 1'
      interval: 1m
      timeout: 1s
      start_period: 5s
      retries: 3

here’s what I get for this antenna on the same device eg ~25 messages/min:

20/05/2024 12:24:58 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:24:58(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:24:57(-0.29 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:24:57(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:24:57(-0.32 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:24:57(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:24:57(-0.33 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -84, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:24:57(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -84, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:24:56(-0.28 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:24:56(-0.05 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:24:56(-0.27 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:24:56(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:24:55(-0.61 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:24:55(-0.04 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:24:55(-0.27 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:24:55(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:24:55(-0.26 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:24:55(-0.05 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:24:55(-0.31 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:24:55(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:24:54(-0.57 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:24:54(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:24:53(-0.91 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:24:53(-0.05 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:23:51(-61.53 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:23:51(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:23:51(-0.32 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:23:51(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:23:51(-0.26 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:23:51(-0.05 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:23:50(-0.55 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:23:50(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:23:50(-0.36 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:23:50(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:23:50(-0.21 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -85, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:23:50(-0.04 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -85, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:23:49(-0.31 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -84, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:23:49(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -84, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:23:49(-0.66 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:23:49(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:23:48(-0.26 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:23:48(-0.05 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:22:47(-61.85 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:22:47(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:22:46(-0.34 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:22:46(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:22:45(-1.23 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:22:45(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:22:44(-0.9 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:22:44(-0.04 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:22:43(-1.18 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:22:43(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:22:43(-0.19 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:22:43(-0.05 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:21:41(-61.31 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -84, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:21:41(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -84, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:21:41(-0.28 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:21:41(-0.05 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:21:41(-0.26 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:21:41(-0.05 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:21:40(-0.23 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:21:40(-0.05 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:21:40(-0.3 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:21:40(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:21:40(-0.3 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:21:40(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:21:39(-0.31 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:21:39(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:21:39(-0.62 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -84, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:21:39(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -84, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:21:39(-0.29 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:21:39(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:21:38(-0.31 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:21:38(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:21:38(-0.6 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:21:38(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 12:21:37(-0.93 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 12:21:37(-0 seconds) 

Could you also post the relevant theengsgw.conf configuration file which should be in the home directory of your remote antenna with the Python installation?

But even from the Docker version you should not get that many published broadcasts, as it is set to

TIME_BETWEEN: 60
SCAN_TIME: 5

so there should not be so many continuous messages at all, but only ever for 5 seconds every 60 seconds.

Looks like some of the implementation discrepancy has been carried over to the Docker compose specifications.

So the remote Python version actually looks correct, with it’s published messages every ~ 65 second, it is the Docker version which doesn’t correctly take the TIME_BETWEEN. Could you try changing it to

BLE_TIME_BETWEEN_SCANS: 60
BLE_SCAN_TIME: 5

in the docker-compose.yml

there is also a new version of Gateway just being released, also addressing these issues - the Docker version will follow, but its config documentation has already been amended.

P.S.: Interesting to see some Xiaomi Mi/Smart band 8 braodcasts. Does the servicedata change with your steps by any chance? If so could you post some more samples along with the current step count?

hello

You guessed it right!
Its far better with BLE_TIME_BETWEEN_SCANS eg it’s listnening during 5 seconds every minute now:

20/05/2024 16:58:31 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 16:58:31(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -82, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 16:58:30(-0.28 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -78, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 16:58:30(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -78, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 16:58:30(-0.29 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -80, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 16:58:30(-0.05 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -80, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 16:58:30(-0.29 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -81, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 16:58:30(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -81, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 16:58:29(-0.94 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -73, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 16:58:29(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -73, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 16:58:28(-0.6 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 16:58:28(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -83, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 16:58:28(-0.28 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -75, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 16:58:28(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -75, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 16:58:28(-0.34 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -75, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 16:58:28(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -75, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 16:58:27(-0.26 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -75, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 16:58:27(-0.05 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -75, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 16:58:27(-0.55 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -80, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 16:58:27(-0.05 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -80, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 16:58:26(-0.29 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 16:58:26(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -74, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 16:57:26(-60.31 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -79, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 16:57:26(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -79, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 16:57:25(-0.6 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -77, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 16:57:25(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -77, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 16:57:25(-0.31 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -81, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 16:57:25(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -81, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 16:57:24(-0.91 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -78, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 16:57:24(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -78, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 16:57:24(-0.29 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -78, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 16:57:24(-0.04 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -78, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 16:57:22(-1.46 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -78, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 16:57:22(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -78, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}
20/05/2024 16:57:22(-0.65 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -77, "servicedatauuid": "fdab", "servicedata": "0104"}
20/05/2024 16:57:22(-0 seconds) 
{"name": "Xiaomi Smart Band 8 6A95", "id": "D0:62:2C:25:6A:95", "rssi": -77, "servicedatauuid": "fe95", "servicedata": "1059292e00956a252c62d0"}

You shoud correct the docker documentation accordingly.
Now vs your MiBand question it seems the servicedata always send the same value
Finally here are the settings of my remote (non docker) antenna:

{
    "adapter": "",
    "bindkeys": {},
    "ble": 1,
    "ble_scan_time": 5,
    "ble_time_between_scans": 60,
    "discovery": 1,
    "discovery_device_name": "tgw_remote",
    "discovery_filter": "[IBEACON,GAEN,MS-CDP]",
    "discovery_name": "tgw_remote",
    "discovery_topic": "homeassistant",
    "enable_tls": 0,
    "enable_websocket": 0,
    "general_presence": 0,
    "hass_discovery": 1,
    "host": "192.168.1.94",
    "identities": {},
    "log_level": "WARNING",
    "lwt_topic": "theengs/tgw_remote/LWT",
    "pass": "xxxx",
    "port": 1883,
    "presence": 0,
    "presence_topic": "home/TheengsGateway/presence",
    "publish_advdata": 0,
    "publish_all": 1,
    "publish_topic": "theengs/tgw_remote/BTtoMQTT",
    "scan_duration": 60,
    "scanning_mode": "active",
    "subscribe_topic": "theengs/tgw_remote/commands",
    "time_between": 60,
    "time_format": 0,
    "time_sync": [],
    "tracker_timeout": 120,
    "user": "jeedom"
}

Already happened :wink: but I think you still need to adjust the BLE_SCAN_TIME: 5 as well, as you are still getting messages throughout almost 10 seconds in your latest sample.

That’s a shame, as Xiaomi seems to have stopped freely broadcasting the steps value in its advertising data starting with Mi Band 7, seems they kept it that way with 8 as well :frowning:

Looks fine, but you might want to delete the lines

as these were mistaken non-functional entries for the correct "ble_time_between_scans": 60, and "ble_scan_time": 5,

Not sure to understand?
From my last docker log below I got messages from 20/05/2024 16:58:26 to 20/05/2024 16:58:31 eg 5 seconds which is what I requested. I’m considering reducing this value to 3 or 2.

I’m confused about the actual parameters to use for the python antenna: the doc from Use | Theengs Gateway: BLE to MQTT bridge still mentions time_between and scan_duration. Is it outdated? Should I change for ble_time_between_scans and ble_scan_time? What are the default values for both?

My bad, I didn’t see the 60 seconds jump in between :wink: all fine.

You might want to clear your browser cache and reload the page. I am seeing the new corrected entries only, with no sight of time_between and scan_duration, on;y the correct ble_time_between_scans and ble_scan_time.

Can you confirm this when reloading the page - maybe after a browser restart?

Feel free to adjust both values ble_time_between_scans and ble_scan_time to your individual requirements. I also only use a ble_scan_time of 3 seconds, but with a ble_time_between_scans of 27, so that I get published messages every 30 seconds.

Confimed for the doc, however BLE_SCAN_TIME does not work in the latest docker version, I had to revert back to SCAN_TIME

1 Like

The Docker version still needs to be updated for the recently released Python version 1.5.0, so whichever arguments discrepancies might still be there, should be fixed with the upcoming release.

Thanks for the Dcos confirmation.

1 Like