Hydrawise not working in 0.106

My Hydrawise (sprinkler monitoring) no longer is loading. This isn’t a custom component, but a regular function of HA. I have a RPi3B+. This worked and loaded fine in previous versions.
Error logs below:

Log Details (ERROR)
Logger: homeassistant.setup
First occured: March 3, 2020, 11:01:53 PM (1 occurences)
Last logged: March 3, 2020, 11:01:53 PM

Error during setup of component hydrawise
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 174, in _async_setup_component
    component.setup, hass, processed_config  # type: ignore
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/hydrawise/__init__.py", line 77, in setup
    hydrawise = Hydrawiser(user_token=access_token)
  File "/usr/local/lib/python3.7/site-packages/hydrawiser/core.py", line 42, in __init__
    self.update_controller_info()
  File "/usr/local/lib/python3.7/site-packages/hydrawiser/core.py", line 65, in update_controller_info
    self.user_id = self.controller_status['user_id']
KeyError: 'user_id'

Thanks.

2 Likes

I’m seeing this also.
https://github.com/home-assistant/core/issues/31957

Seeing this also in 0.107.7. Any idea how this can be fixed or worked arround?

There are some work arounds in the GitHub issue. I haven’t tried any yet though. Mine is still broken

Mine is also not working in 0.108

Unable to set up component (0.109.2)

Is there a primer on how to instruct the component to be more verbose in the logs?

Perhaps it requires SSL, as this new HASS instance has none, there is the following error;

[supervisor.api.proxy] Client error on WebSocket API Cannot connect to host 172.30.32.1:8123 ssl:False [Connection refused].

@ptcryan has worked hard on this.
I hope his pull requests get merged and this this issue will be fixed with the next version of HA.
See:
https://github.com/home-assistant/core/pull/34448
https://github.com/home-assistant/home-assistant.io/pull/13093

So, tat means hopefully in the next update it come bak to working in HA?
If it is working is it possible to see and let work in Home Kit? i mean why not, the is an switch.

Best WIsh

Unfortunately the updated integration has still not made it into HA. But you can install the updated code as a custom component until it becomes officially available. Here is how:

  • You need to download just the files of the hydrawise component from the HA repo of @ptcryan. Unfortunately the author holds a full copy of HA in his repo and GitHub has no way to download subfolders only. So we will use an online helper to do that. Got to http://kinolien.github.io/gitzip/ and copy the following address into the field “GitHub repo root URL or sub-folder URL” in the upper right corner:
    https://github.com/ptcryan/home-assistant/tree/hydrawise_v1_4/homeassistant/components/hydrawise
  • Then press the “download” button. This will download a ZIP file with the latest version of the hydrawise component folder from ptcryan’s repo.
  • Unpack this ZIP into the folder config/custom_components/hydrawise/ of your HA installation. When you’re done, this folder should contain five files: _init_.py, binary_sensor.py, manifest.json, sensor.py, switch.py
  • Restart Home Assistant. The files in the custom_component folder will override the original files that come with HA.

I cannot guarantee that the result will be stable. For me the integration came back to life on HA 0.110.1. But I had some weird spontaneous activations of irrigation circuits. After another restart all seems stable now. But there are still warnings in the logs that the setup of the Hydrawise devices takes too long to init.

1 Like

Hi Jörg,

Many thanks for your detailed work around, I tried this however for me this still doesn’t work.
Any idea what is wrong, I downloaded the files, create a sub-dir as mentioned, restarted the server, but still errors in the log?

2020-05-24 13:21:42 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up hydrawise platform for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/hydrawise/binary_sensor.py", line 37, in setup_platform
    HydrawiseBinarySensor(hydrawise.controller_status, sensor_type)
  File "/usr/src/homeassistant/homeassistant/components/hydrawise/__init__.py", line 120, in __init__
    self._name = f"{self.data['name']} {DEVICE_MAP[self._sensor_type][DEVICE_MAP_INDEX.index('KEY_INDEX')]}"
TypeError: 'NoneType' object is not subscriptable

Br,
Melvin

