diff --git a/Gemfile b/Gemfile index 71db3069a7a..2c1b6f2d1b7 100644 --- a/Gemfile +++ b/Gemfile @@ -10,10 +10,10 @@ group :development do gem 'stringex', '2.8.6' # > 2.1.0 causes slowdowns https://github.com/sass/sassc-ruby/issues/189 gem 'sassc', '2.1.0' - gem 'sass-embedded', '1.80.6' + gem 'sass-embedded', '1.81.0' gem 'rubocop', '1.68.0' - gem 'ruby-lsp', '0.21.3' - gem 'rackup', '2.2.0' + gem 'ruby-lsp', '0.22.1' + gem 'rackup', '2.2.1' end group :jekyll_plugins do @@ -23,7 +23,7 @@ group :jekyll_plugins do gem 'jekyll-toc', '0.19.0' end -gem 'sinatra', '4.0.0' +gem 'sinatra', '4.1.1' gem 'nokogiri', '1.16.7' # Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem diff --git a/Gemfile.lock b/Gemfile.lock index e45c236d766..b8a84e30e53 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,7 +8,7 @@ GEM bigdecimal (3.1.8) chunky_png (1.4.0) colorator (1.1.0) - commonmarker (0.23.10) + commonmarker (0.23.11) compass (1.0.3) chunky_png (~> 1.2) compass-core (~> 1.0.2) @@ -66,9 +66,9 @@ GEM nokogiri (~> 1.12) jekyll-watch (2.2.1) listen (~> 3.0) - json (2.8.1) - kramdown (2.4.0) - rexml + json (2.8.2) + kramdown (2.5.1) + rexml (>= 3.3.9) kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) language_server-protocol (3.17.0.3) @@ -95,12 +95,13 @@ GEM public_suffix (6.0.1) racc (1.8.1) rack (3.1.8) - rack-protection (4.0.0) + rack-protection (4.1.1) base64 (>= 0.1.0) + logger (>= 1.6.0) rack (>= 3.0.0, < 4) rack-session (2.0.0) rack (>= 3.0.0) - rackup (2.2.0) + rackup (2.2.1) rack (>= 3) rainbow (3.1.1) rake (13.2.1) @@ -111,7 +112,7 @@ GEM logger regexp_parser (2.9.2) rexml (3.3.9) - rouge (4.4.0) + rouge (4.5.1) rubocop (1.68.0) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -122,9 +123,9 @@ GEM rubocop-ast (>= 1.32.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.34.0) + rubocop-ast (1.36.1) parser (>= 3.3.1.0) - ruby-lsp (0.21.3) + ruby-lsp (0.22.1) language_server-protocol (~> 3.17.0) prism (>= 1.2, < 2.0) rbs (>= 3, < 4) @@ -133,9 +134,9 @@ GEM ruby2_keywords (0.0.5) safe_yaml (1.0.5) sass (3.4.25) - sass-embedded (1.80.6-arm64-darwin) + sass-embedded (1.81.0-arm64-darwin) google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86_64-linux-gnu) + sass-embedded (1.81.0-x86_64-linux-gnu) google-protobuf (~> 4.28) sass-globbing (1.1.5) sass (>= 3.1) @@ -143,13 +144,14 @@ GEM ffi (~> 1.9) sassc (2.1.0-x86_64-linux) ffi (~> 1.9) - sinatra (4.0.0) + sinatra (4.1.1) + logger (>= 1.6.0) mustermann (~> 3.0) rack (>= 3.0.0, < 4) - rack-protection (= 4.0.0) + rack-protection (= 4.1.1) rack-session (>= 2.0.0, < 3) tilt (~> 2.0) - sorbet-runtime (0.5.11641) + sorbet-runtime (0.5.11663) stringex (2.8.6) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) @@ -173,14 +175,14 @@ DEPENDENCIES jekyll-sitemap (= 1.4.0) jekyll-toc (= 0.19.0) nokogiri (= 1.16.7) - rackup (= 2.2.0) + rackup (= 2.2.1) rake (= 13.2.1) rubocop (= 1.68.0) - ruby-lsp (= 0.21.3) - sass-embedded (= 1.80.6) + ruby-lsp (= 0.22.1) + sass-embedded (= 1.81.0) sass-globbing (= 1.1.5) sassc (= 2.1.0) - sinatra (= 4.0.0) + sinatra (= 4.1.1) stringex (= 2.8.6) tzinfo (~> 2.0) tzinfo-data diff --git a/_config.yml b/_config.yml index 67d3ee2ec79..d0a1062a21a 100644 --- a/_config.yml +++ b/_config.yml @@ -108,8 +108,8 @@ social: # Home Assistant release details current_major_version: 2024 current_minor_version: 11 -current_patch_version: 0 -date_released: 2024-11-06 +current_patch_version: 3 +date_released: 2024-11-22 # Either # or the anchor link to latest release notes in the blog post. # Must be prefixed with a # and have double quotes around it. diff --git a/sass/homeassistant/_overrides.scss b/sass/homeassistant/_overrides.scss index 609776c748a..a186fb45e2e 100644 --- a/sass/homeassistant/_overrides.scss +++ b/sass/homeassistant/_overrides.scss @@ -366,7 +366,7 @@ header .breadcrumbs { margin: 0 -24px; text-align: left; - h4 { + h3 { text-transform: uppercase; font-size: .9rem; letter-spacing: 0.005em; diff --git a/source/_data/people.yml b/source/_data/people.yml index 5eecd1608bf..9a6d0fb3037 100644 --- a/source/_data/people.yml +++ b/source/_data/people.yml @@ -84,4 +84,8 @@ Joakim Sørensen: Andy Gill: name: Andy Gill - github: ncandyg \ No newline at end of file + github: ncandyg + +Missy Quarry: + name: Missy Quarry + github: missyquarry \ No newline at end of file diff --git a/source/_docs/backend/database.markdown b/source/_docs/backend/database.markdown index 3f5965cb7fd..99b2e064797 100644 --- a/source/_docs/backend/database.markdown +++ b/source/_docs/backend/database.markdown @@ -41,61 +41,198 @@ Get all available tables from your current Home Assistant database: sqlite> SELECT sql FROM sqlite_master; ------------------------------------------------------------------------------------- -CREATE TABLE events ( - event_id INTEGER NOT NULL, - event_type VARCHAR(32), - event_data TEXT, - origin VARCHAR(32), - time_fired DATETIME, - created DATETIME, - context_id VARCHAR(36), - context_user_id VARCHAR(36), context_parent_id CHARACTER(36), - PRIMARY KEY (event_id) +CREATE TABLE event_data ( + data_id INTEGER NOT NULL, + hash BIGINT, + shared_data TEXT, + PRIMARY KEY (data_id) ) + +CREATE TABLE event_types ( + event_type_id INTEGER NOT NULL, + event_type VARCHAR(64), + PRIMARY KEY (event_type_id) +) + +CREATE TABLE state_attributes ( + attributes_id INTEGER NOT NULL, + hash BIGINT, + shared_attrs TEXT, + PRIMARY KEY (attributes_id) +) + +CREATE TABLE states_meta ( + metadata_id INTEGER NOT NULL, + entity_id VARCHAR(255), + PRIMARY KEY (metadata_id) +) + +CREATE TABLE statistics_meta ( + id INTEGER NOT NULL, + statistic_id VARCHAR(255), + source VARCHAR(32), + unit_of_measurement VARCHAR(255), + has_mean BOOLEAN, + has_sum BOOLEAN, + name VARCHAR(255), + PRIMARY KEY (id) +) + CREATE TABLE recorder_runs ( - run_id INTEGER NOT NULL, - start DATETIME, - "end" DATETIME, - closed_incorrect BOOLEAN, - created DATETIME, - PRIMARY KEY (run_id), - CHECK (closed_incorrect IN (0, 1)) + run_id INTEGER NOT NULL, + start DATETIME NOT NULL, + "end" DATETIME, + closed_incorrect BOOLEAN NOT NULL, + created DATETIME NOT NULL, + PRIMARY KEY (run_id) ) + +CREATE TABLE migration_changes ( + migration_id VARCHAR(255) NOT NULL, + version SMALLINT NOT NULL, + PRIMARY KEY (migration_id) +) + + + CREATE TABLE schema_changes ( - change_id INTEGER NOT NULL, - schema_version INTEGER, - changed DATETIME, - PRIMARY KEY (change_id) + change_id INTEGER NOT NULL, + schema_version INTEGER, + changed DATETIME NOT NULL, + PRIMARY KEY (change_id) ) + +CREATE TABLE statistics_runs ( + run_id INTEGER NOT NULL, + start DATETIME NOT NULL, + PRIMARY KEY (run_id) +) + +CREATE TABLE events ( + event_id INTEGER NOT NULL, + event_type CHAR(0), + event_data CHAR(0), + origin CHAR(0), + origin_idx SMALLINT, + time_fired CHAR(0), + time_fired_ts FLOAT, + context_id CHAR(0), + context_user_id CHAR(0), + context_parent_id CHAR(0), + data_id INTEGER, + context_id_bin BLOB, + context_user_id_bin BLOB, + context_parent_id_bin BLOB, + event_type_id INTEGER, + PRIMARY KEY (event_id), + FOREIGN KEY(data_id) REFERENCES event_data (data_id), + FOREIGN KEY(event_type_id) REFERENCES event_types (event_type_id) +) + CREATE TABLE states ( - state_id INTEGER NOT NULL, - domain VARCHAR(64), - entity_id VARCHAR(255), - state VARCHAR(255), - attributes TEXT, - event_id INTEGER, - last_changed DATETIME, - last_updated DATETIME, - created DATETIME, - context_id VARCHAR(36), - context_user_id VARCHAR(36), context_parent_id CHARACTER(36), old_state_id INTEGER, - PRIMARY KEY (state_id), - FOREIGN KEY(event_id) REFERENCES events (event_id) + state_id INTEGER NOT NULL, + entity_id CHAR(0), + state VARCHAR(255), + attributes CHAR(0), + event_id SMALLINT, + last_changed CHAR(0), + last_changed_ts FLOAT, + last_reported_ts FLOAT, + last_updated CHAR(0), + last_updated_ts FLOAT, + old_state_id INTEGER, + attributes_id INTEGER, + context_id CHAR(0), + context_user_id CHAR(0), + context_parent_id CHAR(0), + origin_idx SMALLINT, + context_id_bin BLOB, + context_user_id_bin BLOB, + context_parent_id_bin BLOB, + metadata_id INTEGER, + PRIMARY KEY (state_id), + FOREIGN KEY(old_state_id) REFERENCES states (state_id), + FOREIGN KEY(attributes_id) REFERENCES state_attributes (attributes_id), + FOREIGN KEY(metadata_id) REFERENCES states_meta (metadata_id) ) + +CREATE TABLE statistics ( + id INTEGER NOT NULL, + created CHAR(0), + created_ts FLOAT, + metadata_id INTEGER, + start CHAR(0), + start_ts FLOAT, + mean FLOAT, + min FLOAT, + max FLOAT, + last_reset CHAR(0), + last_reset_ts FLOAT, + state FLOAT, + sum FLOAT, + PRIMARY KEY (id), + FOREIGN KEY(metadata_id) REFERENCES statistics_meta (id) ON DELETE CASCADE +) + +CREATE TABLE statistics_short_term ( + id INTEGER NOT NULL, + created CHAR(0), + created_ts FLOAT, + metadata_id INTEGER, + start CHAR(0), + start_ts FLOAT, + mean FLOAT, + min FLOAT, + max FLOAT, + last_reset CHAR(0), + last_reset_ts FLOAT, + state FLOAT, + sum FLOAT, + PRIMARY KEY (id), + FOREIGN KEY(metadata_id) REFERENCES statistics_meta (id) ON DELETE CASCADE +) + CREATE TABLE sqlite_stat1(tbl,idx,stat) -CREATE INDEX ix_events_context_user_id ON events (context_user_id) -CREATE INDEX ix_events_event_type ON events (event_type) -CREATE INDEX ix_events_context_id ON events (context_id) -CREATE INDEX ix_events_time_fired ON events (time_fired) + +CREATE INDEX ix_event_data_hash ON event_data (hash) + +CREATE UNIQUE INDEX ix_event_types_event_type ON event_types (event_type) + +CREATE INDEX ix_state_attributes_hash ON state_attributes (hash) + +CREATE UNIQUE INDEX ix_states_meta_entity_id ON states_meta (entity_id) + +CREATE UNIQUE INDEX ix_statistics_meta_statistic_id ON statistics_meta (statistic_id) + CREATE INDEX ix_recorder_runs_start_end ON recorder_runs (start, "end") -CREATE INDEX ix_states_entity_id ON states (entity_id) -CREATE INDEX ix_states_context_user_id ON states (context_user_id) -CREATE INDEX ix_states_last_updated ON states (last_updated) -CREATE INDEX ix_states_event_id ON states (event_id) -CREATE INDEX ix_states_entity_id_last_updated ON states (entity_id, last_updated) -CREATE INDEX ix_states_context_id ON states (context_id) -CREATE INDEX ix_states_context_parent_id ON states (context_parent_id) -CREATE INDEX ix_events_context_parent_id ON events (context_parent_id) + +CREATE INDEX ix_statistics_runs_start ON statistics_runs (start) + +CREATE INDEX ix_events_data_id ON events (data_id) + +CREATE INDEX ix_events_event_type_id_time_fired_ts ON events (event_type_id, time_fired_ts) + +CREATE INDEX ix_events_context_id_bin ON events (context_id_bin) + +CREATE INDEX ix_events_time_fired_ts ON events (time_fired_ts) + +CREATE INDEX ix_states_attributes_id ON states (attributes_id) + +CREATE INDEX ix_states_metadata_id_last_updated_ts ON states (metadata_id, last_updated_ts) + +CREATE INDEX ix_states_old_state_id ON states (old_state_id) + +CREATE INDEX ix_states_context_id_bin ON states (context_id_bin) + +CREATE INDEX ix_states_last_updated_ts ON states (last_updated_ts) + +CREATE UNIQUE INDEX ix_statistics_statistic_id_start_ts ON statistics (metadata_id, start_ts) + +CREATE INDEX ix_statistics_start_ts ON statistics (start_ts) + +CREATE INDEX ix_statistics_short_term_start_ts ON statistics_short_term (start_ts) + +CREATE UNIQUE INDEX ix_statistics_short_term_statistic_id_start_ts ON statistics_short_term (metadata_id, start_ts) ``` To only show the details about the `states` table (since we are using that one in the next examples): @@ -110,7 +247,7 @@ The identification of the available columns in the table is done and we are now ```bash sqlite> .width 30, 10, -sqlite> SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 10; +sqlite> SELECT states_meta.entity_id, COUNT(*) as count FROM states INNER JOIN states_meta ON states.metadata_id = states_meta.metadata_id GROUP BY states_meta.entity_id ORDER BY count DESC LIMIT 10; entity_id count ------------------------------ ---------- sensor.cpu 28874 diff --git a/source/_docs/configuration/templating.markdown b/source/_docs/configuration/templating.markdown index 86a8b5fe6e5..3cda6becfd9 100644 --- a/source/_docs/configuration/templating.markdown +++ b/source/_docs/configuration/templating.markdown @@ -106,6 +106,10 @@ Extensions allow templates to access all of the Home Assistant specific states a Templates for some [triggers](/docs/automation/trigger/) as well as `trigger_variables` only support a subset of the Home Assistant template extensions. This subset is referred to as "Limited Templates". +### This + +State-based and trigger-based template entities have the special template variable `this` available in their templates and actions. See more details and examples in the [Template integration documentation](/integrations/template). + ### States Not supported in [limited templates](#limited-templates). @@ -318,7 +322,7 @@ List of lights that are on with a brightness of 255: {% raw %} ```text -{{ ['light.kitchen', 'light.dinig_room'] | select('is_state', 'on') | select('is_state_attr', 'brightness', 255) | list }} +{{ ['light.kitchen', 'light.dining_room'] | select('is_state', 'on') | select('is_state_attr', 'brightness', 255) | list }} ``` {% endraw %} @@ -1459,12 +1463,14 @@ To evaluate a response, go to **{% my developer_template title="Developer Tools ### Using templates with the MQTT integration -The [MQTT integration](/integrations/mqtt/) relies heavily on templates. Templates are used to transform incoming payloads (value templates) to status updates or incoming actions (command templates) to payloads that configure the MQTT device. +The [MQTT integration](/integrations/mqtt/) relies heavily on templates. Templates are used to transform incoming payloads (value templates) to state updates or incoming actions (command templates) to payloads that configure the MQTT device. #### Using value templates with MQTT -For incoming data a value template translates incoming JSON or raw data to a valid payload. -Incoming payloads are rendered with possible JSON values, so when rendering the `value_json` can be used access the attributes in a JSON based payload. +Value templates translate received MQTT payload to a valid state or attribute. +The received MQTT is available in the `value` template variable, and in the `value_json` template variable if the received MQTT payload is valid JSON. + +In addition, the template variables `entity_id`, `name` and `this` are available for MQTT entity value templates. The `this` attribute refers to the [entity state](/docs/configuration/state_object) of the MQTT item. {% note %} @@ -1478,13 +1484,13 @@ With given payload: Template {% raw %}`{{ value_json.temperature | round(1) }}`{% endraw %} renders to `21.9`. -Additional the MQTT entity attributes `entity_id`, `name` and `this` can be used as variables in the template. The `this` attribute refers to the [entity state](/docs/configuration/state_object) of the MQTT item. - {% endnote %} #### Using command templates with MQTT -For actions, command templates are defined to format the outgoing MQTT payload to the device. When an action is executed, `value` can be used to generate the correct payload to the device. +For actions, command templates are defined to format the outgoing MQTT payload to a format supported by the remote device. When an action is executed, the template variable `value` has the action data in most cases unless otherwise specified in the documentation. + +In addition, the template variables `entity_id`, `name` and `this` are available for MQTT entity command templates. The `this` attribute refers to the [entity state](/docs/configuration/state_object) of the MQTT item. {% note %} @@ -1498,8 +1504,6 @@ With given value `21.9` template {% raw %}`{"temperature": {{ value }} }`{% endr } ``` -Additional the MQTT entity attributes `entity_id`, `name` and `this` can be used as variables in the template. The `this` attribute refers to the [entity state](/docs/configuration/state_object) of the MQTT item. - {% endnote %} **Example command template with raw data:** diff --git a/source/_docs/quality_scale.markdown b/source/_docs/quality_scale.markdown index 8803e2ce3ae..2a9d9cda279 100644 --- a/source/_docs/quality_scale.markdown +++ b/source/_docs/quality_scale.markdown @@ -5,7 +5,7 @@ description: "Details about the classification of integrations." The Integration Quality Scale scores each integration based on the code quality and user experience. Each level of the quality scale consists of a list of requirements. If an integration matches all requirements, it's considered to have reached that level. -[Integration Quality Scale](https://developers.home-assistant.io/docs/en/integration_quality_scale_index.html) for developers. +[Integration Quality Scale](https://developers.home-assistant.io/docs/core/integration-quality-scale/) for developers. ## No score diff --git a/source/_docs/scene.markdown b/source/_docs/scene.markdown index 2606fd02884..fc635d81941 100644 --- a/source/_docs/scene.markdown +++ b/source/_docs/scene.markdown @@ -38,7 +38,7 @@ name: type: string description: description: Description of the scene. - required: true + required: false type: string entities: description: Entities to control and their desired state. diff --git a/source/_includes/asides/docs_sitemap.html b/source/_includes/asides/docs_sitemap.html index 1b6e214ca55..64c93a510ec 100644 --- a/source/_includes/asides/docs_sitemap.html +++ b/source/_includes/asides/docs_sitemap.html @@ -109,44 +109,48 @@
Sign up for our newsletter {% icon "tabler:external-link" %}
Screenshots showing the conversion of a view in masonry into sections
Case studies of many dashboards of our users
A teaser of our voice hardware
Limited edition San Fran postcard and badge
Paulus, Frenck and myself at the Day 1 keynote
Our booth in the Open Source Zone
Their final message to the crowd - what are you going to build?