bitrip
(BiTRiP)
January 10, 2021, 12:06pm
1
Hello,
I have my Nest Thermostat integrated by adding 4 lines of code in my config.yaml like client id , client secret, project id and subscriber id.
After that I got 3 new identities: Climate, Temperature and Humidity.
However the temperature shows a number with five decimals…
How can I round this off with just one decimal?
Bubule
(Franck)
January 18, 2021, 9:38am
2
Hello,
Did you find a way ?
I’ve got the same problem …
Edit : Just find a way with round(x)
- service: input_number.set_value
data:
entity_id: input_number.yourdata
value: "{{ ( states('input_number.yourdata' ) | float + 0.2 ) | round (2) }}"
Franck
Bubule
(Franck)
January 20, 2021, 7:14am
4
I put it in automation.
on each modification it rules :
- id: 'round yourdata'
alias: round the value
description: 'roud the value after each modification'
condition: []
trigger:
- platform: state
entity_id:
- input_number.yourdata
action:
- service: input_number.set_value
data:
entity_id: input_number.yourdata
value: "{{ ( states('input_number.yourdata' ) | float ) | round (2) }}"
(On previous post, I show you how make a round after each increment of 0.2)
Franck
Mike_B
(Mike B)
February 14, 2021, 2:00pm
5
sorry to be really thick but what do I put for input_number.yourdata? Is it input_number.sensor.living_room or have i got this wrong?
Bubule
(Franck)
February 14, 2021, 4:04pm
6
Arff No, you can’t write it like this
Declare an input numbe like this in your input number file
inputsensorlivroom:
name: input sensor livingroom
min: 0
max: 30
step: 0.1
unit_of_measurement: °C
In your automation file :
- id: 'round'
alias: round your data
description: 'round your temp data'
trigger:
- platform: state
entity_id:
- sensor.living_room
condition: []
action:
# This transfers your sensor value in input number
# (input_number input sensor livingroom = sensor living room)
- service: input_number.set_value
data:
entity_id: input_number.inputsensorlivroom
value: "{{ states('sensor.living_room' ) | float }}"
# This round input number value
- service: input_number.set_value
data:
entity_id: input_number.consigne_salon_nuit
value: "{{ states('input_number.consigne_salon_nuit' ) | round (2) }}"
And use this new input_number value in your card
I’m just not getting this to work.
Can anyone help or point me in the direction of a good step by step for a complete noob like me to help me solve this, please?
** I would like the number to show with no decimals points so instead of 19.2 just 19 would be good, so instructions with the round included would be appreciated. **
Tried loads of times and just think I’m putting certain parts of the instructions above in the wrong place or in the wrong order.
My Lovelace card is like this
The entities related to this Thermostat are these one’s
Downstairs - Humidity = sensor.downstairs_humidity
Downstairs - Temp =sensor.downstairs_temperature
Downstairs Thermostat = climate.downstairs_hall
I tried to create an Automation like the above suggests however where is the input number file? That’s the bit that I’m maybe missing.
Thanks in advance.
I’ve opened a pull request to adjust the precision of both the temperature and humidity sensors:
home-assistant:dev
← michaeldavie:nest_precision
opened 03:18PM - 03 Oct 21 UTC
1 Like
This PR has been merged, so hopefully the change will be in the 2021.11 release.
2 Likes
Nice job, @michaeldavie ! Was doing some HA stuff this morning and found this thread to adjust my Nest button numbers. So glad I it got merged!
marcelod
(garliclord)
November 26, 2021, 4:54pm
11
Thanks so much for this! Not seeing the same number in HA and on the actual Nest device was bothering me more than I’d like to admit.
1 Like
chezpaul2
(Paul B.)
December 1, 2021, 6:06pm
12
Has this been done?
It’s been bugging me too. I’ve been trying to find a way to round the temperature to a 0.5 number.
So as to have 20.5 or 21 instead of 20.7.
My Nest climate still shows 22.3 right now. So I’m guessing this hasn’t been done yet.
The fix was to change it from 22.3333333333
to 22.3
. So you are right, this was not what you were looking for. My impression is you can fix this with templating in the frontend, but i don’t know the details of how to accomplish this. (Hope this is helpful as a quick reply, but likely someone more knowledgeable has a real answer for you)
chezpaul2
(Paul B.)
December 2, 2021, 4:04am
14
Figure it out
- platform: template
sensors:
livingroom_current_temperature_rd:
friendly_name: "Current Temperature"
unit_of_measurement: °C
value_template: >
{{ (((state_attr('climate.living_room', 'current_temperature') | float) * 2) | round ) / 2 }}