home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.45k stars 29.38k forks source link

Home assistant delete all automations after editing and saving one. #23722

Closed rengaboy closed 4 years ago

rengaboy commented 5 years ago

Home Assistant release with the issue:

0.91.3

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.):

hassbian

Component/platform:

Description of problem: After editing and saving one automation homeassiastant showed this only one automation in lovelace three times. All other automations was gone in automations.yaml. After restart nothing has changed.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

Traceback (if applicable):

2019-05-06 21:00:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.svet_prikhozhaia'
2019-05-06 21:00:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.uvedomleniia_treker'
2019-05-06 21:00:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.dolit_uvlazhniteli'
2019-05-06 21:00:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.foto_otkrytie_dveri'
2019-05-06 21:00:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.set_target_humidity'
2019-05-06 21:00:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.bathroom_vent_toggle'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.motion_enter_light_on'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.light_off_when_nobody_at_home'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.motion_enter_light_off'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.smena_temy'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.gostinaia_knopka_lenta'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.spalnia_knopka_nochnik'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.polit_tsvetok'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.vykliuchit_ves_svet'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.gostinaia_knopka_spot'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.humidifiers_toggle'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.gostinaia_knopka_svet'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.otkryta_balkonnaia_dver'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.spalnia_knopka_svet'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.spalnia_nochnik_vkliuchenie_vecher'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.otkryta_balkonnaia_dver'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.spalnia_knopka_nochnik'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.foto_otkrytie_dveri'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.spalnia_knopka_svet'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.light_off_when_nobody_at_home'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.motion_enter_light_off'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.bathroom_vent_toggle'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.set_target_humidity'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.vykliuchit_ves_svet'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.spalnia_nochnik_vkliuchenie_vecher'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.gostinaia_knopka_lenta'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.gostinaia_knopka_spot'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.dolit_uvlazhniteli'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.smena_temy'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.motion_enter_light_on'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.gostinaia_knopka_svet'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.humidifiers_toggle'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.svet_prikhozhaia'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.uvedomleniia_treker'
2019-05-06 21:00:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 390, in async_remove_entity
    await self.entities[entity_id].async_remove()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 396, in async_remove
    await self.async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 300, in async_will_remove_from_hass
    await super().async_will_remove_from_hass()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 203, in async_will_remove_from_hass
    data.async_restore_entity_removed(self.entity_id)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 183, in async_restore_entity_removed
    self.entity_ids.remove(entity_id)
KeyError: 'automation.polit_tsvetok'
2019-05-06 21:03:09 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 147, in async_dump_states
    for stored_state in self.async_get_stored_states()])
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 147, in <listcomp>
    for stored_state in self.async_get_stored_states()])
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/restore_state.py", line 43, in as_dict
    'state': self.state.as_dict(),
AttributeError: 'NoneType' object has no attribute 'as_dict'

Additional information:

rengaboy commented 5 years ago

Traceback after restarting:

2019-05-06 21:16:19 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/storage.py", line 163, in _async_callback_delayed_write
    await self._async_handle_write_data()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/storage.py", line 175, in _async_handle_write_data
    if 'data_func' in data:
TypeError: argument of type 'NoneType' is not iterable
OttoWinter commented 5 years ago

Did you mess with the .storage folder somehow?

Could the device be out of storage space on the drive where the config is stored?

outadoc commented 5 years ago

Happened to me too on 0.93.1. Didn't mess with anything manually, and I successfully saved a few other automations before this happened.

Only got this in the log: remove:Group 'all_automations' doesn't exist!

Boy am I glad I just made a complete config backup. 😨

stale[bot] commented 5 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.