How nice you found a solution using Ubidots resources, specifically the Help Center.
Complementing your solution, here are other options (or limitations) for your consideration:
1. Indicator widget: this widget allows manually entering a color logic that not only changes the color based on the value, but also displays a fix text. See image:
2. Using context: while it is true that you can send the strings in the context, please note that not all widgets support extracting data from the context, the line chart being an example.
However, widgets like the tables (in all of its variations, namely, values, variables and device tables), or the metric.
We hope this helps and provides further clarification.