Cover Up when alarm disarmed: Error executing script. Invalid data for call_service at pos 1: must contain at least one of entity_id, area_id.
Logger: homeassistant.components.automation.cover_up
Source: core.py:1269
Integration: Automation (documentation, issues)
First occurred: 10:51:09 PM (1 occurrences)
Last logged: 10:51:09 PM
While executing automation automation.cover_up
Traceback (most recent call last):
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/src/homeassistant/homeassistant/helpers/config_validation.py", line 128, in validate
raise vol.Invalid("must contain at least one of {}.".format(", ".join(keys)))
voluptuous.error.Invalid: must contain at least one of entity_id, area_id.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 426, in async_trigger
await self.action_script.async_run(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 944, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 198, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 206, in _async_step
await getattr(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 416, in _async_call_service_step
await self._async_run_long_action(service_task)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 375, in _async_run_long_action
long_task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1269, 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 276, in __call__
raise er.MultipleInvalid([e])
voluptuous.error.MultipleInvalid: must contain at least one of entity_id, area_id.
You have way too many hyphens in your action, so youāre calling the service āscript.turn_onā with no service data. Even without the hyphens youāre not passing the data to the script correctly.
Thanks, to difficult for me for my first script.
I rewrote it like this, but can I not test right now because my family is sleeping.
Hopefully it will work tomorrow
# Covers Up IF Alarm disarmed with above automation ****************************
- id: Cover Up
alias: Covers Up if alarm disarmed
trigger:
platform: time
at: '07:28:00'
condition:
condition: and
conditions:
- condition: state
entity_id: alarm_control_panel.mqtt_alarm
state: "disarmed"
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
#
- condition: state
entity_id: cover.50758014840d8e918632
state: "close"
- condition: state
entity_id: cover.50758014840d8e918632
state: "unknow"
- service: cover.open_cover
entity_id: cover.50758014840d8e918632
- delay:
seconds: 60
#
- condition: state
entity_id: cover.50758014840d8e91eaa2
state: "close"
- condition: state
entity_id: cover.50758014840d8e91eaa2
state: "unknow"
- service: cover.open_cover
entity_id: cover.50758014840d8e91eaa2
- delay:
seconds: 60
#
- condition: state
entity_id: cover.50758014840d8e91f036
state: "close"
- condition: state
entity_id: cover.50758014840d8e91f036
state: "unknow"
- service: cover.open_cover
entity_id: cover.50758014840d8e91f036
- delay:
seconds: 60
#
- condition: state
entity_id: cover.50758014840d8e91f4fd
state: "close"
- condition: state
entity_id: cover.50758014840d8e91f4fd
state: "unknow"
- service: cover.open_cover
entity_id: cover.50758014840d8e91f4fd
I will try it tomorrow. I think in my case I must go
with āifā, āelifā and āelseā
but I am not sure what to do in the āelseā
I mean
if cover=close then open
elif cover = unknown then open
else = ?