Thanks Phil,
What ever the reason for these issues, it is caused only recently, because it also happens in the scripts and automations that drive my HA system for over almost 3 years now, and have been working perfectly since.
check this error, which I cant understand at all, because of the statement it is looking for an atttribute ‘is_on’. Which isn’t in the automation at all…:
2020-04-06 07:22:52 ERROR (MainThread) [homeassistant.components.automation] Activity selection: Error executing script. Unexpected error for call_service at pos 1: 'NoneType' object has no attribute 'is_on'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 138, in _async_step
self, f"_async_{cv.determine_script_action(self._action)}_step"
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 233, in _async_call_service_step
context=self._context,
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 101, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context
File "/usr/src/homeassistant/homeassistant/core.py", line 1234, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1257, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 207, in service_handler
await script.async_turn_on(variables=service.data, context=service.context)
File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 284, in async_turn_on
await self.script.async_run(kwargs.get(ATTR_VARIABLES), context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 693, in async_run
await run.async_run()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 444, in async_run
await self._async_run()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 460, in _async_run
await self._async_step(not propagate_exceptions)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 138, in _async_step
self, f"_async_{cv.determine_script_action(self._action)}_step"
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 233, in _async_call_service_step
context=self._context,
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 101, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context
File "/usr/src/homeassistant/homeassistant/core.py", line 1234, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1257, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 207, in service_handler
await script.async_turn_on(variables=service.data, context=service.context)
File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 284, in async_turn_on
await self.script.async_run(kwargs.get(ATTR_VARIABLES), context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 693, in async_run
await run.async_run()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 444, in async_run
await self._async_run()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 460, in _async_run
await self._async_step(not propagate_exceptions)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 138, in _async_step
self, f"_async_{cv.determine_script_action(self._action)}_step"
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 233, in _async_call_service_step
context=self._context,
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 101, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context
File "/usr/src/homeassistant/homeassistant/core.py", line 1234, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1257, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 204, in service_handler
if script.is_on:
and this is the automation:
automation:
- alias: 'Activity selection'
id: 'Activity selection'
trigger:
platform: state
entity_id: input_select.activity
condition:
condition: template
value_template: >
{{states('input_select.activity') in
['Opstaan','Aan de slag','Home theater',
'Gym','Gaming','Selamat makan','Naar bed','Slapen']}}
action:
- service_template: >
script.{{trigger.to_state.state|lower|replace(' ','_')}}
- service: python_script.summary_mode_activity
also, some change must have been made, because, as said, the main reason to write these automation and scripts using subscripts in the action block has always been the fact of robustness and the main script being able to continue, even if a subscript for whatever reason errors out.
Added to the above issue, this is also in the logs:
the exact same error, but, this is logged for my ‘Slapen’ activity, which was called yesterday night. Note that it apparently has been trying to keep running the script, at least until 7.22.52 this morning! So first the script errors, and halts the full ‘mother’ script. Secondly, it keeps trying to run somehow…
all very new behavior, and must be said, unwanted behavior…