Closed mdeweerd closed 1 year ago
I just found that the extra attributes are "possible", but when I tried, I got null values for them just after reloading the "Variables" - it was ok after an attribute update:
var:
salon_temperature_forceupd:
friendly_name: "Température salon"
value_template: "{{ states('sensor.ewelink_th01_temperature') }}"
force_update: true
unit_of_measurement: "°C"
attributes:
state_class: "{{'measurement'}}"
device_class: "{{ 'temperature' }}"
state_class_txt: "measurement"
device_class_txt: "temperature"
tracked_entity_id:
- sensor.ewelink_th01_temperature
You should use the var API to interact with var entities. Behavior of var entities modified via Dev Tools is unspecified.
I try to duplicate a sensort that is updated without changes to the value, and for proper use I would also like to duplicate some attributes.
This is the original:
When I add manually the state_class and device_class to the state using the Developer Tools, these attributes are lost when the state is updated.
I would prefer that the attributes could be specified as part of the 'var:' configuration, or that unupdated attributes that are already present are kept.