All Projects → freol35241 → ltss

freol35241 / ltss

Licence: MIT License
Long time state storage (LTSS) custom component for Home Assistant using Timescale DB

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to ltss

ha-zoom-automation
Custom Home Assistant component for Zoom. Tracks when you are connected to a Zoom call by default but may allow you to track more.
Stars: ✭ 47 (+38.24%)
Mutual labels:  homeassistant, hacs, custom-component
ha-eskom-loadshedding
Fetches loadshedding data from Eskom
Stars: ✭ 48 (+41.18%)
Mutual labels:  homeassistant, hacs, custom-component
home-assistant-p2000
🚒 This component tracks P2000 emergency events in The Netherlands.
Stars: ✭ 45 (+32.35%)
Mutual labels:  homeassistant, hacs, custom-component
ledfxrm
Custom Integration for Home Assistant to control a any (local/remote) LedFX-server - State: beta
Stars: ✭ 31 (-8.82%)
Mutual labels:  homeassistant, hacs, custom-component
openrgb ha
OpenRGB integration for Home Assistant
Stars: ✭ 40 (+17.65%)
Mutual labels:  homeassistant, hacs, custom-component
home-assistant-frigidaire
Custom component for the Frigidaire integration
Stars: ✭ 11 (-67.65%)
Mutual labels:  homeassistant, hacs, custom-component
ad-alexatalkingclock
Alexa (or other Smart Speakers) tell you the time without asking every hour. Please ⭐️if you like my app :)
Stars: ✭ 30 (-11.76%)
Mutual labels:  homeassistant, hacs
hass-hue-icons
Additional vector icons for home assistant to model Philips Hue bulbs and fixtures.
Stars: ✭ 161 (+373.53%)
Mutual labels:  homeassistant, hacs
Home-Assistant-custom-components-DPC-Alert
Italy Meteo-hydro alert and hydrogeological phenomena Civil Protection (Protezione Civile). In this custom component you can find the vigilance Bulletin and the Bulletin of national hydrogeological and hydraulic criticalities. They allow to check whether in your current location there will be criticalities/warnings related to weather-hydrogeolog…
Stars: ✭ 31 (-8.82%)
Mutual labels:  homeassistant, hacs
ha-config-ataraxis
My Home Assistant Configs. If you like what you see, please ⭐️my repo. It would encourage me a lot 🤘
Stars: ✭ 146 (+329.41%)
Mutual labels:  homeassistant, hacs
home assistant adax
Integration for Adax heaters
Stars: ✭ 24 (-29.41%)
Mutual labels:  homeassistant, hacs
ha-lovelace-elapsed-time-card
Home Assistant Lovelace Custom Card to calculate time elapsed/left
Stars: ✭ 21 (-38.24%)
Mutual labels:  homeassistant, hacs
slider-button-card
A button card with integrated slider
Stars: ✭ 319 (+838.24%)
Mutual labels:  homeassistant, hacs
sensor.avanza stock
Custom component to get stock data from Avanza for Home Assistant
Stars: ✭ 30 (-11.76%)
Mutual labels:  homeassistant, hacs
integration blueprint
Blueprint for custom_component developers.
Stars: ✭ 151 (+344.12%)
Mutual labels:  homeassistant, custom-component
homeassistant-aemet-sensor
AEMET integration for Home Assistant
Stars: ✭ 21 (-38.24%)
Mutual labels:  homeassistant, hacs
hass-pandora-cas
Home Assistant custom component for Pandora Car Alarm System
Stars: ✭ 15 (-55.88%)
Mutual labels:  homeassistant, hacs
content-card-linky
cardLinky comptatible with sensor apiEnedis
Stars: ✭ 48 (+41.18%)
Mutual labels:  homeassistant, hacs
homeassistant-powercalc
Custom component to calculate estimated power consumption of lights and other appliances
Stars: ✭ 261 (+667.65%)
Mutual labels:  homeassistant, hacs
hass-livebox-component
Livebox Component for Home assistant
Stars: ✭ 24 (-29.41%)
Mutual labels:  homeassistant, hacs

Long time state storage (LTSS) custom component for Home Assistant

NOTE: Starting 2020-09-13 attributes are stored with type JSONB instead of as a plain string, in addition a GIN index is created on this column by default. At first startup after updating of LTSS, migration of your DB happens automatically. Note that this can take a couple of minutes and HASS will not finish starting (i.e. frontend will not be available) until migration is done.

WARNING: I take no responsibility for any data loss that may happen as a result of this. Please make sure to backup your data before upgrading!


Enabling simple long time state storage (LTSS) for your sensor states. Requires a PostgreSQL instance with the following extensions:

  • TimescaleDB
  • PostGIS

This component is not to be considered as a replacement to the recorder component in Home Assistant but rather as an alternative to the InfluxDB component for more space-efficient long time storage of specific sensor states.

Nice to know:

Installation

Precondition

Manual installation:

  • Put the ltss folder from custom_components folder in this repo to a folder named custom_components in your HA config folder

Automatic installation:

  • Just install ltss as an integration via HACS

configuration.yaml

  • Add a section to your HA configuration.yaml:

      ltss:
          db_url: postgresql://USER:PASSWORD@HOST_ADRESS/DB_NAME
          chunk_time_interval: 2592000000000
          include:
              domains:
              - sensor
              entities:
              - person.john_doe
    

NOTE: During the initial startup of the component, the extensions will be created on the specified database. This requires superuser priviligies on the PostgreSQL instance. Once the extensions are created, a user without superuser rights can be used! Ref: https://community.home-assistant.io/t/can-i-use-timescale-db-as-an-alternative-to-influx-db-in-homeassistant-for-grafana/120517/11

Configuration

ltss
(map)(Required) 
Enables the recorder integration. Only allowed once.

    db_url
    (string)(Required)
    The URL that points to your database.

    chunk_time_interval
    (int)(Optional)
    The time interval to be used for chunking in TimescaleDB in microseconds. Defaults to 2592000000000 (30 days).

    exclude
    (map)(Optional)
    Configure which integrations should be excluded from recordings.

        domains
        (list)(Optional)
        The list of domains to be excluded from recordings.

        entities
        (list)(Optional)
        The list of entity ids to be excluded from recordings.

        entity_globs:
        (list)(Optional)
        Exclude all entities matching a listed pattern from recordings (e.g., `sensor.weather_*`).

    include
    (map)(Optional)
    Configure which integrations should be included in recordings. If set, all other entities will not be recorded.

        domains
        (list)(Optional)
        The list of domains to be included in the recordings.

        entities
        (list)(Optional)
        The list of entity ids to be included in the recordings.

        entity_globs:
        (list)(Optional)
        Include all entities matching a listed pattern from recordings (e.g., `sensor.weather_*`).

Details

The states are stored in a single hypertable with the following layout:

Column name: id time entity_id state attributes location
Type: bigint timestamp with timezone string string JSONB POINT(4326)
Primary key: x x
Index: x x x x x

Chunk size of the hypertable is configurable using the chunk_time_interval config option. It defaults to 2592000000000 microseconds (30 days).

The location column is only populated for those states where latitude and longitude is part of the state attributes.

Credits

Big thanks to the authors of the recorder component for Home Assistant for a great starting point code-wise!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].