You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Home Assistant Core release with the issue: 2023.2.5
This custom component release with the issue: 2.3.0
Last working this custom component release (if known):
Operating environment (Home Assistant/Supervisor/Docker/venv): HAOS on raspberry Pi
Describe the bug
I have a temperature sensor for outdoors temperature. Unit is degrees Celcius as "°C" (2 symbols).
I take an average of the temperature on a 24h window and it works well.
I want to calculate the min and max temp values on the 24h window and average them as well to make them smoother.
For this I make 2 "statistics" helpers to calculate the min and max temp of the last 24h.
Then I average these helpers on a 24h window.
All sensors show up with the "°C" measurement unit except the last 2 average sensors that are produced without unit.
Configuration.yaml
# initial physical sensormqtt:
sensor:
- name: "ext_temp"unique_id: "ext_temp"state_topic: MobileAlerts/022d3ad26f5e/jsonunit_of_measurement: '°C'value_template: "{{value_json.temperature[0]}}"sensor:
# average sensor with good unit propagated
- platform: averagename: 'Average Outside Temperature'unique_id: "average_ext_temp"precision: 1duration:
days: 1entities:
- sensor.ext_temp# statistics sensors with good unit propagated
- platform: statisticsname: 'Minimum temp over the last 24h'unique_id: "min_ext_temp"entity_id: sensor.ext_tempstate_characteristic: value_minprecision: 1max_age:
hours: 24
- platform: statisticsname: 'Maximum temp over the last 24h'unique_id: "max_ext_temp"entity_id: sensor.ext_tempstate_characteristic: value_maxprecision: 1max_age:
hours: 24# average sensors with unit not propagated correctly
- platform: averagename: 'Average Min Outside Temperature'unique_id: "average_min_ext_temp"precision: 1duration:
days: 1entities:
- sensor.minimum_temp_over_the_last_24h
- platform: averagename: 'Average Max Outside Temperature'unique_id: "average_max_ext_temp"precision: 1duration:
days: 1entities:
- sensor.maximum_temp_over_the_last_24h
Steps to Reproduce
Take a temp sensor;
Create a statistics helper based on this sensor
Create an Average sensor based on the statistics helper
Expected behavior
The average sensor should be able to retrieve the proper unit of measurement also from a statistics helper.
Debug log
There are no log entries related to any issue with this component
Additional context
On this graph you can see on the above graph that the outdoor temp, its average, and the statistics helpers are all measured in °C as expected. The below graph shows that the average sensors of the 2 statistics helpers have no unit and Lovelace displays them is a separate graph.
I have found a possible workaround by using the attributes of the average sensor of the physical measurement:
I would then extract these attributes in separate sensors using the custom component "attribute extractor", then average this new sensor, but I may end up with the same issue of units if the custom component acts same as the statistics helper for the unit of measurement.
The text was updated successfully, but these errors were encountered:
Environment
Describe the bug
I have a temperature sensor for outdoors temperature. Unit is degrees Celcius as "°C" (2 symbols).
I take an average of the temperature on a 24h window and it works well.
I want to calculate the min and max temp values on the 24h window and average them as well to make them smoother.
For this I make 2 "statistics" helpers to calculate the min and max temp of the last 24h.
Then I average these helpers on a 24h window.
All sensors show up with the "°C" measurement unit except the last 2 average sensors that are produced without unit.
Configuration.yaml
Steps to Reproduce
Expected behavior
The average sensor should be able to retrieve the proper unit of measurement also from a statistics helper.
Debug log
Additional context
On this graph you can see on the above graph that the outdoor temp, its average, and the statistics helpers are all measured in °C as expected. The below graph shows that the average sensors of the 2 statistics helpers have no unit and Lovelace displays them is a separate graph.
I have found a possible workaround by using the attributes of the average sensor of the physical measurement:
I would then extract these attributes in separate sensors using the custom component "attribute extractor", then average this new sensor, but I may end up with the same issue of units if the custom component acts same as the statistics helper for the unit of measurement.
The text was updated successfully, but these errors were encountered: