I am currently running HAOS on an HP t620 ThinClient (x86_64 installation). I am wanting to move to another computer (new Proxmox setup) as I will be able to expand better as my needs grow (and I learn more).
Currently (and since I started with this) my DB is MariaDB installed on the t620. I have had no problems so far. At one point I used some searches on google and the HA forums to setup a DB_Size sensor, and it has worked flawlessly. Even the Recorder: Purge (service runs with no hitches). I have built out the new HAOS VM (using the TTeck script) and the MariaDB VM as well. They are .241 and .242 (IP Addresses) in my network. There is currently nothing the new HAOS VM, as I want to test as I build copying things from the old one to this new one (i.e. .YAML stuff, etc.). I am trying to get this DB_Size sensor working and I have tried numerous things - to no avail. I know the DB is getting data, as this webpage shows it (most all of these were 0 or very small 24 hours ago):
I am of the âsegmented builderâ type. Meaning that my configuration.yaml
has multiple !include
stanzas to bring in other .YAML files. I always test the .YAML âCheck Configurationâ, before I restart. I began this new setup by creating the following .YAML files (I will post their contents below):
recorder.yaml
sensors.yaml
I cannot seem to get the sensor to create. Here are my files (some things âmaskedâ):
configuration.yaml
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
recorder: !include recorder.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor: !include sensors.yaml
The MariaDB user and password masked in next file:
secrets.yaml
# Use this file to store secrets like usernames and passwords.
# Learn more at https://www.home-assistant.io/docs/configuration/secrets/
some_password: welcome
# MariaDB Configuration for DB location
mariadb_url: mysql://user:[email protected]:3306/homeassistant?charset=utf8mb4
recorder.yaml
# MariaDB Configuration Settings (25-Jan-2024 @ 23:40)
db_url: !secret mariadb_url
auto_purge: true
auto_repack: true
commit_interval: 20
purge_keep_days: 10
sensors.yaml
# Lines below allow for Database Sensor (Size) to be collected (commented as of 2022.6, no longer needed)
- platform: sql
db_url: !secret mariadb_url
name: db_size
query: 'SELECT table_schema "database", Round(Sum(data_length + index_length) / POWER(1024,2), 1) "value" FROM information_schema.tables WHERE table_schema="ha-record" GROUP BY table_schema;'
column: "value"
unit_of_measurement: MB
device_class: data_size
AgainâŚall of these are copied from my existing (working) HA installation only thing that is different is the mariadb_url points to a âlocal DBâ on the same HAOS installationâŚbut here it is if you want to see it ( The MariaDB user and password masked in next file):
secrets.yaml
mariadb_url: mysql://user:passwrd@core-mariadb/homeassistant?charset=utf8mb4
I have also tried the SQL Integration, and cannot get it to work either.
Here is what I see on my existing HAOS installation that I am trying to replicate (I would love to get the update sensor working too - if I can):