I’m trying to setup MSSQL as an recorder for my HASS setup hosted on a Synology in a Docker container.
I can see from the documentation (https://home-assistant.io/components/recorder/) that I have to install some dependencies, but when I try to run them I get the following error;
root@homeassistant:/usr/src/app# sudo su -s /bin/bash homeassistant
bash: sudo: command not found
Do you mean MySQL?
Not sure, but i think you should not install mysql inside the HA docker container.
Install a mysql/mariadb docker container on your synology.
You have two options for an SQL database on a Synology. Install the MariaDB package from the package center or as VDRainer suggested, run a MySQL/MariaDB docker container. I used to do the former but recently switched to the latter and actually had some performance improvements by using a docker container.
I already got an MS SQL container running, but according to the documentation I need pymssql installed in my Home Assistant container. When I try to install it, I get the error.
What I have found typically in the Docker image, that all the dependencies for everything is already installed. Have you tried to connect to the database?
Another thing you can do is learn how a dockerfile works, and build your own docker image with the dependencies you need. There are ways to accomplish the end goal, you just need to learn how docker works first.
Maybe file an issue on github.
The docs say it should work.
Home Assistant uses SQLAlchemy as Object Relational Mapper (ORM). This means that you can now use any SQL backend for the recorder that is supported by SQLAlchemy, like MySQL, MariaDB, PostgreSQL, or MS SQL Server.
So, you should use the dockerfile that home assistant uses to create the image, and extend it to add what you need, then use that local image. Perhaps submit a request on GitHub to have it added to the base build?
Connections to MSSQL is working now for me in Hassio. I’m on HA 0.87.1. Recorder is logging history events and states to a MSSQL database. Just an FYI…