Input_text - default code

Hi all,

Something seems to have gone wrong. I was playing with a blueprint to allow me to use the IKEA Symfonisk Remote and since then I’ve got a completely blank input_text file and I’m getting errors at startup. It originally turned off all of my automations, though they now seem to be back. I was wondering if anyone could paste the code for a default input_text file so that I could restore it. I’ve tried restoring backups of my HA but it doesn’t seem to fix it. I’ve updated everything to the latest versions but also no good.

Any help would be appreciated,

Thanks,

Tom

How were you creating the input_texts?

Via the UI or YAML?

Hi,
I created a helper in the UI and I’d been working on the blueprint in the UI as well. However, in file editor my input_text file is now completely blank and automations don’t work unless I go back to a previous back up from last week. As a result I get the notification in the first post.

I’d like to be able to restore the input_text file to how it should be and then I’ll leave that blueprint alone.

Thanks,

Tom

My input_text.yaml is also blank (if I even have one).
I have some input text in my configuration.yaml, and the rest has been created in UI and they are just there.
Not sure where they are but I assume in the hidden folder in some JSON file.

Pretty sure UI created input_texts are stored in the registry (.storage). You should not mess with this you could make things much worse.

This should definitely fix it if you go back to before the faulty input text was created.

That’s what I thought, but the backups and updates haven’t fixed the problem. I’ve got no idea why this is the case. However, I created a backup before I restored to an earlier version and when I restore that one no automations work, they’re not loaded when I restart HA.

I’m a bit baffled how one blueprint that seems to work fine for everyone else has done this. I’ve deleted everything to do with it.

The only reason I have access to the .storage area is because I needed to see the files for the BroadLink remotes to check something a while back. Otherwise I don’t touch anything in there.

Are you sure you didn’t do anything in configuration.yaml? The error says default config could not be loaded, that’s in the configuration.yaml.

And you could post the logs that it’s asking you to look at also.

Default config fails if any integration in it fails to load. Input texts are in the default config.

Hi,
I didn’t touch anything else. I went to look at the input_texts to see if anything was there but it was blank. I assumed that there should be something there so that’s why I asked if it could be pasted here so I could add it.

Is there any way to replace the file? I thought restoring the backup would’ve done that but for some reason it hasn’t. I really don’t want to have to start HA from scratch again!

I don’t even have the file:

But as I said I have it in configuration.yaml:

image

But I doubt you want that…
How is the error log coming along?

Well…I thought “what the hell” went into input_boolean and copied the text from the beginning and tweaked it to say the following:

{
    "version": 1,
    "minor_version": 1,
    "key": "input_text",
    "data": {
        "items": [
                ]
    }
}

input_text now works. However, I also restored it to the position where it all went wrong in the first place to test it. It seems to be working, but I am getting an automation error notification when I restart HA, though I don’t know which automation is wrong. I have this:

2022-02-14 10:39:32 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: Failed to load blueprint: Unable to find seamus65/zha-ikea-symfonisk-sound-controller-for-media-the-spinny-one.yaml (See /config/configuration.yaml, line 9).

However, I don’t have an automation related to it and I deleted the blueprint. If this is the only error I can live with it!

Seems to be related to the blueprint:

Logger: homeassistant.config
Source: components/blueprint/models.py:211 
First occurred: 10:46:07 (1 occurrences) 
Last logged: 10:46:07

Invalid config for [automation]: Failed to load blueprint: Unable to find seamus65/zha-ikea-symfonisk-sound-controller-for-media-the-spinny-one.yaml (See /config/configuration.yaml, line 9).
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/blueprint/models.py", line 209, in _load_blueprint
    blueprint_data = yaml.load_yaml(self.blueprint_folder / blueprint_path)
  File "/usr/src/homeassistant/homeassistant/util/yaml/loader.py", line 110, in load_yaml
    with open(fname, encoding="utf-8") as conf_file:
FileNotFoundError: [Errno 2] No such file or directory: '/config/blueprints/automation/seamus65/zha-ikea-symfonisk-sound-controller-for-media-the-spinny-one.yaml'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/config.py", line 103, in _try_async_validate_config_item
    config = await async_validate_config_item(hass, config, full_config)
  File "/usr/src/homeassistant/homeassistant/components/automation/config.py", line 70, in async_validate_config_item
    return await blueprints.async_inputs_from_config(config)
  File "/usr/src/homeassistant/homeassistant/components/blueprint/models.py", line 297, in async_inputs_from_config
    blueprint = await self.async_get_blueprint(bp_conf[CONF_PATH])
  File "/usr/src/homeassistant/homeassistant/components/blueprint/models.py", line 275, in async_get_blueprint
    blueprint = await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/blueprint/models.py", line 211, in _load_blueprint
    raise FailedToLoad(
homeassistant.components.blueprint.errors.FailedToLoad: Failed to load blueprint: Unable to find seamus65/zha-ikea-symfonisk-sound-controller-for-media-the-spinny-one.yaml

Not sure what to do about that.

Does the file exist? Can you recreate it? Probably by importing the blueprint agian.

Fixed it. The automation was still in the automations.yaml. Cleared it out and no more errors. Thanks for your help. Really don’t know what caused it to create such as issue, but I’ll just use the Tradfri Gateway and forget the local control!!! I only wanted to be able to turn the speakers down!