I hope someone here can help me:
I am controlling my fireplace over modbus and all is working but setting the intensity. I have a slider (slider1) for this together with an automation. But I can’t get the slider value to be sent. If I set the automation with a fixed value it works:
- id: '210'
alias: Haard intensiteit
trigger:
- entity_id: input_number.slider1
platform: state
action:
- service: modbus.write_register
data:
unit: 2
address: 40201
value: 10
But as soon as I change the value into something dynamic I get an error:
value: '{{states.input_number.slider1.state}}'
or
value: '{{states(input_number.slider1)}}'
the error is
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/automation/__init__.py", line 294, in async_trigger
await self._async_action(self.entity_id, variables, context)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/automation/__init__.py", line 378, in action
await script_obj.async_run(variables, context)
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/script.py", line 130, in async_run
await self._handle_action(action, variables, context)
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/script.py", line 172, in _handle_action
action, variables, context)
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/script.py", line 261, in _async_call_service
context=context
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/service.py", line 81, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context)
File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1101, in async_call
processed_data = handler.schema(service_data)
File "/usr/local/lib/python3.6/site-packages/voluptuous/schema_builder.py", line 267, in __call__
return self._compiled([], data)
File "/usr/local/lib/python3.6/site-packages/voluptuous/schema_builder.py", line 589, in validate_dict
return base_validate(path, iteritems(data), out)
File "/usr/local/lib/python3.6/site-packages/voluptuous/schema_builder.py", line 427, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: expected int @ data['value'][0]
I have tried many versions but somehow I can’t seem to pass a variable to modbus…