I hoped to get feedback if the source is not available, but even force_update just updates the last read value, even if the page throws a 404 or the value is not on the site.
How can I intercept such cases? I need to be sure that the data is recent.
If the call fails, value_json wonāt be available to parse in the templates ā at least, thatās my experience. So, you can check if value_json is defined.
My example was specific to the JSON I get back on that API call, which is very different from yours. Nothing after if value_json can be used verbatim. I was just including that as a complete example, but without knowing your caseās JSON response at the time. Sorry if I confused you.
Iām going to assume you want NameOfVar as your sensorās value. I have to say, that JSON looks really strange to me (not using normal ASCII quotes and the seemingly abstract key names).