Running a script by a regular user (which is not an admin) that calls the localtuya.set_dp service yelds into an "Unauthorized" result. Running the script as an administrator works.
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 484, in _async_run
return await self.script.async_run(script_vars, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1524, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 409, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 453, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 476, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 684, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1744, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1781, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 744, in admin_handler
raise Unauthorized(context=call.context)
homeassistant.exceptions.Unauthorized: Unauthorized
Environment
Localtuya version: 4.1.1
Last working localtuya version (if known and relevant): N/A
Home Assistant Core version: 2022.11.3
[ ] Are you using the Home Assistant Tuya Cloud component ?
The problem
Running a script by a regular user (which is not an admin) that calls the
localtuya.set_dp
service yelds into an "Unauthorized" result. Running the script as an administrator works.The service call:
The result:
Environment
Steps to reproduce
localtuya.set_dp
Configuration
configuration.yaml
orconfig_flow