Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLE updateFrequency Option Missing #125

Closed
TrpleD opened this issue Mar 3, 2020 · 2 comments
Closed

BLE updateFrequency Option Missing #125

TrpleD opened this issue Mar 3, 2020 · 2 comments

Comments

@TrpleD
Copy link

TrpleD commented Mar 3, 2020

Describe the bug
updateFrequency option no longer available. Setting this value does not limit MQTT messages as expected

To reproduce
Add "updateFrequency: " to config file where should equal minimum time in seconds between MQTT messages. Run room-assistant. BLE tags with high refresh rates continue to cause RA to report one MQTT status for each update (regardless of updateFrequency value).

Relevant logs
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi. *** WARNING *** Please fix your application to use the native API of Avahi! *** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html> *** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. *** WARNING *** Please fix your application to use the native API of Avahi! *** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html> [Nest] 860 - 03/03/2020, 2:22:52 AM [IntegrationsModule] Loading integrations: home-assistant, bluetooth-low-energy [Nest] 860 - 03/03/2020, 2:22:55 AM [NestFactory] Starting Nest application... +2492ms [Nest] 860 - 03/03/2020, 2:22:58 AM [InstanceLoader] AppModule dependencies initialized +3009ms [Nest] 860 - 03/03/2020, 2:22:58 AM [InstanceLoader] ConfigModule dependencies initialized +18ms [Nest] 860 - 03/03/2020, 2:22:58 AM [InstanceLoader] NestEmitterModule dependencies initialized +17ms [Nest] 860 - 03/03/2020, 2:22:58 AM [InstanceLoader] IntegrationsModule dependencies initialized +17ms [Nest] 860 - 03/03/2020, 2:22:58 AM [InstanceLoader] DiscoveryModule dependencies initialized +103ms [Nest] 860 - 03/03/2020, 2:22:58 AM [InstanceLoader] HomeAssistantModule dependencies initialized +19ms [Nest] 860 - 03/03/2020, 2:22:58 AM [InstanceLoader] ClusterModule dependencies initialized +17ms [Nest] 860 - 03/03/2020, 2:22:58 AM [InstanceLoader] ScheduleModule dependencies initialized +20ms [Nest] 860 - 03/03/2020, 2:22:58 AM [InstanceLoader] BluetoothLowEnergyModule dependencies initialized +25ms [Nest] 860 - 03/03/2020, 2:22:58 AM [InstanceLoader] EntitiesModule dependencies initialized +17ms [Nest] 860 - 03/03/2020, 2:22:58 AM [RoutesResolver] EntitiesController {/entities}: +142ms [Nest] 860 - 03/03/2020, 2:22:58 AM [RouterExplorer] Mapped {/, GET} route +79ms [Nest] 860 - 03/03/2020, 2:22:59 AM [BluetoothLowEnergyService] Discovered new BLE peripheral 009ec8b17352 with ID 009ec8b17352 and RSSI -74 [Nest] 860 - 03/03/2020, 2:22:59 AM [BluetoothLowEnergyService] Discovered new BLE peripheral Inspire HR with ID 0b5893b21bc4 and RSSI -80 [Nest] 860 - 03/03/2020, 2:22:59 AM [BluetoothLowEnergyService] Discovered new BLE peripheral Charge 2 with ID d035e30a1043 and RSSI -64 [Nest] 860 - 03/03/2020, 2:22:59 AM [EntitiesService] Adding new entity ble-d035e30a1043 [Nest] 860 - 03/03/2020, 2:23:00 AM [HomeAssistantService] Successfully connected to MQTT broker at mqtt://192.168.1.6:1883 [Nest] 860 - 03/03/2020, 2:23:00 AM [ConfigService] Loading configuration from /opt/nodejs/lib/node_modules/room-assistant/dist/config/definitions/default.js, config/local.yml [Nest] 860 - 03/03/2020, 2:23:00 AM [ClusterService] Starting mDNS advertisements and discovery [Nest] 860 - 03/03/2020, 2:23:00 AM [NestApplication] Nest application successfully started +26ms [Nest] 860 - 03/03/2020, 2:23:00 AM [ClusterService] pi0 has been elected as leader [Nest] 860 - 03/03/2020, 2:23:00 AM [EntitiesService] Refreshing entity states [Nest] 860 - 03/03/2020, 2:23:01 AM [BluetoothLowEnergyService] Discovered new BLE peripheral 54d0125c9f87 with ID 54d0125c9f87 and RSSI -89 [Nest] 860 - 03/03/2020, 2:23:03 AM [BluetoothLowEnergyService] Discovered new BLE peripheral 6e92ec2f7172 with ID 6e92ec2f7172 and RSSI -87 [Nest] 860 - 03/03/2020, 2:23:18 AM [BluetoothLowEnergyService] Discovered new BLE peripheral f099194e6967 with ID f099194e6967 and RSSI -60 [Nest] 860 - 03/03/2020, 2:23:18 AM [EntitiesService] Adding new entity ble-f099194e6967 [Nest] 860 - 03/03/2020, 2:23:18 AM [HomeAssistantService] Registering entity room-assistant-ble-f099194e6967 under homeassistant/sensor/room-assistant/ble-f099194e6967/config [Nest] 860 - 03/03/2020, 2:23:18 AM [HomeAssistantService] Sending new state pi0 for room-assistant-ble-f099194e6967 [Nest] 860 - 03/03/2020, 2:23:18 AM [HomeAssistantService] Sending new attributes {"distance":1.1,"lastUpdatedAt":"2020-03-03T02:23:18.676Z"} for room-assistant-ble-f099194e6967 [Nest] 860 - 03/03/2020, 2:23:18 AM [HomeAssistantService] Sending new attributes {"distance":1.1,"lastUpdatedAt":"2020-03-03T02:23:18.743Z"} for room-assistant-ble-f099194e6967 [Nest] 860 - 03/03/2020, 2:23:18 AM [HomeAssistantService] Sending new attributes {"distance":1.2,"lastUpdatedAt":"2020-03-03T02:23:18.769Z"} for room-assistant-ble-f099194e6967 [Nest] 860 - 03/03/2020, 2:23:18 AM [HomeAssistantService] Sending new attributes {"distance":1.3,"lastUpdatedAt":"2020-03-03T02:23:18.796Z"} for room-assistant-ble-f099194e6967 [Nest] 860 - 03/03/2020, 2:23:18 AM [HomeAssistantService] Sending new attributes {"distance":1.3,"lastUpdatedAt":"2020-03-03T02:23:18.823Z"} for room-assistant-ble-f099194e6967 [Nest] 860 - 03/03/2020, 2:23:18 AM [HomeAssistantService] Sending new attributes {"distance":1.3,"lastUpdatedAt":"2020-03-03T02:23:18.849Z"} for room-assistant-ble-f099194e6967 [Nest] 860 - 03/03/2020, 2:23:18 AM [HomeAssistantService] Sending new attributes {"distance":1.4,"lastUpdatedAt":"2020-03-03T02:23:18.877Z"} for room-assistant-ble-f099194e6967 [Nest] 860 - 03/03/2020, 2:23:19 AM [HomeAssistantService] Sending new attributes {"distance":1.5,"lastUpdatedAt":"2020-03-03T02:23:19.173Z"} for room-assistant-ble-f099194e6967

