Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid config after updating to version 2022.1.0 #49

Closed
miguelpucela opened this issue Jan 17, 2022 · 9 comments
Closed

Invalid config after updating to version 2022.1.0 #49

miguelpucela opened this issue Jan 17, 2022 · 9 comments

Comments

@miguelpucela
Copy link

Describe the bug
Errors after update to 2022.1.0

To Reproduce

  1. Update Irrigation_unlimietd with HACS.
  2. Restart HA.

Expected behavior
No errors notification, as usually.

Additional context

The notification:

The following integrations and platforms could not be set up:
irrigation_unlimited
Please check your config and logs.

And the logs gives three errors with this information:

Error adding entities for domain irrigation_unlimited with platform irrigation_unlimited
11:46:09 – (ERROR) Irrigation Unlimited (custom integration)
Logger: custom_components.irrigation_unlimited
Source: custom_components/irrigation_unlimited/entity.py:111
Integration: Irrigation Unlimited (documentation, issues)
First occurred: 11:46:09 (1 occurrences)
Last logged: 11:46:09
Error adding entities for domain irrigation_unlimited with platform irrigation_unlimited
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 747, in add_to_platform_finish
await self.async_added_to_hass()
File "/config/custom_components/irrigation_unlimited/entity.py", line 111, in async_added_to_hass
data = IUAdjustment(zne[ATTR_ADJUSTMENT]).to_dict()
KeyError: 'adjustment'

Error during setup of component irrigation_unlimited
11:46:09 – (ERROR) Irrigation Unlimited (custom integration)
Logger: homeassistant.setup
Source: custom_components/irrigation_unlimited/entity.py:111
Integration: Irrigation Unlimited (documentation, issues)
First occurred: 11:46:09 (1 occurrences)
Last logged: 11:46:09
Error during setup of component irrigation_unlimited
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 229, in _async_setup_component
result = await task
File "/config/custom_components/irrigation_unlimited/init.py", line 251, in async_setup
await component.async_add_entities([IUComponent(coordinator)])
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 747, in add_to_platform_finish
await self.async_added_to_hass()
File "/config/custom_components/irrigation_unlimited/entity.py", line 111, in async_added_to_hass
data = IUAdjustment(zne[ATTR_ADJUSTMENT]).to_dict()
KeyError: 'adjustment'

Exception in <file.irrigation_unlimited_service_shim.irrigation_unlimited_list_config> line 39: data = json.loads(irrigation_unlimited.coordinator.configuration) ^ AttributeError: 'StateVal' object has no attribute 'configuration'
11:46:51 – (ERROR) Pyscript Python scripting (custom integration) - message first occurred at 11:46:49 and shows up 2 times
Logger: custom_components.pyscript.file.irrigation_unlimited_service_shim.irrigation_unlimited_list_config
Source: custom_components/pyscript/eval.py:480
Integration: Pyscript Python scripting (documentation, issues)
First occurred: 11:46:49 (2 occurrences)
Last logged: 11:46:51
Exception in <file.irrigation_unlimited_service_shim.irrigation_unlimited_list_config> line 39: data = json.loads(irrigation_unlimited.coordinator.configuration) ^ AttributeError: 'StateVal' object has no attribute 'configuration'

@bojo-4-sho
Copy link

Jumping in just for a "me too" comment. Was just about to open my own issue after not finding any relevant information on forums or past issues. Everything was working well until I updated and restarted home assistant core.

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 747, in add_to_platform_finish
await self.async_added_to_hass()
File "/config/custom_components/irrigation_unlimited/entity.py", line 111, in async_added_to_hass
data = IUAdjustment(zne[ATTR_ADJUSTMENT]).to_dict()
KeyError: 'adjustment'

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 229, in _async_setup_component
result = await task
File "/config/custom_components/irrigation_unlimited/init.py", line 251, in async_setup
await component.async_add_entities([IUComponent(coordinator)])
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 747, in add_to_platform_finish
await self.async_added_to_hass()
File "/config/custom_components/irrigation_unlimited/entity.py", line 111, in async_added_to_hass
data = IUAdjustment(zne[ATTR_ADJUSTMENT]).to_dict()
KeyError: 'adjustment'

