Error : Resource not set for RestData

Home Assistant 2023.7.1

The rest component gives the following error when I modify configuration.yml
The error logs refer to a directory structure that does not exist ie : /usr/src/homeassistant/homeassistant/components/rest/

=================================================================================
Logger: homeassistant.setup
Source: components/rest/init.py:198
First occurred: 15:26:43 (1 occurrences)
Last logged: 15:26:43

Error during setup of component rest
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/setup.py”, line 288, in _async_setup_component
result = await task
^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/rest/init.py”, line 89, in async_setup
return await _async_process_config(hass, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/rest/init.py”, line 109, in _async_process_config
rest = create_rest_data_from_config(hass, conf)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/rest/init.py”, line 198, in create_rest_data_from_config
raise HomeAssistantError(“Resource not set for RestData”)
homeassistant.exceptions.HomeAssistantError: Resource not set for RestData

I added the following text ( part of a full 4 sensor array)

rest:

  • resource: http://192.168.002.251:3333/api/v1/live-data
  • sensor:
    - name: “Apricus Hot Water”
    value_template: ‘{value_json[0].rawValue}}’
    unit_of_measurement: ‘°C’
    json_attributes_path: “$[0]”
    json_attributes:
    - “name”
    - “rawValue”
    =================================================================================

The directory exists within the “homeassistant” docker container, which is not the same as for the normal filesystem. If you want to look at that line of the code, you can find it from the github link on the components documentation page, which takes you here.

In the line below you have mismatched parentheses, which might be causing the problem. However, given you’re missing the opening one, I would assume it would be treated as a string rather than a template (ie. similar to setting value template to “OK”).

value_template: ‘{value_json[0].rawValue}}’

You also need to surround your code in the forum with backticks (```) so it formats correctly. As it stands, pasting the code in has put weird quotes in, which is not helping.

Thanks Michael - first time post …
I have tweaked the syntax and now have this error from setup.py…

‘’'Logger: homeassistant.setup
Source: setup.py:398
First occurred: 16:47:15 (4 occurrences)
Last logged: 16:47:15

Unable to prepare setup for platform rest.sensor: Unable to set up component."""

All sorted - It was related to “Out of Memory” error on the VM when python script attempted to run.
Data being received Ok now.