Ontology for Home Assistant

I’ve created a new integration for HA which is called Home Assistant Ontology.

An ontology is a structured model that defines the key concepts in a domain and the relationships between them. Think of it as a shared vocabulary combined with a map of how things are connected.

It fully integrates with HA Assist where you can ask questions like Which rooms have devices with low batteries? or What appliances currently consume electricity?.

It uses a local Memgraph database and has an MCP server to use in other AI soutions.

Give it a try and let me know your experiences or feature requests.

I don’t get it, better said I don’t get what the whole lot should offer.
After installation I get presented with a search field an I could enter an areaname or part of an entity and all i get back is a list of areas, entites containing the seachterm.

No visuals apart from red text saying “Failed to load detail: Unknown error” if one clicks upon an entry in the resulting list.

No linkage from - to whatever and simply not the slightes similarity if one browses the Memgraph site. Before installation I assumed I’ll get something similar like a musicmap or an auto-created sankey alike chart telling me how items about linked between each other.
Something I do miss most within HA since that’s something really usefull to detect dead ends or left-overs from the past if it would be able to do such things.

But at the moment I got stuck and it’s main feature sadly is eating 3% cpu power for nothing, better said for running memgraph in the background. :face_with_diagonal_mouth:

Bet I missed a vital step somehow. Perhaps some exmples would be nice to get one going, eg. easy step one could reproduce even with a basic HA installation itself.

Thank you for your feedback. There are two components to ontology for HA:

  • First you need to install Memgraph in Apps as per the README
  • Second add Ontology in Devices and Services as per README

Now you will have Ontology explorer in your side bar. You can search the ontology database.

What I forgot to add is the custom dashboard I use. Here you can see how many nodes and relationships you have and trigger rebuilds etc.

The moment you see numbers of nodes and relationships, you can click on the HA Assist icon in the top right corner and ask it questions that normally Assist can’t answer but now it can. I have some examples in the README.

Here is the dashboard code. Hope this helps. I’ll look into the map you referred to.

views:
  - type: sections
    sections:
      - type: grid
        cards:
          - type: heading
            heading: Ontology Control
            heading_style: title
          - type: tile
            entity: button.rebuild
            features:
              - type: button
          - type: tile
            entity: button.validate
            features:
              - type: button
          - type: tile
            entity: button.resync
            features:
              - type: button
      - type: grid
        cards:
          - type: heading
            heading: Nodes
            heading_style: title
          - type: custom:bubble-card
            card_type: button
            entity: sensor.nodes
            button_type: state
            sub_button:
              main: []
              bottom: []
            show_last_changed: true
            styles: |2
                styles: |
                  .bubble-button-background {
                    background:
                      ${Number(state) > 0
                        ? 'rgb(220,245,220)'
                        : 'rgb(255,220,220)'} !important;
                  }
          - type: custom:bubble-card
            card_type: button
            entity: sensor.relationships
            button_type: state
            sub_button:
              main: []
              bottom: []
            styles: |2
                styles: |
                  .bubble-button-background {
                    background:
                      ${Number(state) > 0
                        ? 'rgb(220,245,220)'
                        : 'rgb(255,220,220)'} !important;
                  }
            show_last_changed: true
          - type: statistics-graph
            entities:
              - sensor.nodes
            days_to_show: 7
            period: day
            chart_type: line
            stat_types:
              - mean
              - min
              - max
          - type: statistics-graph
            entities:
              - sensor.relationships
            days_to_show: 7
            period: day
            chart_type: line
            stat_types:
              - mean
              - min
              - max
      - type: grid
        cards:
          - type: heading
            heading: Health
            heading_style: title
          - type: custom:bubble-card
            card_type: button
            entity: sensor.health
            button_type: state
          - type: custom:bubble-card
            card_type: button
            entity: sensor.last_sync
            button_type: state
          - type: tile
            entity: sensor.last_error
            grid_options:
              columns: 12
              rows: 1
          - type: tile
            entity: sensor.schema_version