REST sensors - "failed with" and "Empty reply found when expecting JSON data"

I’ve added a couple of RESTful sensors, to query EVnotify.

Everthing works just fine, until a couple of hours later, I get zero data and HA logs are full with:

Blockquote
2022-02-21 22:42:02 WARNING (MainThread) [homeassistant.components.rest.sensor] Empty reply found when expecting JSON data
2022-02-21 22:45:25 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.evnotify_soc_battery_level is taking over 10 seconds
2022-02-21 22:45:25 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: https://app.evnotify.de/soc?akey=111111&token=111111111111111111111 failed with
2022-02-21 22:45:25 WARNING (MainThread) [homeassistant.components.rest.sensor] Empty reply found when expecting JSON data
2022-02-21 22:47:03 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.evnotify_extended is taking over 10 seconds
2022-02-21 22:47:03 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: https://app.evnotify.de/extended?akey=111111&token=111111111111111111111 failed with
2022-02-21 22:47:03 WARNING (MainThread) [homeassistant.components.rest.sensor] Empty reply found when expecting JSON data

A simple restart “fixes” the issue, until it blows up again :frowning:

Any hints?

Thanks,
anthonws.

Just a me too post.
It’s my nextcloud sensor which creates the same three error messages every 61 minutes (don’t ask me why):

Empty reply found when expecting JSON data
21:18:13 – (WARNING) RESTful

Error fetching data: https://[REDACTED]/ocs/v2.php/apps/serverinfo/api/v1/info?format=json failed with
21:18:13 – (ERROR) RESTful

Update of sensor.nextcloud_json is taking over 10 seconds
21:18:13 – (WARNING) helpers/entity.py

See this thread too.

This is the sensor:

- platform: rest
  resource: !secret NC_res
  scan_interval: 60
  name: "Nextcloud JSON"
  authentication: basic
  username: !secret NC_user
  password: !secret NC_passwd
  json_attributes_path: "$.ocs"
  json_attributes:
    - meta
    - data
  value_template: >
    {% if value_json %}
    {{ value_json.ocs.meta.status }}
    {% else %}
    timeout
    {% endif %}
1 Like

Since two weeks the same error here:

2022-07-05 19:59:06 WARNING (MainThread) [homeassistant.components.rest.sensor] Empty reply found when expecting JSON data
2022-07-05 19:59:36 WARNING (MainThread) [homeassistant.components.rest.sensor] Empty reply found when expecting JSON data
2022-07-05 20:00:06 WARNING (MainThread) [homeassistant.components.rest.sensor] Empty reply found when expecting JSON data
2022-07-05 20:00:36 WARNING (MainThread) [homeassistant.components.rest.sensor] Empty reply found when expecting JSON data
2022-07-05 20:01:06 WARNING (MainThread) [homeassistant.components.rest.sensor] Empty reply found when expecting JSON data

This is the sensor:

  - platform: rest
    name: awair_livingroom_sensors
    resource: !secret awair_livingroom
    json_attributes:
      - "timestamp"
      - "score"
      - "dew_point"
      - "temp"
      - "humid"
      - "abs_humid"
      - "co2"
      - "co2_est"
      - "co2_est_baseline"
      - "voc"
      - "voc_baseline"
      - "voc_h2_raw"
      - "voc_ethanol_raw"
      - "pm25"
      - "pm10_est"
    value_template: 'OK'

This sensor has been working for months, so I don’t really understand what changed. Can’t find anything in the changelog or breaking changes section of home assistant which could have caused this.

When I manually go to the “resource” I always get a result:

{"timestamp":"2022-07-05T18:11:13.547Z","score":100,"dew_point":10.22,"temp":23.21,"humid":43.83,"abs_humid":9.10,"co2":438,"co2_est":438,"co2_est_baseline":35757,"voc":64,"voc_baseline":37891,"voc_h2_raw":25,"voc_ethanol_raw":37,"pm25":2,"pm10_est":3}

Does someone have an idea what could be wrong?

+1 on this… If I do a curl to the Awair URL, I get the results, always… HA has tons of these errors, of not being able to pull the data via REST… I am at loss also to be honest.

For me it’s working fine again. I think for me it had to do with an update on my unifi ap-lr acces point.