My Config

irrigation_unlimited:
  controllers:
    - name: 'My Config'
      entity_id: 'switch.retic_enable'
      enabled: true
      zones:
        - name: "Front lawn"
          entity_id: "switch.retic_for_front_lawn"
          zone_id: 1
        - name: "Roses"
          entity_id: "switch.retic_for_roses"
          zone_id: 2
        - name: "Back lawn 1"
          entity_id: "switch.retic_for_back_lawn_1"
          zone_id: 3
        - name: "Back lawn 2"
          entity_id: "switch.retic_for_back_lawn_2"
          zone_id: 4
        - name: "Garden"
          entity_id: "switch.retic_for_garden"
          zone_id: 5
        - name: "Back Lawn 3"
          entity_id: "switch.reticback3"
          zone_id: 6
        - name: "Pit"
          entity_id: "switch.reticpit"
          zone_id: 7
      sequences:
        - delay: "00:01"
          name: Morning Watering
          schedules:
            - name: "Sunrise"
              time:
                sun: "sunrise"
                after: "00:15"
              weekday:
                - tue
                - sat
              month: [jan, feb, mar, apr, may, sep, oct, nov, dec]
          zones:
            - zone_id: 1
              duration: "00:30"
            - zone_id: 2
              duration: "00:13"
            - zone_id: 3
              duration: "00:12"
            - zone_id: 4
              duration: "00:08"
            - zone_id: 6
              duration: "00:14"
            - zone_id: 7
              duration: "00:08"
        - name: Afternoon Watering
          delay: "00:01"
          schedules:
            - name: "Sunset"
              time:
                sun: "sunset"
                before: "01:00"
              weekday:
                - tue
                - thu
                - sat
              month: [jan, feb, mar, apr, may, sep, oct, nov, dec]
          zones:
            - zone_id: 5
              duration: "00:05"
            - zone_id: 7
              duration: "00:10"
        - name: Everyday
          delay: "00:01"
          schedules:
            - name: "Watering In"
              time: '10:00'
              weekday:
                - mon
                - wed
                - thu
                - sun
              month: [jan, feb, mar, apr, may, sep, oct, nov, dec]
          zones:
            - zone_id: 6
              duration: "00:05"
            - zone_id: 7
              duration: "00:04"

@miguelpucela
Copy link
Author

Here it's mine in case is useful for debugging:

  granularity: 10
  refresh_interval: 30
  controllers:
    - name: 'Riego pueblo'
      enabled: true
      zones:
       - name: 'Zona 1'
         enabled: true
         minimum: '00:00'
         maximum: '00:14'
         entity_id: 'switch.sonoff_1000caee2_1'
       - name: 'Zona 2'
         enabled: true
         minimum: '00:00'
         maximum: '00:14'
         entity_id: 'switch.sonoff_1000caee2_2'
       - name: 'Zona 3'
         entity_id: 'switch.sonoff_1000caee2_3'
         enabled: true
         minimum: '00:00'
         maximum: '00:14'
      sequences:
        - name: 'Secuencia pueblo'
          duration: '00:06'
          delay: '00:01'
          schedules:
            - name: 'Amanecer'
              time:
                sun: 'sunrise'
                after: '00:00'
              month: [mar, apr, may, jun, jul, aug, sep]
            - name: 'Después del anochecer'
              time:
                sun: 'sunset'
                after: '01:00'
              month: [mar, apr, may, jun, jul, aug, sep]
          zones:
            - zone_id: [1,2]
              duration: '00:04'
            - zone_id: 1
              duration: '00:02'
            - zone_id: 2
              duration: '00:02'
            - zone_id: 3
              # duration: '00:06'
    - name: 'Riego Pinar'
      entity_id: 'switch.sonoff_1000aa7c2'
      enabled: true
      zones:
       - name: 'Zona 1'
         enabled: true
         minimum: '00:00'
         maximum: '00:19'
         entity_id: 'switch.sonoff_1001330c3_1'
       - name: 'Zona 2'
         enabled: true
         minimum: '00:00'
         maximum: '00:19'
         entity_id: 'switch.sonoff_1001330c3_2'
       - name: 'Zona 3'
         entity_id: 'switch.sonoff_1001330c3_3'
         enabled: false
         minimum: '00:00'
         maximum: '00:19'
       - name: 'Zona 4'
         entity_id: 'switch.sonoff_1001330c3_4'
         enabled: false
         minimum: '00:00'
         maximum: '00:19'
      sequences:
        - name: 'Secuencia Pinar'
          duration: '00:08'
          delay: '00:01'
          schedules:
            - name: 'Después del amanecer'
              time:
                sun: 'sunrise'
                after: '00:30'
              month: [mar, apr, may, jun, jul, aug, sep]
            - name: 'Media noche'
              time: '00:00'
                # sun: 'sunset'
                # after: '00:30'
              month: [mar, apr, may, jun, jul, aug, sep]
          zones:
            - zone_id: 1
            - zone_id: [2,3]            

