From 3ee497577bb70a25273978b03fa34244f0642c66 Mon Sep 17 00:00:00 2001 From: Petro31 <35082313+Petro31@users.noreply.github.com> Date: Tue, 27 Jun 2023 06:57:42 -0400 Subject: [PATCH] Add min/max limits to compensation sensors (#25752) Co-authored-by: Franck Nijhof --- source/_integrations/compensation.markdown | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/source/_integrations/compensation.markdown b/source/_integrations/compensation.markdown index 569f948443a..20a73f3f66c 100644 --- a/source/_integrations/compensation.markdown +++ b/source/_integrations/compensation.markdown @@ -30,6 +30,20 @@ compensation: data_points: - [0.2, -80.0] - [1.0, 0.0] + + media_player_db_volume: + source: media_player.yamaha_receiver_zone_2 + attribute: volume_level + unit_of_measurement: dB + # Ensure that the sensor's value will not have a state lower than -80.0 + # when the source sensors value is less than 0.2 + lower_limit: true + # Ensure that the sensor's value will not have a state greater than 0.0 + # when the source sensors value is greater than 1.0 + upper_limit: true + data_points: + - [0.2, -80.0] + - [1.0, 0.0] ``` {% configuration %} @@ -63,4 +77,14 @@ unit_of_measurement: description: Defines the units of measurement of the sensor, if any. required: false type: string +lower_limit: + description: "Enables a lower limit for the sensor. The lower limit is defined by the data collections (`data_points`) lowest `uncompensated_value`. For example, if the lowest `uncompensated_value` value is `1.0` and the paired `compensated_value` is `0.0`, any `source` state less than `1.0` will produce a compensated state of `0.0`." + required: false + type: boolean + default: false +upper_limit: + description: "Enables an upper limit for the sensor. The upper limit is defined by the data collections (`data_points`) greatest `uncompensated_value`. For example, if the greatest `uncompensated_value` value is `5.0` and the paired `compensated_value` is `10.0`, any `source` state greater than `5.0` will produce a compensated state of `10.0`." + required: false + type: boolean + default: false {% endconfiguration %}