#Is there a way to append a °C
1 messages · Page 1 of 1 (latest)
Not to the value, unless you use an input text, but ... you want the number, not a string with the units in it
https://www.home-assistant.io/docs/configuration/customizing-devices/ can add it as an attribute, but including it in the state would just cause problems
A numeric state trigger wouldn't work if you had an input_number with a state of 15°C
Sure it wouldn't. I know the difference between a float and a string
I just think the easiest way wold be an option to add a unit string in the configuration.yml
That's what you'd do with customising
Which is of course not part of the integer
There's a standard attribute unit_of_measurement
How to use it for the automation then?
I tried this
type: temperature
platform: device
device_id: 2877e714d4a9f31dcdcbd14882ba4dcc
entity_id: sensor.thermometer_wohnzimmer_temperature
domain: sensor
below:
data:
value: "{{ states('input_number.wohnzimmertemperatur_slider') | float }}"
for:
hours: 0
minutes: 0
seconds: 0
With a numeric state trigger, as I said before
automation:
trigger:
- platform: numeric_state
entity_id: sensor.temperature
below: input_number.wohnzimmertemperatur_slider
Nice
There is one problem though. It only triggers this when it passes that value. My room temperature is 19.8°C now and nothing happens when I put the slider to 20°C
That is not an issue when you have a fixed value, but when you use the slider often, HA doesn't react
- platform: numeric_state
entity_id: input_number.wohnzimmertemperatur_slider
above: sensor.temperature
Add both
Both as trigger?
Yes
I don't know how that will solve my problem
Because it's the change in the entity that causes a trigger to be evaluated
If you move the slider then the second trigger will be evaluated
If the sensor updates then the first trigger will be evaluated
No that doesn't work as I expected.
The entity value should be polled or something
Guess that would be a waste of resources though
The entity in the above/below is only checked when the entity_id entity updates
So, with both triggers you'll find it runs when either the sensor goes below the input_number, or you change the input_number to be above the sensor
Then ... write them that way
I guess I have to wait until the thermometer reports back
use above the input number and below the sensor
Stupid cheap Aqara sensors don't do it that often
Some day I will buy better sensors and Tado TRVs
automation:
trigger:
- platform: numeric_state
entity_id: sensor.temperature
above: input_number.wohnzimmertemperatur_slider
- platform: numeric_state
entity_id: input_number.wohnzimmertemperatur_slider
below: sensor.temperature
Job done
But the Tados only work with a bridge unfortunately
I have two automations for that
One to turn them on and one to turn them off
Is that wrong?
I don't get why I should set the trigger to above and below
Did you read what I wrote?
Or did you skim it and not pay attention to the entities in both triggers
Yes but I don't understand
So, with both triggers you'll find it runs when either the sensor goes below the
input_number, or you change theinput_numberto be above the sensor

Hence why I asked if you'd read, or skimmed 😉
More coffee... it won't help, but you can blame having too much of it 
Yeah, I know what you mean. I won't have any after lunchtime to avoid sleep issues
Same
One strong coffee in the morning is enough
It is also not like it gives you energy. It just blocks receptors that tell you that you don't
So you think you are awake, but you actually aren't
Rather take some amphetamine if you really want to be awake 😄
But I can't recommend that
HA is so nice. Now I only need a better slider. Pity this custom slider card doesn't support input_number entities