-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Intermittent issue when activating Doorbird relay #122417
Comments
Hey there @oblogic7, @bdraco, @flacjacket, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) doorbird documentation |
I'm almost certain the device is returning a "successful" HTTP status code because doorbirdby calls "Expected value at char 0" means the response was completely empty, which is strange. This weekend I'll try to get some time to set my D101 up with a script that calls that endpoint over and over and logs each response to see if it's a bug in the DoorBird firmware. |
Update: I ran a script that requested The script used cURL directly instead of doorbirdpy, so this points to a bug in the DoorBird firmware. I'm not sure how to handle this going forward, since not knowing whether the relay was energized successfully or not is a problem that should be logged in Home Assistant. |
Doorbird support has been pretty good about escalating bugs. I'd try contacting them next. Let them know you are a developer working on the Home Assistant integration. |
Update: DoorBird support suggested that the device may be auto-rebooting, so it is not online when these requests are sent. I don't believe this is the problem because I'd be seeing a cURL error and not a 200 response, but I have restarted my test with more logging per their request, so we'll see how that goes. |
After more extensive testing (4,181 test requests over 30 days), the device failed to respond to three of them. Two of those failures were "no route to host" and one was "connection refused".
I feel like that should be raising an exception long before it gets to parsing the response as JSON, but it's possible there is a different issue with your device or network that didn't show up in my testing. I do think it's interesting that all of the failures were around the same time (~1am local time), so I asked DoorBird support if the device reboots itself on a schedule, though this seems unlikely to be the cause of the original problem given its (in)frequency. |
If the failures are transient we could wrap the api calls with https://github.com/jd/tenacity |
Tiny update from DoorBird support:
|
Seems like tenacity with a backoff would be the way to go |
@bdraco I've pushed a new version with |
Looks good. Will test shortly. |
I put it on my production and didn't discovery any unexpected behavior. I think its one of those things only time will tell so seems good to release and we can bump it in HA before the next beta so we have a week to revert if it causes any unwanted side effects. |
I pushed it to master and the build failed, so I'll look into it after work today or tomorrow. |
Update: fixed the test, 3.0.6 is now in PyPI. |
The problem
Hello,
I face an intermittent issue when trying to press one of my DoorBird relay using the DoorBird integration.
The following scenario works most of the time:
However, when chaining call (pressing the push button with like a minute or less), nothing happen on the DoorBird and I get weird
Expecting value: line 1 column 1 (char 0)
error in the scenario traces.Here is one that run:
And here one triggered ~8 minutes after and failed:
Here are the relevant logs extracted from home assistant container: traceback.log
I'm suspecting a not handled bad api response returned by the DoorBird device (quota? permission token expiration? trigger safety delay?). Any idea?
What version of Home Assistant Core has the issue?
core-2024.6.1
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
DoorBird
Link to integration documentation on our website
https://www.home-assistant.io/integrations/doorbird/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Something is definitely happening in the
doorbirdpy
library, but not enough informations in the log to conclude (response http code, body, etc):I'll try to edit this file in situ and reproduce the problem to log more details when the error is raised.
Additional information
No response
The text was updated successfully, but these errors were encountered: