Add suggested_display_precision config setting for MQTT sensor (#26064)

* Add precision config setting to MQTT sensor

* rename to suggested_display_precision
This commit is contained in:
Jan Bouwhuis 2023-02-07 11:19:05 +01:00 committed by GitHub
parent fd944c8b03
commit ff666ac3ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -441,6 +441,7 @@ Configuration variable names in the discovery payload may be abbreviated to cons
'stat_val_tpl': 'state_value_template',
'step': 'step',
'stype': 'subtype',
'sug_dsp_prc': 'suggested_display_precision',
'sup_clrm': 'supported_color_modes',
'sup_dur': 'support_duration',
'sup_vol': 'support_volume_set',

View File

@ -170,6 +170,10 @@ payload_not_available:
required: false
type: string
default: offline
suggested_display_precision:
description: The number of decimals which should be used in the sensor's state after rounding.
required: false
type: integer
qos:
description: The maximum QoS level of the state topic.
required: false
@ -323,6 +327,7 @@ mqtt:
sensor:
- name: "Temperature"
state_topic: "office/sensor1"
suggested_display_precision: 1
unit_of_measurement: "°C"
value_template: "{{ value_json.temperature }}"
- name: "Humidity"