Response error 500

Hello

I’m totally new to HA, so I am sorry if this may sound like a silly question to the majority of you here.

I am simply trying to create an Automation using the Automation Editor
A. Trigger: When TV is turned on
B: Action: Call Service - Notifications: Send a Persistent Notification
In the service data I inserted the message.
C. Save

Whatever I do I simply get a Response Error 500.

Can anyone kindly let me know if I need to install or configure anything particular for this to work.
Thanks
Jahel

Hi there, It would be helpful if you could share the yaml of the automation you created. Please take a look at the gif to find the yaml and copy paste it between ``` so that it can be seen as code.

Please note the gif shows a different process but you can find the yaml in the same position.

No matter what actions, conditions or triggers I set, when I save I get the Response Error 500. So I feel its a setup or communication issue.

I have the same issue. Whatever automation I try to do in the GUI I get the error “Response error: 500”

Code

alias: bingo
description: bongo
mode: single
trigger:

  • platform: sun
    event: sunset
    condition:
    action:
  • type: brightness_decrease
    device_id: 249f494d487688a3ab8790c2e2184462
    entity_id: light.tradfri_bulb
    domain: light

And error in log:

Traceback (most recent call last):
File “/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py”, line 422, in _handle_request
resp = await self._request_handler(request)
File “/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py”, line 499, in _handle
resp = await handler(request)
File “/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py”, line 119, in impl
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/security_filter.py”, line 56, in security_filter_middleware
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/request_context.py”, line 18, in request_context_middleware
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/ban.py”, line 72, in ban_middleware
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/auth.py”, line 129, in auth_middleware
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/view.py”, line 129, in handle
result = await result
File “/usr/src/homeassistant/homeassistant/components/config/init.py”, line 160, in post
self._write_value(hass, current, config_key, data)
File “/usr/src/homeassistant/homeassistant/components/config/automation.py”, line 60, in _write_value
cur_value[CONF_ID] = uuid.uuid4().hex
TypeError: ‘str’ object does not support item assignment

I fixed this by doing the following

2.1. In Configuration.yaml add the following
automation: !include automations.yaml
2.2. In Automation.yaml remove the text
Event Template

Hope it helps. I was experimenting by adding the automaton in the configuration.yaml and automaton.yaml. then the automaton got created automaton

2 Likes

What I noticed is I only ran into this when there was something in my automations.yaml file that was incomplete. I removed anything and started blank and that went away.

1 Like

I’m getting same issue - I even removed all text in automations.yaml and still unable to create automations in the UI.

I had managed to solve the problem by coding the automation in the configuration.yaml file.
I used the link below to understand what happened.
Automation YAML - Home Assistant (home-assistant.io)
The automation was then created in the Automation Editor however I was only able to modify it after placing the same code in the automation.yaml folder (and adding a unique id).

Same problem for me. I have lots of existing animations and want to try the UI method, but nope.

I had same issue. FIx was to add IDs into automations.yaml

  • id: MY ID

before each automation to make then unique by this quide:

2 Likes

Check automations.yaml for invalid syntax

worked perfect. Thanks

Hi,

sorry to bump an old post, but i can’t figure this out - i keep getting the error 500.
When i try to create (my first) automation, it keeps giving me that error every time.

Logger: aiohttp.server
Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:403
First occurred: 21:18:05 (2 occurrences)
Last logged: 21:18:55

‘’’
Error handling request
Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py”, line 433, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py”, line 504, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py”, line 117, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/security_filter.py”, line 85, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/forwarded.py”, line 100, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/request_context.py”, line 28, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/ban.py”, line 80, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/auth.py”, line 236, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/headers.py”, line 31, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/view.py”, line 148, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/decorators.py”, line 63, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/config/init.py”, line 112, in get
value = self._get_value(hass, current, config_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/config/init.py”, line 218, in _get_value
return next((val for val in data if val.get(CONF_ID) == config_key), None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/config/init.py”, line 218, in
return next((val for val in data if val.get(CONF_ID) == config_key), None)
^^^^^^^
AttributeError: ‘str’ object has no attribute ‘get’
‘’’

I suspect it has something to do with having Dropback add-on.
My automations.yaml file:

id: belekas
alias: System Backup To Dropbox
description: "a"
trigger:
  - platform: time
    at: "03:00:00"
action:
  - service: hassio.backup_full
    data:
      name: "{{ now().strftime('%Y-%m-%d') }}"
  - delay: "00:15:00"
  - service: hassio.addon_stdin
    data:
      addon: 719b45ef_dropback
      input: sync
mode: single

I added that “id: belekas” later. Yet it keeps saying “this automation cannot be edited from UI, because it is not stored in automations.yaml or it doesn’t have and ID.” in Configuration >Automations.

Home assistant OS version 2023.10 on a dedicated x64 PC.

Thanks :slight_smile:

I get the same problem as I try to build a script. “Response error: 500”
Any ideas?
When I look at any of the scripts I already have, it says “this script can’t be edited from the UI as it is not loaded into scripts.yaml”. I check it and it is.
It seems the problem is the access from the UI to the file, but I don’t know how to fix it.

Also have the same from today (2023-12-01). I installed the actualization of the Core, and from this moment I cannot do any automatization or script. Is like the actualization didn,t finished yet. Also I have error and doesnt allow me to restart home assistant.

I have the same error 500 when trying to save a new automation. I’ll post more details when possible but adding id: unique id doesn’t help and gives error which I’ll add here asap.

Any other solution than adding a unique id?

I had the same problem - I solved it by removing specific scripts from scripts.yaml.
I don’t exactly know what was the problem with these old scripts but since they were not being used I deleted them and it worked good after a reboot.

try to remove from the file all scripts and then add a few every time to fid the script/s to blame…