RESTful Sensor Errors

Hi,

I occassionally get an error on a RESTful sensor like below. It happens randomly - I assume a network or other issue. Next time it tries, then it works.

Is there anyway to get this error message (or state) back? I’d like to use a value_template to NOT update the sensor values if there is an error. (For this API call, returning an empty list is a valid results). What I would really like to see/be able to use is the HTTP Result Code for the call (e.g. 200-OK, etc).

If someone can also suggest what debugging I can turn on to get more info in the log, that would also be great! (I’d like to see more detail of the REST request and response)

Regards
Cameron.

2022-12-19 13:16:38.632 DEBUG (MainThread) [homeassistant.components.rest.data] Updating from https://developer.sepush.co.za/business/2.0/api_allowance
2022-12-19 13:16:43.649 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: https://developer.sepush.co.za/business/2.0/api_allowance failed with [Errno -3] Try again
2022-12-19 13:16:43.662 DEBUG (MainThread) [homeassistant.components.rest.sensor] Data fetched from resource: None
2022-12-19 13:16:43.662 WARNING (MainThread) [homeassistant.components.rest.sensor] Empty reply found when expecting JSON data

1 Like

Same error for me, I’ve got a REST sensor working only for few minutes, if i fetch the same resource with curl then the rest sensor restart working…