I have an MQTT device, it provides a error description if it is in an error state. I used a Value template to extract the information: {{ value_json.error }}
If no error is present, the value is not part of the MQTT message.
So my question: How to test if a “error” value is present and to provide a default value (e.g., no_error) if the value is absent. (At the moment the UI gives me thee string “error” if no error is present.)
Optionally replace none with whatever you want it to report when the error key doesn’t exist (such as "no value" or 0 or "" or whatever best fits your application).