Custom attribute in a template switch (or similar)?

Before going to extreme measures (a custom component), I’d like to ask if there is a “builtin” way to achieve the target I’ll expose beloaw.

First, the existing:

  • As a monitoring measure, I have command_line sensors that ssh to my various system and grab the last system error with a dmesg -Tx -l err,crit,alert,emerg
  • If the value changed (new error), I position an input_boolean, that I display on my dashboard and send notifications
  • I can then take actions to solve (or ignore) the errors
  • I then manually repositions the input_boolean to off to “acknowledge” that I handled the potential error.

Unfortunately, the actual error is in the state of the command_line sensor, so I have to manually check it, as I don’t display it in lovelace for cluttering reasons.

The target:

  • Ideally, I would click on the input_boolean badge and see the error in its attributes. I’m pretty sure that’s not possible, as input_booleans has no custom attributes.
  • The next obvious solution would be to use a template switch, but it doesn’t seem to be possible to add custom attributes to a template switch, yet, either.

The question(s):

  • Is there a clever way to add custom attributes to a template switch?
  • Would there be another way to achieve the target that I didn’t thought off?

Thanks

You could use browser_mod to replace the more-info of the input_boolean to a card with anything you want to see ?

1 Like

Thanks for the idea.
That would be (maybe) less extreme than a custom component, but still not builtin.

And I’d prefer a “core” rather than a “frontend” solution, anyway. Breaking changes in frontend tend to be less documented and more of a PITA.