So, I am trying to set up an automation, but I can’t get it to work.
The automation code:
- alias: "Run robot vacuum cleaner while sleeping"
trigger:
- platform: state
entity_id: switch.run_robot_vacuum_cleaner_while_sleeping
state: 'on'
- platform: state
entity_id: media_player.shiva
state: 'off'
- platform: state
entity_id: group.living_area
state: 'off'
- platform: time
after: '00:00:00'
- platform: numeric_state
entity_id: sensor.hombot_battery
above: 100
value_template: "{{ value | int }}"
condition:
condition: and
conditions:
- condition: use_trigger_values
- condition: state
entity_id: sensor.hombot_status
state: 'CHARGING'
- condition: template
value_template: "{{ states.sensor.hombot_last_clean.state.split('/')[0] ~ '-' ~ states.sensor.hombot_last_clean.state.split('/')[1] ~ '-' ~ states.sensor.hombot_last_clean.state.split('/')[2] != (now | string).split(' ')[0] }}"
- condition: time
before: '05:00:00'
action:
- service: homeassistant.turn_on
entity_id: script.hombot_clean
- service: notify.pushover
data:
title: "HASS automation"
message: "Robot vacuum cleaner started running!"
The error I’m currently getting:
16-07-26 13:15:31 homeassistant.bootstrap: Error during setup of component automation
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/bootstrap.py", line 150, in _setup_component
if not component.setup(hass, config):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/automation/__init__.py", line 105, in setup
success = (_setup_automation(hass, config_block, name, config) or
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/automation/__init__.py", line 116, in _setup_automation
action = _process_if(hass, config, config_block, action)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/automation/__init__.py", line 173, in _process_if
checks.append(condition.from_config(if_config))
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/condition.py", line 34, in from_config
return factory(config, config_validation)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/condition.py", line 40, in and_from_config
config = cv.AND_CONDITION_SCHEMA(config)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/voluptuous.py", line 355, in __call__
return self._compiled([], data)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/voluptuous.py", line 655, in validate_dict
return base_validate(path, iteritems(data), out)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/voluptuous.py", line 489, in validate_mapping
raise MultipleInvalid(errors)
voluptuous.MultipleInvalid: not a valid value for dictionary value @ data['conditions'][0]['condition']
I wasn’t originally getting this error, when I was using to:
instead of state:
for my triggers, but then my automation wasn’t firing. Obviously, it won’t fire now either.
I’m not sure if condition: use_trigger_values
can be combined with other conditions using condition: and
but I sure hope it can. I’ve looked everywhere I could but haven’t found anybody trying this.
I hope I included everything. This is my first topic on this forum, so please let me know if I’ve forgotten something.