-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Description
I am trying to run local scripts with your integration. Unfortunately, the scripts generate errors in HA. The reason for this seems to be this 'feature': "Starting from Home Assistant 2023.7 the service will return all your script local vars with simple types as respond."
My script creates and needs dozens of internal variables. It works perfectly on the command line. Some of the variables can't be easily converted into JSON objects I guess. And then HA throws errors. Something like
2024-02-11 20:42:45.849 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139754501700544] Error handling message: Unknown error (unknown_error) ABC from 192.168.2.2 (Mozilla/5.0 Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0)
TypeError: 'NoneType' object is not callable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/messages.py", line 218, in _message_to_json_or_none
return JSON_DUMP(message)
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/json.py", line 130, in json_dumps
return json_bytes(data).decode("utf-8")
^^^^^^^^^^^^^^^^
TypeError: Type is not JSON serializable: Tag
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
How can I switch off this return feature? My Python script should only fill a sensor with data at the end and leave a string in the log.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working