Customising the 'create entry' success message

The Data Flow documentation states that a success message is shown when a new entry is created.

The async_create_entry function takes, among other things, the description and description_placeholders properties but I haven’t been able to find a way to customise that success message, it’s always ‘Created configuration for {title}’.

I’m assuming there must be an appropriate section of en.json that I can include, given the existence of description_placeholders in the call?

And I haven’t been able to work out exactly what description does, either!

Did a little digging and it looks like description is for adding an extra sentence here:

“Created configuration for” is hardcoded in the frontend and can’t be overwritten, but you can add an additional message (where it says Test String).

            return self.async_create_entry(
                data=user_input,
                title=title,
                description="add_sensor",
                description_placeholders={"foo": "bar"},
            )

strings.json:

{
  "config": {
    "create_entry": {
      "add_sensor": "Test String {foo}"
    }
  }
}
1 Like

Aaahhh. So ‘description’ actually specifies the en.json entry to read, not the actual text of what I wanted to put in it!

That’s great, thanks very much Karwosts