question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Room Assistant randomly shutting down on Hass.io

See original GitHub issue

Describe the bug Room Assistant randomly shuts off.

To reproduce Steps required to reproduce the issue.

Relevant logs Log output that correlates to the bug. You can get debug output with room-assistant -v.

[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[19:02:00] INFO: Setting up Home Assistant configuration
[19:02:00] INFO: Starting room-assistant
*** 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] 177   - 03/04/2020, 7:02:04 PM   [IntegrationsModule] Loading integrations: home-assistant, bluetooth-low-energy
[Nest] 177   - 03/04/2020, 7:02:05 PM   [NestFactory] Starting Nest application... +813ms
[Nest] 177   - 03/04/2020, 7:02:05 PM   [InstanceLoader] AppModule dependencies initialized +907ms
[Nest] 177   - 03/04/2020, 7:02:05 PM   [InstanceLoader] ConfigModule dependencies initialized +2ms
[Nest] 177   - 03/04/2020, 7:02:05 PM   [InstanceLoader] NestEmitterModule dependencies initialized +1ms
[Nest] 177   - 03/04/2020, 7:02:05 PM   [InstanceLoader] IntegrationsModule dependencies initialized +2ms
[Nest] 177   - 03/04/2020, 7:02:05 PM   [InstanceLoader] DiscoveryModule dependencies initialized +20ms
[Nest] 177   - 03/04/2020, 7:02:05 PM   [InstanceLoader] HomeAssistantModule dependencies initialized +2ms
[Nest] 177   - 03/04/2020, 7:02:05 PM   [InstanceLoader] ClusterModule dependencies initialized +2ms
[Nest] 177   - 03/04/2020, 7:02:05 PM   [InstanceLoader] ScheduleModule dependencies initialized +3ms
[Nest] 177   - 03/04/2020, 7:02:05 PM   [InstanceLoader] BluetoothLowEnergyModule dependencies initialized +3ms
[Nest] 177   - 03/04/2020, 7:02:05 PM   [InstanceLoader] EntitiesModule dependencies initialized +2ms
[Nest] 177   - 03/04/2020, 7:02:06 PM   [RoutesResolver] EntitiesController {/entities}: +25ms
[Nest] 177   - 03/04/2020, 7:02:06 PM   [RouterExplorer] Mapped {/, GET} route +12ms
[Nest] 177   - 03/04/2020, 7:02:06 PM   [HomeAssistantService] Successfully connected to MQTT broker at mqtt://core-mosquitto:1883
[Nest] 177   - 03/04/2020, 7:02:06 PM   [ConfigService] Loading configuration from /usr/lib/node_modules/room-assistant/dist/config/definitions/default.js, config/default.json, config/local.json
[Nest] 177   - 03/04/2020, 7:02:06 PM   [ClusterService] Starting mDNS advertisements and discovery
[Nest] 177   - 03/04/2020, 7:02:06 PM   [NestApplication] Nest application successfully started +3ms
[Nest] 177   - 03/04/2020, 7:02:06 PM   [BluetoothLowEnergyService] Discovered new BLE peripheral 3c950981fd5e with ID 3c950981fd5e and RSSI -69
[Nest] 177   - 03/04/2020, 7:02:06 PM   [BluetoothLowEnergyService] Discovered new BLE peripheral 338d0dd68a44 with ID 338d0dd68a44 and RSSI -68
[Nest] 177   - 03/04/2020, 7:02:06 PM   [BluetoothLowEnergyService] Discovered new BLE peripheral 22227f874d9a with ID 22227f874d9a and RSSI -77
[Nest] 177   - 03/04/2020, 7:02:08 PM   [BluetoothLowEnergyService] Discovered new BLE peripheral Amazfit Cor with ID d01f2d9bf9dd and RSSI -85
[Nest] 177   - 03/04/2020, 7:02:08 PM   [BluetoothLowEnergyService] Discovered new BLE peripheral Mi Smart Band 4 with ID e398749862f3 and RSSI -82
[cmd] /room-assistant/entrypoint.sh exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
internal/buffer.js:72
  throw new ERR_OUT_OF_RANGE(type || 'offset',
  ^
RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 2. Received 3
    at boundsError (internal/buffer.js:72:9)
    at Uint8Array.readUInt8 (internal/buffer.js:238:5)
    at Hci.onSocketData (/usr/lib/node_modules/room-assistant/node_modules/@abandonware/noble/lib/hci-socket/hci.js:469:36)
    at BluetoothHciSocket.emit (events.js:223:5) {
  code: 'ERR_OUT_OF_RANGE'
}
[s6-finish] sending all processes the TERM signal.

Relevant configuration Paste the relevant parts of your configuration below.

  instanceName: Living room
  integrations:
    - homeAssistant
    - bluetoothLowEnergy
cluster:
  peerAddresses:
    - '192.168.64.4:6425'
  weight: 5
bluetoothLowEnergy:
  whitelist:
    - e398749862f3
  timeout: 25

Expected behavior It should run normally.

Environment

  • room-assistant version: 2.1.1
  • installation type: Hass.io
  • hardware: Raspberry Pi 4
  • OS: Linux

Additional context This only happens on Hass.io because my other instance on a normal NodeJS manual installation runs fine without problems. Both are Raspberry Pi 4s.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
asknoonecommented, Mar 31, 2020

Hi people,

I’m running an older version of Room Assistant but have this issue too. For the HASSIO users out there…

I’ve created a sensor to monitor the add-on state and then an automation to restart the add-on if it stops. I’ve been running this for around 2 years now and very few problems with presence detection.

You need to create a long lived api token to pull the data out of the API to get the state of the add-on using a REST sensor. There are probably multiple other ways of doing this too.

I hope this helps some of you guys.

# Sensor - Get status of the Room Assistant Add-on so can restart it if it has stopped running
  - platform: rest
    name: Room Assistant Addon Status
    resource: 'http://{haipaddress}:8123/api/hassio/addons/6e66619d_room_assistant/info'
    headers:
      Authorization: !secret rest_api_token
      Content-Type: 'application/json'
    value_template: '{{value_json.data.state}}'

# Automation to restart Room Assistant if it has stopped
- alias: Restart Room Assistant
  trigger:
    platform: state
    entity_id: sensor.room_assistant_addon_status
    to: 'stopped'
  action:
  - service: hassio.addon_start
    data:
      addon: 6e66619d_room_assistant

1reaction
mKeRixcommented, Mar 4, 2020

Unfortunately an issue with the underlying library, see abandonware/noble#15. As the stack never even touches room-assistant code I’m not sure how I could catch and handle this better. Somebody is trying to write a new library with the same functionality here, but the current releases don’t have Linux support yet.

I can do some research on workarounds for this issue in the future though!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Home Assistant shuts down without reason
I'm using an SD card and Hass OS, not docker. I can't SSH into it when it goes down.
Read more >
Hassio randomly shuts down : r/homeassistant - Reddit
Just recently it started shutting down completely on it's own. The Pi remains working and powered on and is powered using a true...
Read more >
Home Assistant | After restarting Hass.io I randomly get dead ...
After restarting Hass.io I randomly get dead nodes, which "test network" solves. Does anyone know how I can automate test network (with service......
Read more >
Installation | room-assistant
You can install room-assistant as Home Assistant OS add-on by adding the following URL as repository open in new window: https://github.com/mKeRix/hassio- ...
Read more >
Home Assistant OS: Installing Hassio on Unraid using VMDK
Today we'll be showing you how to install Home Assistant (aka. Hassio ) on your Unraid system using a VMDK. This also shows...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found