I know I’m over simplifying how I’m writing this and so I’m hoping I can get some help. I want to use the object_id of a input_number to select the associated climate entity (they both have the same object_id) and then set the temperature to the input_number that triggered the automation. I think it should be something along the lines of: -
I didn’t see the target temperature change for the climate, so I thought I had it completely wrong, so I didn’t think to check the logs. Now I look there’s this in the log
Logger: homeassistant.components.automation.input_number_change_temp
Source: helpers/service.py:140
Integration: Automation (documentation, issues)
First occurred: 16:18:40 (10 occurrences)
Last logged: 16:27:33
Input_Number Change Temp: Error executing script. Unexpected error for call_service at pos 1: Error rendering data template: UndefinedError: ‘None’ has no attribute ‘state’
While executing automation automation.input_number_change_temp
Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/helpers/template.py”, line 285, in async_render return compiled.render(kwargs).strip() File “/usr/local/lib/python3.8/site-packages/jinja2/environment.py”, line 1090, in render self.environment.handle_exception() File “/usr/local/lib/python3.8/site-packages/jinja2/environment.py”, line 832, in handle_exception reraise(*rewrite_traceback_stack(source=source)) File “/usr/local/lib/python3.8/site-packages/jinja2/_compat.py”, line 28, in reraise raise value.with_traceback(tb) File “”, line 1, in top-level template code File “/usr/local/lib/python3.8/site-packages/jinja2/filters.py”, line 794, in do_float return float(value)
It was the temperature part of the service data that was causing me the problem. Instead of calling states.trigger.entity_id.state I needed trigger.to_state.state