Help running room-assistant presence detection on Balena Pi devices?

Hi all - I’m currently trying to use room-assistant on some Raspberry Pi Zero W’s to help do Bluetooth presence detection for home automation through Home Assistant. I have installed it using ansible and it works so far… however I also have a bunch of Pi’s already in various rooms that are running balenaSound and I would like to make use of them for presence detection as well, if possible. Even if that’s not possible, I would still like to get room-assistant running as a separate app through my Balena Dashboard for ease of management (at this point I’m convinced that all my various Pi’s should be running balenaOS!)

RA has a Docker image that can be used… I have also run through several tutorials on how to develop balenaOS apps and deploy them. However, I am stuck as to how to combine the two… Maybe im missing something super simple, but I just don’t know what to do next. For instance, the RA app needs a config file that must be on each local device, and I don’t know how to work with local files when using the Balena system. The app also needs hardware access to scan Bluetooth…

Is anyone willing to help build this? or at least point me in the right direction? Is this even possible?

Hi there, you should take a look at docker-compose syntax for balenaOS and then use this documentation as a base to build/deploy an image based on the Dockerfile from RA.

The config file can shipped to the container as a base64 encoded environment variable and unpacked using a custom entrypoint script prior to handing over to tini. Alternatively, you can just inject the config into the container at build time. That means any changes will require balena build|deploy ..., but if the config is fairly static, that shouldn’t’ be a problem.

This. Thank you for pointing me in the right direction…

Regarding the configuration file, I dug around a bit more in the room assistant docs and found a mention that a confit file is actually NOT needed and you can put all the info directly in your dockerfile, and they give the framework. Looks looks like it will probably work, I just have not had a chance to try it yet. Once I get a chance to try it out I will report back here… Thanks for the help.