Send error messages to the front end?

I’m trying to improve the reliability of a thermostat component and it’s a definite use case that the thermostat can’t/won’t respond to a request to change the temperature. Right now, it seems like if there is an error sending the request (basically the thermostat is off line), it shows up in the log, but that’s it. In that case, it would be nice if the user can get an error message of some type in the UI rather than having nothing happen.

Is there a way for a component to send an error message to the web front end?