Great idea man!!! Love it.
I tried to set it up in my env. However, it seems that my automation is not working.
I have the input fields setup, I have the automation setup as follows:
- id: '1596010583695'
alias: Update Printer Ink Levels
description: ''
trigger:
- entity_id: sensor.canon_mx720_multifunctional
from: unavailable
platform: state
to: idle
condition:
- condition: template
value_template: '{{ states.sensor.canon_mx720_multifunctional.state not in [states.sensor.canon_mx720_multifunctional.state,
''unavailable'']}}'
action:
- data:
entity_id: input_text.printer_black_left
entity_id: input_text.printer_black_left
service: input_number.set_value
- data:
entity_id: input_text.printer_cyan_left
entity_id: input_text.printer_cyan_left
service: input_number.set_value
- data:
entity_id: input_text.printer_magenta_left
entity_id: input_text.printer_magenta_left
service: input_number.set_value
- data:
entity_id: input_text.printer_yellow_left
entity_id: input_text.printer_yellow_left
service: input_number.set_value
mode: single
However, when I turn on the printer and becomes available - changes the state from unavailable to idle, the debug gives me this error:
Logger: homeassistant.components.automation
Source: core.py:1235
Integration: Automation (documentation, issues)
First occurred: 11:33:06 AM (1 occurrences)
Last logged: 11:33:06 AM
While executing automation automation.update_printer_ink_levels
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 409, in async_trigger
await self.action_script.async_run(variables, trigger_context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 790, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 185, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 193, in _async_step
await getattr(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 382, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1235, in async_call
processed_data = handler.schema(service_data)
File "/usr/local/lib/python3.8/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.8/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.8/site-packages/voluptuous/validators.py", line 283, in _exec
v = func(v)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
return schema(data)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
return base_validate(path, iteritems(data), out)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: required key not provided @ data['value']
I do not know to what data[‘value’] it’s referring to.
Any ideas? and thank you very much.