core: Intermittent issue when activating Doorbird relay
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:
alias: Gate Button
description: ""
trigger:
- platform: device
domain: mqtt
device_id: b3bf4b3170cb8d4f347a203bd1d76430
type: action
subtype: single
condition:
- condition: time
after: "07:00:00"
before: "20:00:00"
action:
- device_id: 95eb710efa81754c8cf60b2442fe9e57
domain: button
entity_id: cf84f0e45e42e298b6b195e31bbfebb5
type: press
mode: single
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):
File "/usr/src/homeassistant/homeassistant/components/doorbird/button.py", line 81, in press
self.entity_description.press_action(self._door_station.device, self._relay)
File "/usr/src/homeassistant/homeassistant/components/doorbird/button.py", line 30, in <lambda>
press_action=lambda device, relay: device.energize_relay(relay),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/doorbirdpy/__init__.py", line 78, in energize_relay
data = self._get_json(
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/doorbirdpy/__init__.py", line 321, in _get_json
return response.json()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 978, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
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
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (17 by maintainers)
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.
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.