I have made the following repeat actions in my automation, where I wanted to do a repeat loop until two conditions are met:
- alias: AUTO - light1
description: ''
mode: restart
trigger:
- platform: state
to: 'on'
entity_id:
- binary_sensor.door
- binary_sensor.pir
condition: []
action:
- alias: repeat until 2 conditions
repeat:
sequence:
- service: switch.turn_on
entity_id: switch.light1
- delay: 00:00:15
until:
- condition:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.pir
state: 'off'
- condition: state
entity_id: binary_sensor.door
state: 'off'
- service: switch.turn_off
entity_id: switch.light1
When I reload Automations all is OK and I get message that Automations reloaded
Unfortunately when I do Restart HASS
I get the following errors:
Error2:
Logger: homeassistant.components.hassio
Source: components/hassio/__init__.py:420
Integration: Home Assistant Supervisor (documentation, issues)
First occurred: 22:41:36 (1 occurrences)
Last logged: 22:41:36
Unexpected error calling config validator: unhashable type: 'collections.OrderedDict'
Error1:
Logger: homeassistant.helpers.check_config
Source: helpers/config_validation.py:790
First occurred: 22:41:36 (1 occurrences)
Last logged: 22:41:36
Unexpected error validating config
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/check_config.py", line 145, in async_check_ha_config_file
await config_validator.async_validate_config( # type: ignore
File "/usr/src/homeassistant/homeassistant/components/automation/config.py", line 102, in async_validate_config
await asyncio.gather(
File "/usr/src/homeassistant/homeassistant/components/automation/config.py", line 84, in _try_async_validate_config_item
config = await async_validate_config_item(hass, config, full_config)
File "/usr/src/homeassistant/homeassistant/components/automation/config.py", line 60, in async_validate_config_item
config = PLATFORM_SCHEMA(config)
File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 218, 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 337, 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 386, in validate_mapping
cval = cvalue(key_path, value)
File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 215, in _run
return self._exec(self._compiled, value, path)
File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 339, in _exec
v = func(path, v)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 635, in validate_sequence
cval = validate(index_path, value)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
return schema(data)
File "/usr/src/homeassistant/homeassistant/helpers/config_validation.py", line 888, in script_action
return ACTION_TYPE_SCHEMAS[determine_script_action(value)](value)
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 386, in validate_mapping
cval = cvalue(key_path, value)
File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 215, in _run
return self._exec(self._compiled, value, path)
File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 339, in _exec
v = func(path, v)
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 386, in validate_mapping
cval = cvalue(key_path, value)
File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 215, in _run
return self._exec(self._compiled, value, path)
File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 339, in _exec
v = func(path, v)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 635, in validate_sequence
cval = validate(index_path, value)
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/validators.py", line 215, in _run
return self._exec(self._compiled, value, path)
File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 260, in _exec
return func(path, v)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
return schema(data)
File "/usr/src/homeassistant/homeassistant/helpers/config_validation.py", line 790, in key_value_validator
if key_value not in value_schemas:
TypeError: unhashable type: 'collections.OrderedDict'
When I remove AND condition and my automation look like this:
- alias: AUTO - light1
description: ''
mode: restart
trigger:
- platform: state
to: 'on'
entity_id:
- binary_sensor.door
- binary_sensor.pir
condition: []
action:
- alias: repeat until 2 conditions
repeat:
sequence:
- service: switch.turn_on
entity_id: switch.light1
- delay: 00:00:15
until:
- condition: state
entity_id: binary_sensor.pir
state: 'off'
- service: switch.turn_off
entity_id: switch.light1
there is no issue during restarting HASS (also during reloading Automation).
Either I am doing something wrong in automation or there is a bug compiling AND condition in “Repeat until” section in automation.
Any comment, help, insight - will be appreciated.