Sensor - Integration 'jemenaoutlook' not found

Hi,

I’m new to Homeassistant. Installed HA on Synology Docker as container over the weekend.
Trying to add custom sensor of jemenaoutlook from https://github.com/mvandersteen/ha-jemenaoutlook.

Homeassistant volume mapping
/volume1/docker/Homeassistant/config:/config

---- sensors file locations on host is as below: —

/volume1/docker/Homeassistant/config/custom_components/jemenaoutlook/__init__.py`
/volume1/docker/Homeassistant/config/custom_components/jemenaoutlook/manifest.py
/volume1/docker/Homeassistant/config/custom_components/jemenaoutlook/sensor.py

------ content of /volume1/docker/Homeassistant/config/configuration.yaml is as follow -----------

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor:
  - platform: jemenaoutlook
    username: MYEMAIL
    password: MYPASSWORD
    monitored_variables:
       - this_week_usage
       - this_week_consumption

--------logs error message as below when try to restart HA from HA Settings Server control----

2021-10-04 13:43:57 ERROR (MainThread) [homeassistant.components.homeassistant] The system cannot restart because the configuration is not valid: Platform error sensor.jemenaoutlook - Integration ‘jemenaoutlook’ not found.
2021-10-04 13:43:57 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139886257490768] The system cannot restart because the configuration is not valid: Platform error sensor.jemenaoutlook - Integration ‘jemenaoutlook’ not found.
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py”, line 185, in handle_call_service
await hass.services.async_call(
File “/usr/src/homeassistant/homeassistant/core.py”, line 1492, in async_call
task.result()
File “/usr/src/homeassistant/homeassistant/core.py”, line 1527, in _execute_service
await handler.job.target(service_call)
File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 728, in admin_handler
await result
File “/usr/src/homeassistant/homeassistant/components/homeassistant/init.py”, line 171, in async_handle_core_service
raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: The system cannot restart because the configuration is not valid: Platform error sensor.jemenaoutlook - Integration ‘jemenaoutlook’ not found.

couldn’t figure out where I did wrong?
Any suggestions would be appreciated!!

Do you have any other sensors in configuration,yaml? If not I think you should remove the - from in front of the jemenaoutlook line (and take out two of the spaces in every line from then onwards)

sensor:
  platform: jemenaoutlook
  username: MYEMAIL etc

Nope, I don’t think sensor being a list (-) is the problem.

I think it is because the custom integration was added, but it hasn’t been loaded yet (there hasn’t been a restart). Configuration check fails because it is referring to the new integration.
Comment out (or remove) the sensor in your configuration.yaml, reboot and add it back in. It should pass configuration check and you should be able to reboot after this.

if I remove ‘-’ as you suggested, restart will get below error messages.

2021-10-04 17:18:12 ERROR (SyncWorker_1) [homeassistant.util.yaml.loader] mapping values are not allowed here
in “/config/configuration.yaml”, line 15, column 13
2021-10-04 17:18:12 ERROR (MainThread) [homeassistant.components.homeassistant] The system cannot restart because the configuration is not valid: Error loading /config/configuration.yaml: mapping values are not allowed here
in “/config/configuration.yaml”, line 15, column 13
2021-10-04 17:18:12 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140494826454224] The system cannot restart because the configuration is not valid: Error loading /config/configuration.yaml: mapping values are not allowed here
in “/config/configuration.yaml”, line 15, column 13
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py”, line 185, in handle_call_service
await hass.services.async_call(
File “/usr/src/homeassistant/homeassistant/core.py”, line 1492, in async_call
task.result()
File “/usr/src/homeassistant/homeassistant/core.py”, line 1527, in _execute_service
await handler.job.target(service_call)
File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 728, in admin_handler
await result
File “/usr/src/homeassistant/homeassistant/components/homeassistant/init.py”, line 171, in async_handle_core_service
raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: The system cannot restart because the configuration is not valid: Error loading /config/configuration.yaml: mapping values are not allowed here
in “/config/configuration.yaml”, line 15, column 13

Hi ondras12345,

I did what you suggested, comment out sensor section, and reboot the container, it was okay.

And then, remove the # sign comment, the sensor section back in play. I still get the similar error message.

2021-10-04 17:17:05 ERROR (MainThread) [homeassistant.components.homeassistant] The system cannot restart because the configuration is not valid: Platform error sensor.jemenaoutlook - Integration ‘jemenaoutlook’ not found.
2021-10-04 17:17:05 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140494826454224] The system cannot restart because the configuration is not valid: Platform error sensor.jemenaoutlook - Integration ‘jemenaoutlook’ not found.
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py”, line 185, in handle_call_service
await hass.services.async_call(
File “/usr/src/homeassistant/homeassistant/core.py”, line 1492, in async_call
task.result()
File “/usr/src/homeassistant/homeassistant/core.py”, line 1527, in _execute_service
await handler.job.target(service_call)
File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 728, in admin_handler
await result
File “/usr/src/homeassistant/homeassistant/components/homeassistant/init.py”, line 171, in async_handle_core_service
raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: The system cannot restart because the configuration is not valid: Platform error sensor.jemenaoutlook - Integration ‘jemenaoutlook’ not found.

As far a I know, custom integrations that don’t have a version in manifest.json are not loaded anymore. You custom component does not even have a manifest.json.

Create a manifest.json in /volume1/docker/Homeassistant/config/custom_components/jemenaoutlook/
with these contents, and restart HA.

{
  "version" : "1.0.0"
}

It does have a manifest.json actually, but I missed that the poster had misspelled it.

PS I see the integration is installable by HACS. If you had done that, this would have been avoided :slight_smile:

Hi Nickrout,

thanks for the tip.
I copied that manifest.json file and put it under directory /volume1/docker/Homeassistant/config/custom_components/jemenaoutlook/
Now the restart doesn’t complain about integration not found anymore.
that’s an improvement.

But a different error in the log now:

2021-10-04 17:59:12 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1083, in async_forward_entry_setup
    result = await async_setup_component(self.hass, domain, self._hass_config)
  File "/usr/src/homeassistant/homeassistant/setup.py", line 98, in async_setup_component
    return await setup_tasks[domain]  # type: ignore
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1083, in async_forward_entry_setup
    result = await async_setup_component(self.hass, domain, self._hass_config)
  File "/usr/src/homeassistant/homeassistant/setup.py", line 98, in async_setup_component
    return await setup_tasks[domain]  # type: ignore
  File "/usr/src/homeassistant/homeassistant/helpers/discovery.py", line 163, in async_load_platform
    setup_success = await setup.async_setup_component(hass, component, hass_config)
  File "/usr/src/homeassistant/homeassistant/setup.py", line 98, in async_setup_component
    return await setup_tasks[domain]  # type: ignore
  File "/usr/src/homeassistant/homeassistant/setup.py", line 105, in async_setup_component
    return await task  # type: ignore
  File "/usr/src/homeassistant/homeassistant/setup.py", line 215, in _async_setup_component
    processed_config = await conf_util.async_process_component_config(
  File "/usr/src/homeassistant/homeassistant/config.py", line 891, in async_process_component_config
    platform = p_integration.get_platform(domain)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 524, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 529, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 846, in exec_module
  File "<frozen importlib._bootstrap_external>", line 983, in get_code
  File "<frozen importlib._bootstrap_external>", line 913, in source_to_code
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/custom_components/jemenaoutlook/__init__.py", line 7
    <!DOCTYPE html>
    ^
SyntaxError: invalid syntax

You copied the HTML from github, not the raw code !

Click on raw to download

(Or install through HACS)

Hi francisp,

thanks for that, redownloaded the raw file as you pointed out, now it is working. :smile:
simple mistake of Github file download.

gonna start to look for HACS, even though not sure what that is yet, but will look at HA documents online later.

Thanks everyone for your help and your prompt responds. much appreciated!!!