@rgc99 rgc99 closed this as completed in 4a4ff08 Jan 17, 2022
@rgc99
Copy link
Owner

rgc99 commented Jan 17, 2022

Please update to 2022.1.1. Small problem when attempting to restore the adjustments on a first run.

Interesting. Pushed a change with a description of "Fix #49" and GitHub closed the issue automatically. I will keep it open for comment.

@rgc99 rgc99 reopened this Jan 17, 2022
@miguelpucela
Copy link
Author

Still there are errors after update. Here are the logs:

This error originated from a custom integration.

Logger: custom_components.irrigation_unlimited
Source: custom_components/irrigation_unlimited/entity.py:137
Integration: irrigation_unlimited (documentation, issues)
First occurred: 23:19:39 (1 occurrences)
Last logged: 23:19:39

Error adding entities for domain irrigation_unlimited with platform irrigation_unlimited
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 747, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/irrigation_unlimited/entity.py", line 137, in async_added_to_hass
    for sequence_zone in sequence[CONF_SEQUENCE_ZONES]:
KeyError: 'sequence_zones'
This error originated from a custom integration.

Logger: homeassistant.setup
Source: custom_components/irrigation_unlimited/entity.py:137
Integration: irrigation_unlimited (documentation, issues)
First occurred: 23:19:39 (1 occurrences)
Last logged: 23:19:39

Error during setup of component irrigation_unlimited
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 229, in _async_setup_component
    result = await task
  File "/config/custom_components/irrigation_unlimited/__init__.py", line 251, in async_setup
    await component.async_add_entities([IUComponent(coordinator)])
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 747, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/irrigation_unlimited/entity.py", line 137, in async_added_to_hass
    for sequence_zone in sequence[CONF_SEQUENCE_ZONES]:
KeyError: 'sequence_zones'
This error originated from a custom integration.

Logger: custom_components.pyscript.file.irrigation_unlimited_service_shim.irrigation_unlimited_list_config
Source: custom_components/pyscript/eval.py:480
Integration: Pyscript Python scripting (documentation, issues)
First occurred: 23:19:53 (2 occurrences)
Last logged: 23:19:54

Exception in <file.irrigation_unlimited_service_shim.irrigation_unlimited_list_config> line 39: data = json.loads(irrigation_unlimited.coordinator.configuration) ^ AttributeError: 'StateVal' object has no attribute 'configuration'

@rgc99
Copy link
Owner

rgc99 commented Jan 18, 2022

Please update to 2022.1.2 - This is in the same area when restoring the previous state but further down. Installed some crash barriers so at least whatever goes wrong will be reported and not die. Tightened up a bunch of code to deal with missing data. Finally some tests for dodgy data.

The last error above is a consequence of the first two. It should resolve itself.

Thanks for your help.

@bojo-4-sho
Copy link

Can confirm everything has at least started back up and no errors in my log after 2022.1.2. My evening schedule should run later tonight for confirmation but I suspect its all fixed up now.

Thanks @rgc99

@miguelpucela
Copy link
Author

Same here. No errors in log after update to 2022.1.2.

Thank you!

@rgc99
Copy link
Owner

rgc99 commented Jan 20, 2022

Great, thanks for the feedback and your help.

@miguelpucela
Copy link
Author

I think you can close this issue now. :)

@rgc99 rgc99 closed this as completed Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants