#SQL Integration

1 messages · Page 1 of 1 (latest)

old gate
#

Good evening! I am new to SQL and databases so please bare with me.

I have MariaDB running on MY Synology and looking to get some data from it into Home assistant and cant get it to work either via the integration or YAML code and struggling to find help on where I might be going wrong.

sensor:

  • platform: sql
    db_url: mysql://ADDRESS/finance/metals
    queries:

    • name: Finance Gold Total
      query: "SELECT SUM(weight_oz) AS value FROM metals WHERE metal = 'gold';"
      column: "value"
  • platform: sql
    db_url: mysql://ADDRESS/finance/metals
    queries:

    • name: Metals Gold Total
      query: "SELECT SUM(weight_oz) AS value FROM metals WHERE metal = 'gold';"
      column: "value"
      any help or guidance would be grately appreciated 🙂