No entities made / mqtt entries when BLE is selected
Closed this issue · 5 comments
Describe the bug
No entities made / mqtt entries when BLE is selected
When bluetooth classic is used everything shows up in homeassistant and mqtt
To reproduce
See config and environment
Relevant configuration
global:
integrations:
- homeAssistant
- bluetoothLowEnergy
instanceName: rpi0kitchen
homeAssistant:
mqttUrl: 'mqtt://192.168.x.x:1883'
mqttOptions:
username: xxx
password: xxxxxx
bluetoothLowEnergy:
whitelist:
- f47defa69f82
maxDistance: 17
tagOverrides:
f47defa69f82:
name: Ezra android ble
# measuredPower: -61
Expected behavior
Entities to show up.
Environment
- room-assistant version: 2.3.0
- installation type: NodeJS
- hardware: Raspberry Pi Zero W
- OS: DietPI (rasbian)
Additional context
root@rpi0kitchen:~# room-assistant -v
*** 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] 3153 - 04/07/2020, 11:38:03 AM [IntegrationsModule] Loading integrations: none
[Nest] 3153 - 04/07/2020, 11:38:09 AM [NestFactory] Starting Nest application... +5835ms
[Nest] 3153 - 04/07/2020, 11:38:11 AM [InstanceLoader] AppModule dependencies initialized +1981ms
[Nest] 3153 - 04/07/2020, 11:38:11 AM [InstanceLoader] ConfigModule dependencies initialized +37ms
[Nest] 3153 - 04/07/2020, 11:38:11 AM [InstanceLoader] NestEmitterModule dependencies initialized +85ms
[Nest] 3153 - 04/07/2020, 11:38:11 AM [InstanceLoader] IntegrationsModule dependencies initialized +70ms
[Nest] 3153 - 04/07/2020, 11:38:11 AM [InstanceLoader] DiscoveryModule dependencies initialized +288ms
[Nest] 3153 - 04/07/2020, 11:38:11 AM [InstanceLoader] ClusterModule dependencies initialized +52ms
[Nest] 3153 - 04/07/2020, 11:38:11 AM [InstanceLoader] ScheduleModule dependencies initialized +77ms
[Nest] 3153 - 04/07/2020, 11:38:11 AM [InstanceLoader] EntitiesModule dependencies initialized +154ms
[Nest] 3153 - 04/07/2020, 11:38:12 AM [RoutesResolver] EntitiesController {/entities}: +551ms
[Nest] 3153 - 04/07/2020, 11:38:12 AM [RouterExplorer] Mapped {/, GET} route +296ms
[Nest] 3153 - 04/07/2020, 11:38:13 AM [ConfigService] Loading configuration from /opt/nodejs/lib/node_modules/room-assistant/dist/config/definitions/default.js
[Nest] 3153 - 04/07/2020, 11:38:13 AM [ConfigService] No configuration found in /root/config
[Nest] 3153 - 04/07/2020, 11:38:13 AM [ClusterService] Failed to start mdns discovery (dns service error: unknown) +256ms
Error: dns service error: unknown
at new Advertisement (/opt/nodejs/lib/node_modules/room-assistant/node_modules/mdns/lib/advertisement.js:56:10)
at Object.create [as createAdvertisement] (/opt/nodejs/lib/node_modules/room-assistant/node_modules/mdns/lib/advertisement.js:64:10)
at ClusterService.startBonjourDiscovery (/opt/nodejs/lib/node_modules/room-assistant/dist/cluster/cluster.service.js:117:35)
at ClusterService.onApplicationBootstrap (/opt/nodejs/lib/node_modules/room-assistant/dist/cluster/cluster.service.js:68:26)
at MapIterator.iterare_1.default.filter.filter.map [as iteratee] (/opt/nodejs/lib/node_modules/room-assistant/node_modules/@nestjs/core/hooks/on-app-bootstrap.hook.js:21:43)
at MapIterator.next (/opt/nodejs/lib/node_modules/room-assistant/node_modules/iterare/lib/map.js:13:39)
at IteratorWithOperators.next (/opt/nodejs/lib/node_modules/room-assistant/node_modules/iterare/lib/iterate.js:21:28)
at Function.from (<anonymous>)
at IteratorWithOperators.toArray (/opt/nodejs/lib/node_modules/room-assistant/node_modules/iterare/lib/iterate.js:180:22)
at callOperator (/opt/nodejs/lib/node_modules/room-assistant/node_modules/@nestjs/core/hooks/on-app-bootstrap.hook.js:22:10)
[Nest] 3153 - 04/07/2020, 11:38:13 AM [NestApplication] Nest application successfully started +86ms
[Nest] 3153 - 04/07/2020, 11:38:13 AM [ClusterService] rpi0kitchen has been elected as leader
[Nest] 3153 - 04/07/2020, 11:38:13 AM [EntitiesService] Refreshing entity states
I've also noticed this same issue. Everything works fine with BluetoothClassic, but no devices are created when BLE is selected
Same here, didn't test Bluetooth Classic. Had an old version of room-assistant running for more than a year without touching. Then I saw this new version, was all exicted, tried out Ansible for the first time to deploy it on all 6 machines and everything looks fine, no errors in the logs, but no devices detected either. I also see that the devices connect to the MQTT broker sucessfully.
Room Assistant System Status:
room-assistant.service - room-assistant service
Loaded: loaded (/etc/systemd/system/room-assistant.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2020-04-11 22:18:00 BST; 1min 35s ago
Main PID: 3660 (node)
Memory: 36.1M
CGroup: /system.slice/room-assistant.service
└─3660 node /opt/nodejs/bin/room-assistant
Apr 11 22:18:16 pi-buero room-assistant[3660]: [Nest] 3660 - 04/11/2020, 10:18:16 PM [RoutesResolver] EntitiesController {/entities}: +140ms
Apr 11 22:18:16 pi-buero room-assistant[3660]: [Nest] 3660 - 04/11/2020, 10:18:16 PM [RouterExplorer] Mapped {/, GET} route +78ms
Apr 11 22:18:17 pi-buero room-assistant[3660]: [Nest] 3660 - 04/11/2020, 10:18:17 PM [HomeAssistantService] Successfully connected to MQTT broker at mqtt://10.10.40.6:1884
Apr 11 22:18:17 pi-buero room-assistant[3660]: [Nest] 3660 - 04/11/2020, 10:18:17 PM [ConfigService] Loading configuration from /opt/nodejs/lib/node_modules/room-assistant/dist/config/definitions/default.js, config/pi-buero.yml, config/local.yml
Apr 11 22:18:17 pi-buero room-assistant[3660]: [Nest] 3660 - 04/11/2020, 10:18:17 PM [ClusterService] Starting mDNS advertisements and discovery
Apr 11 22:18:17 pi-buero room-assistant[3660]: [Nest] 3660 - 04/11/2020, 10:18:17 PM [NestApplication] Nest application successfully started +26ms
Apr 11 22:18:17 pi-buero room-assistant[3660]: [Nest] 3660 - 04/11/2020, 10:18:17 PM [ClusterService] buero has been elected as leader
Apr 11 22:18:17 pi-buero room-assistant[3660]: [Nest] 3660 - 04/11/2020, 10:18:17 PM [EntitiesService] Refreshing entity states
Apr 11 22:18:18 pi-buero room-assistant[3660]: [Nest] 3660 - 04/11/2020, 10:18:18 PM [ClusterService] Added 10.10.70.9:6425 to the cluster with id wohnzimmer
Apr 11 22:18:18 pi-buero room-assistant[3660]: [Nest] 3660 - 04/11/2020, 10:18:18 PM [ClusterService] Added 10.10.70.8:6425 to the cluster with id ankleidezimmer
Configuration for Room-Assistant (Ansible):
all:
hosts:
10.10.70.7:
room_assistant_config:
global:
instanceName: buero
10.10.70.8:
room_assistant_config:
global:
instanceName: ankleidezimmer
10.10.70.9:
room_assistant_config:
global:
instanceName: wohnzimmer
10.10.70.10:
room_assistant_config:
global:
instanceName: schlafzimmer
10.10.70.11:
room_assistant_config:
global:
instanceName: kueche
10.10.70.12:
room_assistant_config:
global:
instanceName: balkon
vars:
room_assistant_global_config:
global:
integrations:
- homeAssistant
- bluetoothLowEnergy
homeAssistant:
mqttUrl: 'mqtt://ip-of-host:1883'
mqttOptions:
username: mqtt_username
password: super_secret_mqtt_password
bluetoothLowEnergy:
whitelist:
- ab6dg90dg0fg
- ig8daf7s0dfd
tagOverrides:
ble-ab6dg90dg0fg:
name: presence_room_dimitri
ble-ig8daf7s0dfd:
name: presence_room_sabrina
@ezraholm50 In the logs you provided it's not loading any integrations since no configuration was found, so unfortunately I can't really tell what's wrong.
@Burningstone91 Your configuration seems to be ok, the tagOverrides
keys should probably be ab6dg90dg0fg
and ig8daf7s0dfd
(without ble-
), but that shouldn't hinder the detection. Since you used ansible the permissions for the tooling should also be correct. Did you also shutdown all instances of the previous room-assistant version before starting the new one? I suspect that room-assistant fails to start the BLE scanning for some reason, because otherwise it would list all things it sees in the logs once.
@mKeRix After deploying Room-Assistant through the ansible playbook, I had to SSH into each pi and execute the following command again:
sudo setcap cap_net_raw+eip $(eval readlink -f
which node)
Then after a restart everything worked! I didn't bother to change the ansible playbook and I also see that you already execute this command in one of the tasks, so I don't know why I had to do it again. Maybe it needs to be done at the end?
Edit: I don't know if it is allowed to "advertise" my own github repo here, if it shouldn't be allowed, let me know and I remove the link.
I wrote a guide how I setup Room-Assistant with ansible on a cluster of 5 Raspberry Pi Zero W's and 1 Raspberry Pi 3 incl. configuration of individual distances and weights for each instance. Would be happy about some feedback.
Great guide! Just so that anyone visiting can go to your guide directly: https://github.com/Burningstone91/smart-home-setup
I'll put it on my list to check the playbooks again, maybe I'm setting the permissions on the wrong path there.