After upgrading HA to 2021.6.3., my restful sensor does not show any value. In my log file, requesting and receiving to rest sensor seems OK, but it fails to show with following error.
2021-06-14 09:08:55 WARNING (MainThread) [homeassistant.components.sensor] Platform rest not ready yet: Server disconnected while attempting read; Retrying in background in 30 seconds
Anyone know how to solve this problem?
tom_l
June 14, 2021, 12:40am
2
I see this error on restarting Home Assistant now too. Though my rest sensors do eventually update.
Mine’s not updating anymore.
You see the error once? For me, this error happens repeatedly (on every update attempts).
tom_l
June 14, 2021, 12:51am
4
Yeah just once at start up.
Can you post your restful sensor config?
Sanitise the resource if needed.
Yup. My restful sensor configuration is simple.
- platform: rest
resource: http://192.168.1.228/powerMeasure
name: powermeter
value_template: '{{ (value_json.powerMeasure/1000 - 0.3) }}'
unit_of_measurement: kWh
device_class: power
Next is a result of sample query using curl command to see the status.
$ curl -X GET http://192.168.1.228/powerMeasure
{“powerMeasure”: 1148.07, “id”: “1”, “name”: “powme”, “hardware”: “esp8266”, “connected”: true}
tom_l
June 14, 2021, 1:46am
6
Yeah that looks ok. Not sure why it can’t connect.
When you say this:
What do you mean?
This is part of my log file.
2021-06-14 09:37:06 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.rest
2021-06-14 09:37:06 DEBUG (MainThread) [homeassistant.components.rest.data] Updating from http://192.168.1.228/powerMeasure
2021-06-14 09:37:06 DEBUG (MainThread) [httpx._client] HTTP Request: GET http://192.168.1.228/powerMeasure “HTTP/1.1 200 OK”
2021-06-14 09:37:06 DEBUG (MainThread) [homeassistant.components.sensor] Platform rest not ready yet: Server disconnected while attempting read; Retrying in 180 seconds
If you see 3rd line, GET request receives 200 OK response. But it ended with an error (not ready yet) in the next row.
tom_l
June 14, 2021, 2:43am
8
So HA is able to find the ip address of the resource and connect but then drops the connection.
But when you do it manually with curl, everything is ok.
Yes, when I do it manually with curl, everything is OK.
j0dan
June 14, 2021, 4:38am
10
Same problem here after an upgrade.
tom_l
June 14, 2021, 5:09am
11
There are a few issues open for the restful sensor: Issues · home-assistant/core · GitHub
Nothing exactly like you have reported though.
Might be worthwhile opening a new issue.
I’m facing the same issue with my rest sensor
tom_l
June 14, 2021, 7:35am
13
I wonder if this is the reason (fix will be in 2021.6.5):
home-assistant:dev
← home-assistant:httpcore-constrain
opened 07:43AM - 13 Jun 21 UTC
1 Like
Maran
June 14, 2021, 8:10am
14
Same here with rest sensor not working to read out my HomeWizard, after update no temperature and read out of the switches.
platform: rest
resource: !secret homewizard_sensor
name: homewizard
value_template: “{{ value_json.status }}”
json_attributes:
rexave
(Rexave)
June 14, 2021, 9:20am
15
hello, same probleme here
i can’t make it works again.
sensor:
- platform: rest
resource: !secret legrand_source_instantanes
name: legrand_source_instantanes
scan_interval: 5
json_attributes:
- data1
- data2
- data3
- data4
- data5
i have tried to disable almost everything. Can’t make it work back.
The only relevent log is this one :
2021-06-14 11:14:15 WARNING (MainThread) [homeassistant.components.sensor] Platform rest not ready yet: Server disconnected while attempting read; Retrying in background in 30 seconds
Same issue here after updating to core-2021.6.4 , when rolling back to core-2021.6.3 everything is ok.
rexave
(Rexave)
June 14, 2021, 9:49am
17
rolling back to core-2021.6.3 (binary and confioguration) also fixed the issue here. rolling back just binary isn’t enough.
tom_l
June 14, 2021, 10:00am
18
Have any of you opened an issue?
ludeeus
(Ludeeus)
June 14, 2021, 10:34am
19
2 Likes
Thanks!
I temporarily solved the problem via manually downgrading httpcore to version 0.13.3.
pip3 install httpcore==0.13.3
1 Like