Hi,
I first of tried to make my own but it did not work. Then i tried to copy one of the examples from Home Assistant examples that did not work either. Any Suggenstions?
Snippet
sensor:
- platform: rest
resource: http://ip.jsontest.com
name: External IP
value_template: “{{ value_json.ip }}”
I get the following error when starting Home Assistant.
Apr 26 19:32:04 ha systemd[1]: Started Home Assistant.
Apr 26 19:32:04 ha sudo[8145]: pam_unix(sudo:session): session closed for user root
Apr 26 19:32:06 ha hass[8148]: 2021-04-26 19:32:06 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up rest platform for sensor
Apr 26 19:32:06 ha hass[8148]: Traceback (most recent call last):
Apr 26 19:32:06 ha hass[8148]: File “/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity_platform.py”, line 205, in _async_setup_platform
Apr 26 19:32:06 ha hass[8148]: await asyncio.shield(task)
Apr 26 19:32:06 ha hass[8148]: File “/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/rest/sensor.py”, line 53, in async_setup_platform
Apr 26 19:32:06 ha hass[8148]: await rest.async_update()
Apr 26 19:32:06 ha hass[8148]: File “/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/rest/data.py”, line 55, in async_update
Apr 26 19:32:06 ha hass[8148]: response = await self._async_client.request(
Apr 26 19:32:06 ha hass[8148]: File “/srv/homeassistant/lib/python3.8/site-packages/httpx/_client.py”, line 1361, in request
Apr 26 19:32:06 ha hass[8148]: response = await self.send(
Apr 26 19:32:06 ha hass[8148]: File “/srv/homeassistant/lib/python3.8/site-packages/httpx/_client.py”, line 1396, in send
Apr 26 19:32:06 ha hass[8148]: response = await self._send_handling_auth(
Apr 26 19:32:06 ha hass[8148]: File “/srv/homeassistant/lib/python3.8/site-packages/httpx/_client.py”, line 1434, in _send_handling_auth
Apr 26 19:32:06 ha hass[8148]: response = await self._send_handling_redirects(
Apr 26 19:32:06 ha hass[8148]: File “/srv/homeassistant/lib/python3.8/site-packages/httpx/_client.py”, line 1466, in _send_handling_redirects
Apr 26 19:32:06 ha hass[8148]: response = await self._send_single_request(request, timeout)
Apr 26 19:32:06 ha hass[8148]: File “/srv/homeassistant/lib/python3.8/site-packages/httpx/_client.py”, line 1492, in _send_single_request
Apr 26 19:32:06 ha hass[8148]: (status_code, headers, stream, ext) = await transport.arequest(
Apr 26 19:32:06 ha hass[8148]: File “/srv/homeassistant/lib/python3.8/site-packages/httpx/_transports/default.py”, line 169, in arequest
Apr 26 19:32:06 ha hass[8148]: return await self._pool.arequest(
Apr 26 19:32:06 ha hass[8148]: AttributeError: ‘AsyncConnectionPool’ object has no attribute ‘arequest’
Apr 26 19:32:07 ha sudo[8194]: ha : TTY=pts/0 ; PWD=/home/ha ; USER=root ; COMMAND=/usr/bin/journalctl
Apr 26 19:32:07 ha sudo[8194]: pam_unix(sudo:session): session opened for user root by ha(uid=0)