Thanks for this yaml, got it working except for color warmth. I get this error when pressing it:
Error while executing automation automation.lounge_light_remote_warm_down. Unknown error for call_service at pos 1:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 443, in action
await script_obj.async_run(variables, context)
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 87, in async_call_from_config
template.render_complex(config[CONF_SERVICE_DATA_TEMPLATE], variables)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 71, in render_complex
return {key: render_complex(item, variables) for key, item in value.items()}
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 71, in <dictcomp>
return {key: render_complex(item, variables) for key, item in value.items()}
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 73, in render_complex
return value.async_render(variables)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 222, in async_render
return compiled.render(kwargs).strip()
File "/usr/local/lib/python3.7/site-packages/jinja2/asyncsupport.py", line 76, in render
return original_render(self, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.7/site-packages/jinja2/_compat.py", line 37, in reraise
raise value.with_traceback(tb)
File "<template>", line 1, in top-level template code
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'
This is my yaml:
- id: Lounge_light_remote_warm_up
alias: Lounge Light Warm Up
trigger:
platform: state
entity_id: sensor.0x000d6ffffe179359_action
to: arrow_right_click
action:
data_template:
entity_id: light.0x000d6ffffe2a96db_light
color_temp: "{{ state_attr('light.0x000d6ffffe2a96db_light', 'color_temp') + 75 }}"
service: light.turn_on
- id: Lounge_light_remote_warm_down
alias: Lounge Light Remote Warm Down
trigger:
platform: state
entity_id: sensor.0x000d6ffffe179359_action
to: arrow_left_click
action:
data_template:
entity_id: light.0x000d6ffffe2a96db_light
color_temp: "{{ state_attr('light.0x000d6ffffe2a96db_light', 'color_temp') - 75 }}"
service: light.turn_on