Thanks for your replies, cannot make it work though.
Right now the script looks looks like this, tried with some float and str conversion / cast as well, no matter what I did I got errors when executing it. After much fiddling it is possible to save it without complaints about the syntax, using the browser editor.
alias: New Script
sequence:
- service: number.exhaust_fan_speed_normal_47265
entity_id: number.exhaust_fan_speed_normal_47265
data_template:
number.exhaust_fan_speed_normal_47265: "{{ states.number.exhaust_fan_speed_normal_47265 + 10 }}"
mode: single
Logger: homeassistant.components.websocket_api.http.connection
Source: helpers/service.py:249
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 10:20:47 PM (6 occurrences)
Last logged: 10:30:09 PM
[139818483298656] Error rendering data template: TypeError: unsupported operand type(s) for +: ‘DomainStates’ and ‘int’
[139818483298656] Error rendering data template: TypeError: unsupported operand type(s) for +: ‘DomainStates’ and ‘float’
[139818483298656] Error rendering data template: TypeError: unsupported operand type(s) for +: ‘DomainStates’ and ‘str’
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/template.py”, line 423, in async_render
render_result = _render_with_context(self.template, compiled, **kwargs)
File “/usr/src/homeassistant/homeassistant/helpers/template.py”, line 1950, in _render_with_context
return template.render(**kwargs)
File “/usr/local/lib/python3.10/site-packages/jinja2/environment.py”, line 1301, in render
self.environment.handle_exception()
File “/usr/local/lib/python3.10/site-packages/jinja2/environment.py”, line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File “”, line 1, in top-level template code
TypeError: unsupported operand type(s) for +: ‘DomainStates’ and ‘int’
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 242, in async_prepare_call_from_config
render = template.render_complex(config[conf], variables)
File “/usr/src/homeassistant/homeassistant/helpers/template.py”, line 140, in render_complex
return {
File “/usr/src/homeassistant/homeassistant/helpers/template.py”, line 141, in
render_complex(key, variables, limited, parse_result): render_complex(
File “/usr/src/homeassistant/homeassistant/helpers/template.py”, line 147, in render_complex
return value.async_render(variables, limited=limited, parse_result=parse_result)
File “/usr/src/homeassistant/homeassistant/helpers/template.py”, line 425, in async_render
raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: TypeError: unsupported operand type(s) for +: ‘DomainStates’ and ‘int’
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py”, line 200, in handle_call_service
await hass.services.async_call(
File “/usr/src/homeassistant/homeassistant/core.py”, line 1755, in async_call
task.result()
File “/usr/src/homeassistant/homeassistant/core.py”, line 1792, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File “/usr/src/homeassistant/homeassistant/components/script/init.py”, line 473, in _service_handler
await self.async_turn_on(variables=service.data, context=service.context)
File “/usr/src/homeassistant/homeassistant/components/script/init.py”, line 432, in async_turn_on
await coro
File “/usr/src/homeassistant/homeassistant/components/script/init.py”, line 462, in _async_run
return await self.script.async_run(script_vars, context)
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 1524, in async_run
await asyncio.shield(run.async_run())
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 409, in async_run
await self._async_step(log_exceptions=False)
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 453, in _async_step
self._handle_exception(
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 476, in _handle_exception
raise exception
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 451, in _async_step
await getattr(self, handler)()
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 657, in _async_call_service_step
params = service.async_prepare_call_from_config(
File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 249, in async_prepare_call_from_config
raise HomeAssistantError(f"Error rendering data template: {ex}") from ex
homeassistant.exceptions.HomeAssistantError: Error rendering data template: TypeError: unsupported operand type(s) for +: ‘DomainStates’ and ‘int’