Skip to content

Releases: jamel-86/hassio_addons

v1.2.1

26 Jun 05:35
Compare
Choose a tag to compare

[1.2.1] - 2024-06-26

Added

  • Dynamic apiEndpoint update for local and ha host

v1.1.5

25 Jun 15:40
Compare
Choose a tag to compare

[1.1.5] - 2024-06-25

Fixed

  • Fixed the issue with the missing columns in the supabase schema.
  • Fixed the issue with the event filtering mechanism.
  • Fixed the issue with the state series not being stored.

v1.0.3

25 Jun 10:29
Compare
Choose a tag to compare

[1.1.3] - 2024-06-25

Added

  • Added apparmor for security to the addon.

v1.0.0

25 Jun 09:52
Compare
Choose a tag to compare

Home Assistant Supabase Client Add-on v1.0.0

Overview

The initial release of the Home Assistant Supabase Client add-on allows you to store all states and events from your Home Assistant instance directly into Supabase. This version provides a robust and scalable solution for data storage and analysis.

Features

  • Real-time Event Streaming: Stream all your Home Assistant events to Supabase in real time.
  • Entity Filtering: Specify which entities to store in Supabase, or store all entities if no specific entities are provided.
  • Flexible Configuration: Configure the add-on using the options.json file or environment variables.
  • Data Transformation: Store both original and transformed event data for structured storage and easy querying.

Installation

  1. Add the Repository

Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.

  1. Install the Add-on

Find the Home Assistant Supabase Client add-on in the add-on store and click Install.

  1. Configure the Add-on

After installation, navigate to the add-on's Configuration tab and set the necessary options:

  Supabase Url: https://[PROJECT-ID].supabase.co
  Supabase Key: [SUPABASE_KEY]
  Home Assistant url: http://homeassistant.local:8123
  Home Assistant Long Lived Token: "your-long-lived-access-token"
  entities: "[sensor.temperature, sensor.humidity, another, another]"
  1. SQL Setup Instructions

To ensure that your Supabase instance is ready to store Home Assistant states and events, execute the following SQL queries to create the necessary tables:

Create states Table:

CREATE TABLE states (
    id SERIAL PRIMARY KEY,
    entity_id TEXT NOT NULL,
    state TEXT,
    attributes JSONB,
    last_changed TIMESTAMP,
    last_updated TIMESTAMP
);

Create events Table:

CREATE TABLE events (
    id SERIAL PRIMARY KEY,
    event_type TEXT NOT NULL,
    event_data JSONB,
    context JSONB,
    origin TEXT,
    time_fired TIMESTAMP
);

Create transformed_events Table:

CREATE TABLE transformed_events (
    id SERIAL PRIMARY KEY,
    entity_id TEXT NOT NULL,
    new_state JSONB,
    old_state JSONB,
    context_id TEXT,
    user_id TEXT,
    parent_id TEXT,
    last_changed TIMESTAMP,
    last_updated TIMESTAMP,
    last_reported TIMESTAMP
);

Usage Instructions

Environment Variables

Alternatively, you can configure the add-on using environment variables if you want to run it on an external server. Create a .env file in the root of your project with the following content:

SUPABASE_URL=your-supabase-url
SUPABASE_KEY=your-supabase-key
HOME_ASSISTANT_URL=http://your-home-assistant-url
HOME_ASSISTANT_TOKEN=your-long-lived-access-token
ENTITIES=sensor.temperature,sensor.humidity

Running Locally

To run the script locally, ensure you have Node.js and ts-node installed. Then, execute the following command:

npx ts-node src/index.ts