Just as a feedback. What I now did is little ugly IMHO but the best solution I could come up with.
I moved the error_state query to dashboard variables. I can now access the result of the error state via a variable. The lookup from [1|2|3] to [green|yellow|red] I realized via my Redis data source. See below:
variable
queries
transforms


