RESTfull can't parse JSON all of a suddon

Just updated HA Core to core-2021.10.5 and all of a sudden RESTfull is unable to parse the website data I am passing it. If I plug the JSON directly into a JSON validator it says that there is nothing wrong with it.

      "text":"ADL - BNE - ADL",
      "address":"Long Term Car Park, Adelaide Airport SA 5950, Australia",
      "distance":"24.9 km",
      "travelTime":"28 mins",
      "remainingText":" 19 hours, 14 minutes"

This was previously working.

  - scan_interval: 30
    timeout: 20
    verify_ssl: false
      - name: "Google Alarm Event"
        json_attributes_path: "$.event"
        value_template: "{{  state_attr('sensor.google_alarm_event', 'text') }}"
          - "text"
          - "unixTime"
          - "time"
          - "timeFinish"
          - "day"
          - "dayFinish"
          - "address"
          - "travelTime"
          - "travelTimeSecs"
      - name: "Google Alarm"
        json_attributes_path: "$.alarm"
        value_template: "{{  state_attr('sensor.google_alarm', 'timeToLeave') }}"
          - "unixWakeUpTime"
          - "unixGetReadyTime"
          - "unixTimeToLeave"
          - "timeToLeave"
      - name: "Google Night Lights"
        json_attributes_path: "$.nightLights"
        value_template: "{{  state_attr('sensor.google_night_lights', 'enabled') }}"
          - "enabled"
          - "unixLightFade"
          - "lightFade"
          - "unixSleepTime"
          - "sleepTime"
      - name: "Google Leave Time Remaining"
        json_attributes_path: "$.remaining"
        value_template: "active"
          - "duration"
          - "editable"
          - "starts_at"
          - "finishes_at"
          - "remainingText"

** I have changed the URL, but you can see the correct data

I do see some errors in the supervisor logs, however I’m not usre if they are relevent or not

21-10-17 18:47:41 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-1075' coro=<_websocket_forward() done, defined at /usr/src/supervisor/supervisor/api/> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/api/", line 287, in _websocket_forward
    await ws_to.send_bytes(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/", line 155, in send_bytes
    await self._writer.send(data, binary=True, compress=compress)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/", line 685, in send
    await self._send_frame(message, WSMsgType.BINARY, compress)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/", line 643, in _send_frame
    self._write(header + mask + message)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/", line 660, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport

The ONLY error or clue that I am getting in the normal longs are:

Source: components/rest/
Integration: RESTful (documentation, issues)
First occurred: 18:42:36 (360 occurrences)
Last logged: 19:32:33

REST result could not be parsed as JSON

Can you ping the resource, ?

Yes I can… That URL is NOT the right URL… it’s a dummy URL as I don’t want to post it on the forum… I can see the data without any issues in a web browser

I can see in the source code that this log message is followed by a debug log message that shows the JSON that it is unable to parse. The following snippet shows how you can change the rest integration’s log level to debug.

  default: info
  logs: debug
1 Like

bingo… that allowed me to see the problem… cheers for that. There was text in there that was hidden making it looked like it was working when it wasn’t

1 Like