That one seems like it could solve a problem for me. I would like to deactivate some Scrape sensors, and from your code I thought this would work. The trigger is from an MQTT message, with payloads from 1-9.
action: homeassistant.enable_config_entry
metadata: {}
data:
config_entry_id: |-
{{ config_entry_id('media_player.foobarsone
{{
trigger.payload}}_artist') }}
But nothing happens, and I get this in the logger. The problem is that I can’t see from the logger what it actually tries to execute, I think. So I don’t know if something is missing or wrong. Do you have any idea what’s wrong here?
Logger: homeassistant.components.automation.aktivere_scrape_sensorer_og_foobar_integrasjon_nar_foobar_starter
Kilde: components/automation/__init__.py:717
integrasjon: Automasjon (dokumentasjon, problemer)
Første forekomst: 12:30:41 (1 occurrence)
Sist logget: 12:30:41
While executing automation automation.aktivere_scrape_sensorer_og_foobar_integrasjon_nar_foobar_starter
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 717, in async_trigger
return await self.action_script.async_run(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
variables, trigger_context, started_action
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1833, in async_run
return await asyncio.shield(create_eager_task(run.async_run()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 460, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
self._handle_exception(
~~~~~~~~~~~~~~~~~~~~~~^
ex, continue_on_error, self._log_exceptions or log_exceptions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 556, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 524, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1009, in _async_step_call_service
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<9 lines>...
)
^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 624, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2816, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2859, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 939, in _async_admin_handler
return await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/homeassistant/__init__.py", line 344, in async_handle_reload_config_entry
raise ValueError("There were no matching config entries to reload")
ValueError: There were no matching config entries to reload