irrigation_unlimited icon indicating copy to clipboard operation
irrigation_unlimited copied to clipboard

Unable to toggle controller/zone after upgrade to HA 2022.6

Open stomko11 opened this issue 2 years ago • 12 comments

I noticed I am no longer able to disable zone/controller (nor enable or toggle) after upgrading to HA 2022.6 when calling the service, or when taping on the icon in the irrigation card. Reverting back to 2022.5.5 - all is working as expected

To Reproduce

  1. call appropriate service. Service seems to run OK (green check) yet no result. Zones are enabled (seem that way) yet don't show any active schedules

Expected behavior Zone/controller should be disabled, or enabled and show next run time.

Screenshots image

Desktop (please complete the following information):

  • OS: 2022.6

Additional context Following logs are observed in HA:

Logger: homeassistant
Source: util/async_.py:168
First occurred: 2:37:09 PM (78 occurrences)
Last logged: 2:43:19 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/irrigation_unlimited/irrigation_unlimited.py", line 3986, in _async_timer
    self.timer(atime)
  File "/config/custom_components/irrigation_unlimited/irrigation_unlimited.py", line 3982, in timer
    self.poll_main(atime)
  File "/config/custom_components/irrigation_unlimited/irrigation_unlimited.py", line 3969, in poll_main
    self.poll(atime, force)
  File "/config/custom_components/irrigation_unlimited/irrigation_unlimited.py", line 3957, in poll
    if self.muster(wtime, force) != 0:
  File "/config/custom_components/irrigation_unlimited/irrigation_unlimited.py", line 3915, in muster
    self._history.muster(stime, entity_ids, force)
  File "/config/custom_components/irrigation_unlimited/history.py", line 142, in muster
    data = history.get_significant_states(
  File "/usr/src/homeassistant/homeassistant/components/recorder/history.py", line 171, in get_significant_states
    return get_significant_states_with_session(
  File "/usr/src/homeassistant/homeassistant/components/recorder/history.py", line 288, in get_significant_states_with_session
    states = execute_stmt_lambda_element(
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 188, in execute_stmt_lambda_element
    executed = session.execute(stmt)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 1711, in execute
    conn = self._connection_for_bind(bind)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 1552, in _connection_for_bind
    return self._transaction._connection_for_bind(
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 747, in _connection_for_bind
    conn = bind.connect()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/future/engine.py", line 406, in connect
    return super(Engine, self).connect()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 3234, in connect
    return self._connection_cls(self, close_with_result=close_with_result)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 96, in __init__
    else engine.raw_connection()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 3313, in raw_connection
    return self._wrap_pool_connect(self.pool.connect, _connection)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 3280, in _wrap_pool_connect
    return fn()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/impl.py", line 382, in connect
    return _ConnectionFairy._checkout(self, self._fairy)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 868, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 476, in checkout
    rec = pool._do_get()
  File "/usr/src/homeassistant/homeassistant/components/recorder/pool.py", line 75, in _do_get
    check_loop(
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 168, in check_loop
    raise RuntimeError(
RuntimeError: Blocking calls must be done in the executor or a separate thread; Use homeassistant.components.recorder.get_instance(hass).async_add_executor_job(); at homeassistant/components/recorder/pool.py, line 75: check_loop(

stomko11 avatar Jun 02 '22 12:06 stomko11

Hi, I have the problem too.

sohnvonoff avatar Jun 02 '22 14:06 sohnvonoff

Had to go back to 2022.5 as well.

ielbury avatar Jun 02 '22 20:06 ielbury

This is probably due to the HA history work, which, I get, but gee whiz guys. This issue is most likey solved with some recent updates to the repository. The changes have been under test for a few weeks now and look solid. Problem is I am away from my development machine for a bit.

Can someone do a manual install from the repo. Basically replace the files in custom_components/irrigation_unlimited with the ones from the repository. Don't worry about HACS as it will just update when officially released. Any problems just reinstall. Let me know and I can push out an update.

Thanks to all.

rgc99 avatar Jun 02 '22 21:06 rgc99

Hey Robert, my apologies for being presumptuous. I installed the latest a greatest from GitHub and all seems to work fine.

Other things are not working such as Synology but all I care about is keeping the wife happy 🤔

Just have to say, awesome product you have developed here and many thanks!

ielbury avatar Jun 02 '22 21:06 ielbury

Hi Robert. I confirm too that using the repository files, everything is working as expected. Thanks Simone

bassguitarist avatar Jun 02 '22 21:06 bassguitarist

Same problem here

korbendallas78 avatar Jun 03 '22 05:06 korbendallas78

Updated /config/custom_components/irrigation_unlimited from repo and deleted "_pycache_". OK - again after HA restart. Many Thanks

sohnvonoff avatar Jun 03 '22 08:06 sohnvonoff

+1 a huge Thanks !

Veher-el avatar Jun 03 '22 11:06 Veher-el

Updated /config/custom_components/irrigation_unlimited from repo and deleted "pycache". OK - again after HA restart. Many Thanks

If I delete _pycache, can't restart HA because config file error. Not found irrigation unlimited

korbendallas78 avatar Jun 03 '22 11:06 korbendallas78

Same problem.

dmaciaszek avatar Jun 03 '22 17:06 dmaciaszek

It is now officially released as 2022.6.0. Should come through soon via HACS.

This following is text from the release notes about a config file error. It would be better to correct the zone_id: before updating.

If you get a configuration error after upgrading then check any zone_id: in the config. The id must conform to 'snake_case' style with the exception the first character can be a number. This means only lower case, numbers and the underscore characters can be used. It cannot start or end with an underscore and no more than one together. Valid id's are my_garden, front_lawn, rose_bed, 1. Some invalid examples are Front_Lawn, front__lawn, _front_lawn. You should have been getting warning messages in the previous release but now it is enforced. There is a good reason for this to be explained later but I thank you for your understanding in the meantime.

Wasn't supposed to be this way but got caught between a rock and a hard place.

rgc99 avatar Jun 04 '22 02:06 rgc99

Everything seems to be working great after update.

Thanks!

miguelpucela avatar Jun 05 '22 12:06 miguelpucela