Hi Melvin,
sorry for replying late. This looks like the custom component is not found at all.
Please check that your folder / file structure looks exactly like this:

/config
    /custom_components
        /hydrawise
            __init__.py
            binary_sensor.py
            manifest.json
            sensor.py
            switch.py

Cheers, Jörg

2 Likes

Whoop whoop! Many thanks Jörg that was the trick I missed the \hydrawise folder, the files were unpacked in the custom_component folder :stuck_out_tongue:

1 Like

Anyone know when this will be fixed?

Jpsy,

Somewhere along the way I read somewhere that we were supposed to take out the dashes for the API key to make this work. At first when I put in the custom component, it failed. I then double checked the API key, put back in the dashes, and all was good. Just in case others followed the same path, I thought I would just push this out as something else to check. Happy to see things back working again and I look forward to it once it hits the main integration branch.

Thanks again - I love this integration.

Michael

Got the custom code in and working straight off. Thanks so much.
A FYI for anyone with long names of the zones. This updated version truncates the zone names if they are longer than about 15 chars. This makes the sensor names change. Shorten the zone names in the Hydrwise web interface and/or re-select your entities to get rid of the errors you might have in lovelace.

1 Like

Anyone been getting a hydrawise: Error on device update! with a bunch of IndexError: list index out of range on startup for sensory, binary_sensor, and switch?

I’m seeing this on 0.116.2. I believe I was seeing it on 0.115 as well.

Full error log:

2020-10-10 14:30:06 ERROR (MainThread) [homeassistant.components.switch] hydrawise: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 346, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 471, in async_device_update
    await self.hass.async_add_executor_job(self.update)  # type: ignore
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/hydrawise/switch.py", line 87, in update
    self._state = (mydata.relays[relay_data]["timestr"] != "") and (
IndexError: list index out of range
2020-10-10 14:30:06 ERROR (MainThread) [homeassistant.components.binary_sensor] hydrawise: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 346, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 471, in async_device_update
    await self.hass.async_add_executor_job(self.update)  # type: ignore
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/hydrawise/binary_sensor.py", line 56, in update
    relay_data = mydata.relays[self.data["relay"] - 1]
IndexError: list index out of range
2020-10-10 14:30:06 ERROR (MainThread) [homeassistant.components.sensor] hydrawise: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 346, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 471, in async_device_update
    await self.hass.async_add_executor_job(self.update)  # type: ignore
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/hydrawise/sensor.py", line 51, in update
    relay_data = mydata.relays[self.data["relay"] - 1]
IndexError: list index out of range
2020-10-10 14:30:07 ERROR (MainThread) [homeassistant.components.switch] hydrawise: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 346, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 471, in async_device_update
    await self.hass.async_add_executor_job(self.update)  # type: ignore
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/hydrawise/switch.py", line 85, in update
    self._state = mydata.relays[relay_data]["timestr"] == "Now"
IndexError: list index out of range
2020-10-10 14:30:07 ERROR (MainThread) [homeassistant.components.sensor] hydrawise: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 346, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 471, in async_device_update
    await self.hass.async_add_executor_job(self.update)  # type: ignore
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/hydrawise/sensor.py", line 51, in update
    relay_data = mydata.relays[self.data["relay"] - 1]
IndexError: list index out of range

I’m getting this error and no idea what to do about it

I was getting the same error that many of you have been getting regarding the update error. I finally went in and adjusted my zone names to be short character length and that solved everything for me and finally updated all of my zones in HA. So for anyone having issues still, truncating the zone names down might be your answer.

In case it helps anyone else:

The IndexError: list index out of range problem I was having was caused by having an empty zone. When my system was installed zone 2 was left for a future use so zones 1, 3, and 4 were used.

The integration can’t handle an unused/disabled zone. If there are 3 zones it expects an array of length 3.

There was an issue on GitHub against the integration that got closed. It didn’t describe the problem very well.

I worked around the problem by re-enabling the unused zone.

Anyone else notice a problem with the next_cycle sensor for each zone is changing with every update?

For me the state keeps changing by +/- 13 seconds roughly every 10 seconds:

It’s flooding the history database.