Access the temperature value from a climate entity

I am trying to graph out the temperature of a Netatmo smart valve but it seems that it is detected as a climate object


How can I access (call) the current_temperature value in the climate entity above?
Or is the only way to create a new sensor?

You can create a template sensor or just use a template in an automation without creating a template sensor.

1 Like

Does this look right for the template?

master_temperature:
      friendly_name: Master Bedroom Temperature
      unit_of_measurement: 'degrees'
      value_template: "{{ state_attr('climate.netatmo_master_bedroom', 'current_temperature') }}"
6 Likes

Yep that looks good, what doe the template editor say ?

All good :+1:
However, how do I change the degrees value to Celsius? I assume it is the unit_of_measurement but what is it for C?

Try '°C' for the unit of measurement. What is your unit system set to in your config (metric or imperial)?

1 Like

Yup that did it, thanks :slight_smile:

I asked in a previous question how to access the current temperature in history, so I deleted it because after some time it apparently records it. However, it records, or the netatmo valve returns, only 0.5°C preciseness instead of 0.1°C which is visible in netatmo app. Is this implemented in the netatmo API, netatmo HA Integration or can I change it in HA?

I already answered this question in your other thread.

As far as I’m aware, the valves report temperature in 0.5°C in increments and the thermostats in 0.1°C. Haven’t seen anything else neither via the API nor the Netatmo web interface .

1 Like

Yes, thanks. However, netatmo web interface shows 0.1 increments in its measurements and uses 0,5 for temperature targets. Is this rounded by the integration?

Can you please send me a screen shot of that? I have never seen that. The API reports these values, they are passed on without modification.

This is ipad interface. 20 increments in 2 degrees.

Well, you’re looking at historic data, which is a completely different thing.

Ok, ack. so when I want to see nice graphs in HA, I made sensor from the current temperaure that has 0.5 increment. Could I access those historic data with 0.1 increment?

No, not from within HA.

1 Like

To give a bit of background here, HA does not support storing historic data in hindsight, so we only store what is reported from the API at the very point in time when we poll the data or when receiving a webhook event.

So I’m wondering if anyone can help me in reverse…

My climate current temperature is inaccurate, I have multiple temperature sensors in my home and I have an entity which is the average temperature throughout the home.

Am I able to push this average current temperature into the climate’s current_temperature rather than using the default?

1 Like

Thanks so much @sd_dracula, i was trying to work out how to expose an attribute to my dashboard card and your ‘value_template’ coding was so valuable.

Hi everyone,

I’ve been tinkering with YAML, but I haven’t really been able to understand the structure of platforms, templates and sensors.

I am trying to access the temperature of climate entity. In developer tools, I am able to view the temperature of the entity.

value_template: "{{ state_attr('climate.pool_heat_pump', 'current_temperature') }}"

I also understand that templates can be used to extract values and save them in a new sensor. I have separated my YAML file into sensors.yaml, templates.yaml etc… and made the relevant includes in the configuration.yaml

My problem is that when I use the following yaml to try and setup the template, I get lot’s of errores:

- platform: template
  sensors:
    pooltemp:
      value_template: "{{ state_attr('climate.pool_heat_pump', 'current_temperature') }}"
      unit_of_measurement: '°C'
      friendly_name: 'Pool Temp'

I gather that because I am pasting this in the template.yaml, I don’t need to repeat the first line, but I’ve tried different things, but nothing seems to work. What do I need to paste in the templates.yaml and do I need to break anything up into the sensors.yaml?

Thanks and sorry for the Noobie question.

Nevermind, was finally able to solve it by pasting this code in sensors.yaml:

- platform: template
  sensors:
    pool_temp:
      friendly_name: "Pool Temp"
      value_template: "{{ state_attr('climate.pool_heat_pump', 'current_temperature') }}"
      unit_of_measurement: "°C"
2 Likes