Relevant configuration

global:
  instanceName: pi0
  integrations:
    - homeAssistant
    - bluetoothLowEnergy
homeAssistant:
  mqttUrl: mqtt://192.168.1.6:1883
  mqttOptions:
    username: xxxx
    password: xxxx
    rejectUnauthorized: false
bluetoothLowEnergy:
  whitelist:
    - f099194e6967
  timeout: 30
  updateFrequency: 10
  tagOverrides:
    f099194e6967:
      name: fr645m

Expected behavior
If updateFrequency is set to a value (i.e. "10") then only 1 MQTT message should be sent every 10 seconds at max.

Environment

  • room-assistant version: 2.0.1
  • installation type: NodeJS
  • hardware: Raspberry Pi Zero W
  • OS: Linux

Additional context
Using old ms values (i.e. 10000) did not correct the issue.
This feature still exists per https://www.room-assistant.io/guide/upgrading.html#major-upgrades but is not shown on the BLE integration page https://www.room-assistant.io/integrations/bluetooth-low-energy.html#settings

@TrpleD TrpleD added the bug label Mar 3, 2020
@mKeRix
Copy link
Owner

mKeRix commented Mar 3, 2020

You're right, that feature is not implemented in the current version. State is only updated when something changes, but attributes will receive an update more often as you saw. Will add the option (or at least something that accomplishes the same) back soon, thanks for reporting.

@mKeRix mKeRix closed this as completed in 0143309 Apr 13, 2020
github-actions bot pushed a commit that referenced this issue Apr 13, 2020
# [2.4.0](v2.3.0...v2.4.0) (2020-04-13)

### Bug Fixes

* include distances in API for room presence sensors ([567327d](567327d))
* use Tini for process management in Docker ([932d603](932d603)), closes [#157](#157)

### Features

* simplify log format ([0f90eaa](0f90eaa)), closes [#170](#170)
* **bluetooth-classic:** allow device-specific minRssi values ([cf3ddc5](cf3ddc5)), closes [#168](#168)
* **bluetooth-low-energy:** allow the update frequency to be throttled ([0143309](0143309)), closes [#125](#125)
@github-actions
Copy link

🎉 This issue has been resolved in version 2.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants