Get HTTP code on a restful sensor

Hello,

Is there a way to get HTTP returned code on restful sensors/commands in value_template?
There is value_json to get values from the body but is there an equivalent for headers or simply the HTTP code (200 or 401 for example)?

I’m going to stick my neck out and say “no”. Looking at the source (start at line 132 in the current file), the headers are read for content type but then discarded.

It doesn’t look like it’d be too hard to update the code to include it as an attribute.

1 Like

Yeah, this sucks, it would be great to have the functionality to parse if the response code is 200 or otherwise.

1 Like

I was wandering if anyone knows if this feature is going to be implemented?
Not having the option to read status code is thinking in a happy flow. That communication can´t fail or values don´t need a quality indicator.