ha-average icon indicating copy to clipboard operation
ha-average copied to clipboard

Feature request: Ability to retrieve other items than temperature from weather/climate

Open xatr0z opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe.

Right now when a weather entity is included, it defaults to temperature.

Describe the solution you'd like

I would like it to default to the ATTR_UNIT_OF_MEASUREMENT from the other entities included. This would be useful for me; i want to have a baseline of the humidity in my location using my own sensors and the humidity reported from my weather service.

An alternative would be a new variable by which i can define the attribute which should be included.

Describe alternatives you've considered

For now I'll make an temporary template sensor for extracting the humidty from the weather sensor.

Additional context

xatr0z avatar May 07 '21 20:05 xatr0z

This integration looks at the state of an entity and for weather integrations the temperature is in the state. I think you'd best create a template sensor in HA that you let read the value of a certain attribute, and use that new entity for this custom integration.

However, whilst reading this, I stubled across this https://www.home-assistant.io/integrations/template/#state-based-template-sensors and I'm now starting to wonder what is the difference with this ha-average custom integration? /edit: to answer my own question: I see this custom integration takes into account which weather integrations are actually available, whilst with the above link, if f.i. 2 out of 4 are available, and 2 give unknown, f.i. still for some time after startup, the average is incorrectly calculated.

GoSpursGoNL avatar May 10 '21 06:05 GoSpursGoNL

Why not simply adding "unit_of_measurement:" as attribute like other sensors do?

FauthD avatar Apr 06 '22 17:04 FauthD

+1 I've created an average sensor using the temperature of 4 RAID disks. When I try to create a graph combining the room temperature and the RAID disk avg temperature, it shows two separated graphs. The temperature chart of the avg one has no temperature unit (others sensors have the correct unit). Having the ability to add the unit using a "unit_of_measurement" attribute would be great.

cnaslain avatar Jun 12 '22 11:06 cnaslain