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
73.9k stars 30.97k forks source link

Hydrawise Binary Sensor error #77087

Closed CasaTepeji closed 1 year ago

CasaTepeji commented 2 years ago

The problem

My configuration section was not changed, today i receive this

Error while setting up hydrawise platform for binary_sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform await asyncio.shield(task) File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/src/homeassistant/homeassistant/components/hydrawise/binary_sensor.py", line 64, in setup_platform HydrawiseBinarySensor(hydrawise.current_controller, BINARY_SENSOR_STATUS) File "/usr/src/homeassistant/homeassistant/components/hydrawise/init.py", line 96, in init self._attr_name = f"{self.data['name']} {description.name}" TypeError: list indices must be integers or slices, not str

What version of Home Assistant Core has the issue?

2022.8.6

What was the last working version of Home Assistant Core?

2022.7

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Hydrawise

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

Hey there @ptcryan, mind taking a look at this issue as it has been labeled with an integration (hydrawise) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)


hydrawise documentation hydrawise source (message by IssueLinks)

raregtp commented 1 year ago

I'm also experiencing this exact error......researching but so far no luck.

richlawson commented 1 year ago

I just noticed this issue as well with the exact same error.

raregtp commented 1 year ago

Looking through the code but so far nothing jumping out at me. That said, I'm quite rusty.....however looking at when this was reports (August 20th), I don't see any commits around that time that look to have done anything. Also, my sprinker controller was a new install at the beginning of October, so I don't have a time in HA when it was working to compare against. Has your install been working previously??

richlawson commented 1 year ago

My integration had been running for a few years without any issues. This is something that had to have happened after I turned off my sprinklers for the winter on Saturday, October 8th, because I know I checked the sensors as I was unscheduling everything.

I was about to say that since I have a bunch of broken zones on one of the views of my dashboard, I was pretty sure that I would have noticed that this broke pretty quickly. That got me thinking that there might have been a problem with the Hydrawise API, and sure enough, when I restarted HA (I had tried this earlier as well), my binary sensors are now working and the error from initial integration setup at HA startup is now gone.

Is yours now working @raregtp?

raregtp commented 1 year ago

Hmmm....let me check. Been playing with the API....the customerdetails.php query errored out the very first time I was using it.....I was suspecting that HA was querying it too fast so set the scan_interval option to 300 seconds, just to ensure I wasn't making more than 5 calls in 5 minutes (default scan_interval is 30 seconds). Since I've made that change I don't yet have an error in my HA logs.....so going to see if I can see my sensors now. Standby.....

raregtp commented 1 year ago

Well....mine is working now as well!! Going to revert the scan_interval setting and restart and see if it breaks again......

raregtp commented 1 year ago

Must have been an API issue......I'm back to the same config I've been fighting with most of the night and now everything is working normally. Strange.....

txwindsurfer commented 1 year ago

I started seeing this error a few days ago after a reboot. The error persisted even after reading these posts and rebooting several times. I added the scan_interval: 300 parameter as suggested by @raregtp and the error was eliminated and api responded. Posting in case adding this parameter could help you also.

raregtp commented 1 year ago

Yep..... I've had to add the scan interval back in... Currently set for 90 seconds, but not sure it's working.... Will have to check later. In the API docs it does say that you can't have more than 5 requests in 5 minutes..... Considering the default scan interval is 30 is why I started experimenting with this setting. The API docs for API 1.4 states this and everytime I've had an issue, when I query https://api.hydrawise.com/api/v1/statusschedule.php?api_key=, I get an error about too many requests. When it's working in HA, that query also works without an error.

txwindsurfer commented 1 year ago

@ptcryan. There seems to be a new occurrence of this issue #77087. The issue based on the thread started 3 days ago. I was able to get the integration to load yesterday but when I restarted HA today the hydrawise error about needing an int not str appears again. The api http query however works just fine so I don't think this is a time out error or an api error. Something else must be wrong. If I remove the hydrawise platform from binary_sensor in my config file, I don't get the error but the integration fails to load sensors and switches. Any assistance would be very much appreciated

eduardkirkosa commented 1 year ago

Same here:

Logger: homeassistant.components.binary_sensor Source: components/hydrawise/init.py:96 Integration: Binary sensor (documentation, issues) First occurred: December 8, 2022 at 4:23:13 PM (1 occurrences) Last logged: December 8, 2022 at 4:23:13 PM

Error while setting up hydrawise platform for binary_sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform await asyncio.shield(task) File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/src/homeassistant/homeassistant/components/hydrawise/binary_sensor.py", line 64, in setup_platform HydrawiseBinarySensor(hydrawise.current_controller, BINARY_SENSOR_STATUS) File "/usr/src/homeassistant/homeassistant/components/hydrawise/init.py", line 96, in init self._attr_name = f"{self.data['name']} {description.name}" TypeError: list indices must be integers or slices, not str

raregtp commented 1 year ago

I've been monitoring mine....as long as I keep my scan interval in my configuration.yaml set to 120 second or more, I don't have any issues with the customerdetails API query erroring out and I don't have any errors in my HA logs regarding the binary sensor. I would stop short of saying I'm 100% on this.....need more time to monitor, but so far it's become fairly predictable.

issue-triage-workflows[bot] commented 1 year 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 has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.