Hello tom_I,
I studied the input_number and tried to put it in my automation in combination with the trigger.payload but am getting an error. Am I missing something?
One example would be this course of action:
- service: input_number.set_value
data_template:
entity_id: input_number.TempTemp
value: "{{ state_attr('climate.buro', 'temperature') | int }}"
.....
- data:
entity_id: climate.buro
hvac_mode: heat
temperature: "{{ states('input_number.TempTemp') | int }}"
entity_id: climate.buro
service: climate.set_temperature
And the next example would be
- data:
entity_id: climate.buro
hvac_mode: heat
temperature: "{{ trigger.payload | int }}"
service: climate.set_temperature
......
- data:
entity_id: climate.buro
hvac_mode: heat
temperature: "{{ states('input_number.TempTemp') | int }}"
Both of these throw basically the same error:
Invalid data for call_service at pos 2: expected float for dictionary value @ data['temperature']
I have also tried float instead of int but am basically getting the same error.
Or more verbose:
ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 190, in async_run
await self._handle_action(action, variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 273, in _handle_action
await self._actions[_determine_action(action)](action, variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 355, in _async_call_service
context=context,
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 97, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context
File "/usr/src/homeassistant/homeassistant/core.py", line 1213, in async_call
processed_data = handler.schema(service_data)
File "/usr/local/lib/python3.7/site-packages/voluptuous/validators.py", line 208, in __call__
return self._exec((Schema(val) for val in self.validators), v)
File "/usr/local/lib/python3.7/site-packages/voluptuous/validators.py", line 287, in _exec
raise e if self.msg is None else AllInvalid(self.msg, path=path)
File "/usr/local/lib/python3.7/site-packages/voluptuous/validators.py", line 283, in _exec
v = func(v)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/usr/local/lib/python3.7/site-packages/voluptuous/validators.py", line 205, in _run
return self._exec(self._compiled, value, path)
File "/usr/local/lib/python3.7/site-packages/voluptuous/validators.py", line 287, in _exec
raise e if self.msg is None else AllInvalid(self.msg, path=path)
File "/usr/local/lib/python3.7/site-packages/voluptuous/validators.py", line 285, in _exec
v = func(path, v)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
return schema(data)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
return base_validate(path, iteritems(data), out)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: expected float for dictionary value @ data['temperature']