Since update to 2022.11 I receive the following error during setup of component rest:
Unable to prepare setup for platform rest.sensor: Unable to set up component.
2022-11-03 10:36:02.024 ERROR (MainThread) [homeassistant.setup] Error during setup of component rest
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 235, in _async_setup_component
result = await task
File "/usr/src/homeassistant/homeassistant/components/rest/__init__.py", line 77, in async_setup
return await _async_process_config(hass, config)
File "/usr/src/homeassistant/homeassistant/components/rest/__init__.py", line 97, in _async_process_config
rest = create_rest_data_from_config(hass, conf)
File "/usr/src/homeassistant/homeassistant/components/rest/__init__.py", line 185, in create_rest_data_from_config
raise HomeAssistantError("Resource not set for RestData")
homeassistant.exceptions.HomeAssistantError: Resource not set for RestData
Hi,
I have the same issue.
Are you sure you didn’t change anything between restarts?
I don’t know how to solve this, right now I did several restarts but that didn’t help.
I have other problem after moving the rest sensor in the Rest section, so I rollback to the previous configuration and opened an issue in GitHub, since this was working fine and not it isn’t. Looks like a regression to me.
This is the second time that I tried to update to 2022.11.2 but get the Rest Sensor errors. I previously rolled back to 2022.11.1 so that my HA instance could continue to operate. I read through this post and the linked Issue #81551 and thought maybe the issue had been addressed by the core changes. But today I tried to update again and faced with the same problems that the Rest Sensor can not be set up on boot.
It is clearly an issue with my REST templates configuration, but I dont clearly understand what I need to do. I checked the Rest documentation but its still not clear to me. I have several Rest sensors throughout my configuration that probably need updating.
Could anyone point me in the right direction with an example of the acceptable configuration?
2022-11-12 12:22:32.904 ERROR (MainThread) [homeassistant.config] Package sensor_rest_gas_price_kw setup failed. Integration rest has duplicate key 'resource_template' (See /config/packages/systems/octopus_agile/sensor_rest_gas_price_kw.yaml:0).
2022-11-12 12:22:32.906 ERROR (MainThread) [homeassistant.config] Package sensor_rest_gas_price_m3 setup failed. Integration rest has duplicate key 'resource_template' (See /config/packages/systems/octopus_agile/sensor_rest_gas_price_m3.yaml:0).
2022-11-12 12:22:32.908 ERROR (MainThread) [homeassistant.config] Package sensor_rest_import_price setup failed. Integration rest has duplicate key 'resource_template' (See /config/packages/systems/octopus_agile/sensor_rest_import_price.yaml:0).
2022-11-12 12:22:32.909 ERROR (MainThread) [homeassistant.config] Package sensor_rest_import_price_pounds setup failed. Integration rest has duplicate key 'resource_template' (See /config/packages/systems/octopus_agile/sensor_rest_import_price_pounds.yaml:0).
2022-11-12 12:22:41.161 ERROR (MainThread) [homeassistant.config] Package solarman_sensors setup failed. Integration rest has duplicate key 'scan_interval' (See /config/packages/systems/sofar_battery_inverter/solarman_sensors.yaml:0).
2022-11-12 12:22:42.096 ERROR (MainThread) [homeassistant.config] Package sensor_rest_myenergi setup failed. Integration rest cannot be merged. Expected a dict. (See /config/packages/systems/myenergi/general_files/sensor_rest_myenergi.yaml:6).
2022-11-12 12:22:42.098 ERROR (MainThread) [homeassistant.config] Package sensor_rest_myenergi_cmt setup failed. Integration rest cannot be merged. Expected a dict. (See /config/packages/systems/myenergi/general_files/sensor_rest_myenergi_cmt.yaml:6).
2022-11-12 12:22:55.940 ERROR (MainThread) [homeassistant.config] Invalid config for [rest]: two or more values in the same group of exclusion 'resource' @ data['rest'][0][<resource>]. Got None. (See ?, line ?). Please check the docs at https://www.home-assistant.io/integrations/rest
2022-11-12 12:22:55.946 ERROR (MainThread) [homeassistant.setup] Setup failed for rest: Invalid config.
2022-11-12 12:22:56.675 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform rest.sensor: Unable to set up component.
2022-11-12 12:22:56.679 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform rest.sensor: Unable to set up component.
2022-11-12 12:22:56.682 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform rest.sensor: Unable to set up component.
2022-11-12 12:22:56.684 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform rest.sensor: Unable to set up component.
2022-11-12 12:22:56.687 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform rest.sensor: Unable to set up component.
2022-11-12 12:22:56.689 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform rest.sensor: Unable to set up component.
Your configuration is wrong, please have another look at the docs.
You should avoid using multiple top-level keys if you can:
Some integrations support multiple top-level !includes, this includes integrations defining an IoT domain, e.g. light, switch, sensor as well as the automation, script and template integrations, if you give a different label to each one. Configuration for other integrations can instead be split up by using packages. To learn more about packages, see the Packages page.
This might work for the rest platform, but if you have them in one place, referencing rest: multiple times isn’t neccessary.
Have a look at the first code block in the docs. You’re missing the - in front of every rest sensor. So your first example should be:
Thank you for the guidance and assistance. I made the changes to the REST sensors nd then made a back up and attempted the update to 2022.11.2 After the update there is this warning:
2022-11-13 15:30:48.108 ERROR (MainThread) [homeassistant.config] Package sensor_rest_export_price setup failed. Integration rest cannot be merged. Expected a dict. (See /config/packages/systems/octopus_agile/sensor_rest_export_price.yaml:0).
2022-11-13 15:30:48.111 ERROR (MainThread) [homeassistant.config] Package sensor_rest_gas_price_kw setup failed. Integration rest cannot be merged. Expected a dict. (See /config/packages/systems/octopus_agile/sensor_rest_gas_price_kw.yaml:0).
2022-11-13 15:30:48.113 ERROR (MainThread) [homeassistant.config] Package sensor_rest_gas_price_m3 setup failed. Integration rest cannot be merged. Expected a dict. (See /config/packages/systems/octopus_agile/sensor_rest_gas_price_m3.yaml:0).
2022-11-13 15:30:48.115 ERROR (MainThread) [homeassistant.config] Package sensor_rest_import_price setup failed. Integration rest cannot be merged. Expected a dict. (See /config/packages/systems/octopus_agile/sensor_rest_import_price.yaml:0).
2022-11-13 15:30:48.116 ERROR (MainThread) [homeassistant.config] Package sensor_rest_import_price_pounds setup failed. Integration rest cannot be merged. Expected a dict. (See /config/packages/systems/octopus_agile/sensor_rest_import_price_pounds.yaml:0).
2022-11-13 15:30:56.022 ERROR (MainThread) [homeassistant.config] Package solarman_sensors setup failed. Integration rest cannot be merged. Expected a dict. (See /config/packages/systems/sofar_battery_inverter/solarman_sensors.yaml:0).
2022-11-13 15:30:57.022 ERROR (MainThread) [homeassistant.config] Package sensor_rest_myenergi setup failed. Integration rest cannot be merged. Expected a dict. (See /config/packages/systems/myenergi/general_files/sensor_rest_myenergi.yaml:6).
2022-11-13 15:30:57.024 ERROR (MainThread) [homeassistant.config] Package sensor_rest_myenergi_cmt setup failed. Integration rest cannot be merged. Expected a dict. (See /config/packages/systems/myenergi/general_files/sensor_rest_myenergi_cmt.yaml:6).
Any idea what it means about being merged? currently my HA setup is compartmentalized in to /config/packages/systems with separate folders for items to give clarity, something like this: