core: rest sensor unavailable

The problem

Environment

  • Home Assistant Core release with the issue:
  • Last working Home Assistant Core release (if known):
  • Operating environment (OS/Container/Supervised/Core):
  • Integration causing this issue:
  • Link to integration documentation on our website:

Problem-relevant configuration.yaml


Traceback/Error logs


Additional information

Hi It seems i am stuck with HA 116.4 I run HA on raspberry pi3+ with virtual environment. I have done this for years since version 60 something. I am also a Nabu Casa customer. I have lots of sensors, binary sensors, scripts, switches and automations. Everything went fine until i tried to upgrade to the first 117 After an upgrade HA starts but my REST sensors create trouble. Some of them - not all - become “unavailable” I can’t believe i am the only one with this problem, but maybe i am It doesn’t matter which 117.x i try to upgrade to I have not tried 118.x yet as i expect same result after many upgrade attempts with 117.x Anyway i seem stuck so i must ask for assistance. I have set up a HA on another raspberry pi3+ to have a controlled environment in order to make the problem reproduceable. In this environment i have 5 rest sensors - nothing else. If i only have 4 there is no problem The very moment i add the 5th sensor one of the 5 become “unavailable” To me it looks like HA picks one of them randomly. It is not consequently the same one of the 5 that becomes unavailable. If i add further rest sensors, all but 4 sensors become unavailable. It seems as if there was a limit of 4 sensors. I have included:

HA [frontend]

frontend

sensors.yaml

  • platform: rest name: vp_flow resource: http://192.168.1.100/F value_template: ‘{{value_json.temperature}}’ unit_of_measurement: “L/m”

  • platform: rest name: vp_fremloeb resource: http://192.168.1.100/A value_template: ‘{{value_json.temperature}}’ unit_of_measurement: “°C”

  • platform: rest name: vp_retur resource: http://192.168.1.100/B value_template: ‘{{value_json.temperature}}’ unit_of_measurement: “°C”

  • platform: rest name: vandvarmer resource: http://192.168.1.100/C value_template: ‘{{value_json.temperature}}’ unit_of_measurement: “°C”

  • platform: rest name: vp1_effekt_rap resource: http://192.168.1.100/D value_template: ‘{{value_json.temperature}}’ unit_of_measurement: “kW”

The answer from my arduino from one of the sensors that work and the answer from the one that dosn’t in a dosprompt It doesn’t matter from which computer the curl statement is issued.

dosprompt

The HA log In this it looks like the HA thinks i sends a curl to the sensor (without actually doing so) and then complains over the lack of answer. The text "Error fetching data: http://192.168.1.100/A failed with " i guess should give some information but doesn’t

2020-11-24 12:33:20 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform rest is taking over 10 seconds. 2020-11-24 12:33:20 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: http://192.168.1.100/B failed with 2020-11-24 12:33:20 WARNING (MainThread) [homeassistant.components.sensor] Platform rest not ready yet. Retrying in 30 seconds. 2020-11-24 12:33:20 WARNING (MainThread) [homeassistant.bootstrap] Support for the running Python version 3.7.3 is deprecated and will be removed in the first release after December 7, 2020. Please upgrade Python to 3.8.0 or higher. 2020-11-24 12:34:21 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.vp_fremloeb is taking over 10 seconds 2020-11-24 12:34:21 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: http://192.168.1.100/A failed with 2020-11-24 12:34:51 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.vp_fremloeb is taking over 10 seconds 2020-11-24 12:34:51 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: http://192.168.1.100/A failed with 2020-11-24 12:35:21 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.vp_fremloeb is taking over 10 seconds 2020-11-24 12:35:21 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: http://192.168.1.100/A failed with 2020-11-24 12:35:51 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.vp_fremloeb is taking over 10 seconds 2020-11-24 12:35:51 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: http://192.168.1.100/A failed with 2020-11-24 12:36:21 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.vp_fremloeb is taking over 10 seconds 2020-11-24 12:36:21 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: http://192.168.1.100/A failed with 2020-11-24 12:36:51 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.vp_fremloeb is taking over 10 seconds 2020-11-24 12:36:51 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: http://192.168.1.100/A failed with 2020-11-24 12:37:21 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.vp_fremloeb is taking over 10 seconds 2020-11-24 12:37:21 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: http://192.168.1.100/A failed with 2020-11-24 12:37:51 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.vp_fremloeb is taking over 10 seconds 2020-11-24 12:37:51 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: http://192.168.1.100/A failed with 2020-11-24 12:38:21 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.vp_fremloeb is taking over 10 seconds 2020-11-24 12:38:21 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: http://192.168.1.100/A failed with 2020-11-24 12:38:51 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.vp_fremloeb is taking over 10 seconds 2020-11-24 12:38:51 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: http://192.168.1.100/A failed with 2020-11-24 12:39:21 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.vp_fremloeb is taking over 10 seconds 2020-11-24 12:39:21 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: http://192.168.1.100/A failed with 2020-11-24 12:39:51 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.vp_fremloeb is taking over 10 seconds 2020-11-24 12:39:51 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: http://192.168.1.100/A failed with 2020-11-24 12:40:21 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.vp_fremloeb is taking over 10 seconds 2020-11-24 12:40:21 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: http://192.168.1.100/A failed with 2020-11-24 12:40:51 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.vp_fremloeb is taking over 10 seconds 2020-11-24 12:40:51 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: http://192.168.1.100/A failed with 2020-11-24 12:41:21 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.vp_fremloeb is taking over 10 seconds 2020-11-24 12:41:21 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: http://192.168.1.100/A failed with

I hope this request complies the the rules

Best Regards Mogens Bøgh Mortensen

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (2 by maintainers)

Most upvoted comments

Since these recurrent issues are not probably to be solved in a near future, I found a workaround to this issue: implementing the rest sensor not through yaml but with Node-RED into the Home Assistant (trigger+ http request+ entity node)

imagem

Needs this custom component: https://github.com/zachowj/hass-node-red

It’s easy and works flawlessly.

In my case, the cause was a change made to the REST integration; changing sensor timing from parallel processing to “unlimited” asynch requests. Since these REST requests switched to unlimited, it overloaded my API server; causing my REST sensors to timeout/become unavailable. I was able to eventually use a less resource-intensive solution that didn’t overload my API server. Since you have several different API endpoints, it sounds like there’s something else going on with your REST sensors than mine; even though they share the same symptom.

Do your REST sensor issues go away when you use the below workaround with the latest Home Assistant? That should let you use the latest Home Assistant with the older REST integration (as if you’re still using Home Assistant 0.116.4).

I wish I knew more to help you. Maybe a developer here might know what changed to cause the issue you’re seeing.