Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config flow to compensation helper #33723

Open
wants to merge 5 commits into
base: next
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions source/_integrations/compensation.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,40 @@ ha_release: '2021.5'
ha_codeowners:
- '@Petro31'
ha_domain: compensation
ha_config_flow: true
ha_platforms:
- sensor
ha_integration_type: integration
ha_integration_type: helper
---

The **Compensation** {% term integration %} consumes the {% term state %} from other {% term sensors %}. It exports the compensated value as state in a separate {% term entity %} and the following values as attributes: `entity_id` and `coefficients`. A single polynomial, linear by default, is fit to all data points provided.

## Configuration
{% include integrations/config_flow.md %}

Further information about these configuration options can be found under the [YAML configuration](#yaml-configuration) section.

{% configuration_basic %}
Name:
description: The name the sensor should have.
Entity:
description: The entity that provides the input.
Data points:
description: "The collection of data point conversions with the format `uncompensated_value, compensated_value`. e.g., `1.0, 2.1`."
gjohansson-ST marked this conversation as resolved.
Show resolved Hide resolved
Attribute:
description: Attribute from the source to monitor/compensate. When omitted, the state value of the source will be used.
Degree:
description: "The degree of a polynomial. For example, Linear compensation (y = x + 3) has 1 degree, Quadratic compensation (y = x<sup>2</sup> + x + 3) has 2 degrees, etc."
Precision:
description: Defines the number of decimal places of the calculated sensor value.
Unit of measurement:
description: Defines the units of measurement of the sensor, if any.
Lower limit:
description: "Enables a lower limit for the sensor. The lower limit is defined by the data collection's (`data_points`) lowest `uncompensated_value`."
Upper limit:
description: "Enables an upper limit for the sensor. The upper limit is defined by the data collection's (`data_points`) greatest `uncompensated_value`."
{% endconfiguration_basic %}

## YAML Configuration

To enable the compensation sensor, add the following lines to your {% term "`configuration.yaml`" %} file.
{% include integrations/restart_ha_after_config_inclusion.md %}
Expand Down