TobKie
March 2, 2024, 8:37am
1
I want to set the calibration of the termostat with the differenz between the termostat temperature and the room temperature. The helper from my Template works fine
template:
- sensor:
- name: "Wohnzimmer Temperatur delta"
unique_id: "Wohnzimmer-Temp-delta"
unit_of_measurement: "°C"
state_class: "measurement"
state: >
{{ ((((((states('sensor.wohnzimmer_thermometer_temperature')) | float ) - ((states('sensor.smart_thermostat_0300ec96_temperature')) | float))*10) | round )/10) | float }}
But the Automation generates an error, I’ll think the helper ist not float?!?
Here my automation
alias: Wohnzimmer Temperatur angleichen
description: ""
trigger:
- platform: time_pattern
minutes: /5
condition: []
action:
- service: number.set_value
metadata: {}
data:
value: input_number.wohnzimmer_temp_delta
target:
entity_id: number.smart_thermostat_0300ec96_adjust_temperature
mode: single
Here the Error I’ll get:
‘expected float for dictionary value @ data[‘value’]’
Anyone an idea?
thisi s the right way:
service: input_number.set_value
target:
entity_id: input_number.test_number
data:
value: >
{{ states('input_number.test_number_2') }}
TobKie
March 2, 2024, 9:30am
3
Thanks, but now I get an other warning: Referenced entities number.smart_thermostat_0300ec96_adjust_temperature are missing or not currently available
But when I change the entity in the developers tools, it works fine. Some Idea
TobKie
March 2, 2024, 9:50am
5
I’ll do it in an automation, shall I do it in the configuration?
alias: Wohnzimmer Temperatur angleichen
description: ""
trigger:
- platform: time_pattern
minutes: /5
condition: []
action:
- service: input_number.set_value
target:
entity_id: number.smart_thermostat_0300ec96_adjust_temperature
data:
value: >
{{ states('sensor.wohnzimmer_temperatur_delta') }}
mode: single
use input_number.set_value to set the value of input_numbers
use number.set_value to set the value of numbers.
i don’t understand what you mean by whether you do it in an automation or in the configuraiton. do you mean whether you should put that code in the automation ui versus putting it in configuration.yaml? if so, no you should not put automation code in configuration.yaml. leave automation code in automation.yaml.
TobKie
March 2, 2024, 10:15am
7
Okay, thanks for that
This one works and set the Temperature kalibration to -2.0
alias: Wohnzimmer Temperatur angleichen
description: ""
trigger:
- platform: time_pattern
minutes: /5
condition: []
action:
- service: number.set_value
target:
entity_id: number.smart_thermostat_0300ec96_adjust_temperature
data:
value: >
-2.0
mode: single
but this one not and the actual value is 1.5
alias: Wohnzimmer Temperatur angleichen
description: ""
trigger:
- platform: time_pattern
minutes: /5
condition: []
action:
- service: input_number.set_value
target:
entity_id: number.smart_thermostat_0300ec96_adjust_temperature
data:
value: >
{{ states('sensor.wohnzimmer_temperatur_delta') }}
mode: single
Edwin_D
(Edwin D.)
March 2, 2024, 10:21am
8
You cannot assign to a number using an input_number service. Did you mean input_number? Or use the other service instead:
TobKie
March 2, 2024, 10:27am
9
I can, the frirst one sets the calibration to -2.0 but the one with the input_number.set_value and the helper makes this warning and nothing happens:
Referenced entities number.smart_thermostat_0300ec96_adjust_temperature are missing or not currently available
Edwin_D
(Edwin D.)
March 2, 2024, 10:29am
10
Matches up (right service for right entity domain), but
Doesn’t match up, input_number service used on number domain.
And if the entity is really unavailable as the error suggests, then you can’t set it either.
as before, use input_number.set_value to set the value of input_number.
use number.set_value to set the value of numbers.
in your second code that you say doesn’t work, you aren’t doing that.
alias: Wohnzimmer Temperatur angleichen
description: ""
trigger:
- platform: time_pattern
minutes: /5
condition: []
action:
- service: input_number.set_value
target:
entity_id: number.smart_thermostat_0300ec96_adjust_temperature
data:
value: >
{{ states('sensor.wohnzimmer_temperatur_delta') }}
mode: single
TobKie
March 2, 2024, 10:31am
12
I don’t understand what you mean. because it works fine when I set the value to a fixed Number baut not when I use a helper sensor
Edwin_D
(Edwin D.)
March 2, 2024, 10:32am
13
Look at my previous post. Your original esamples are not the same service call.
the issue isn’t whether you are setting a fixed number or a template, the issue is you also switched to use input_number.set_value to set the number.
1 Like
TobKie
March 2, 2024, 10:36am
15
Thank all of you, it works fine. I missunderstood the meaning of input_number and number.
Edwin_D
(Edwin D.)
March 2, 2024, 10:39am
16
T.b.h. I do not know why there are two different domains for these, it is confusing to say the least. You can both set them. If number had been read only it would have made more sense. I believe it because the input version is a helper and the other is made by integrations. But that should not be a reason to introduce a different domain i.m.h.o.