-
-
Notifications
You must be signed in to change notification settings - Fork 32k
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
Bluetooth Manager Callback error MotionDirection #108087
Comments
Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) bluetooth documentation |
Hey there @Danielhiversen, @RenierM26, @murtas, @Eloston, @dsypniewski, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) switchbot documentation |
(maybe cc @dcmeglio because you checked out something with this that's in the next release) |
This looks like code for the blind tilt device, I was working on the Curtain device. Unfortunately I don't have a Tilt to test with. |
Does it maybe look familiar to the curtain way of working? Could there be a moment where we could not get the position of the device? |
Don't think so, but a theory - https://github.com/Danielhiversen/pySwitchbot/blob/9a36e4ee5934f0fb3f67ad25e6472b3796d346af/switchbot/devices/blind_tilt.py#L106 is the only reference I see to motionDirection. The only time it's not is on line 84, https://github.com/Danielhiversen/pySwitchbot/blob/9a36e4ee5934f0fb3f67ad25e6472b3796d346af/switchbot/devices/blind_tilt.py#L84 if that if statement triggers, we're accessing a null object. Same issue might exist for curtains, but wouldn't blow up since we're not dereferencing a null object. I can't see any harm in adding a check for I'll play around with my curtains too later today to see if I can get the scenario to return None. |
I haven't been able to reproduce it, but digging through the code pyswitchbot should log @c0nt4x do you see that in the logs? |
@dcmeglio Unfortunately, I suffered issues yesterday with my Homeassistant so had to reload a previous backup so am unable to check the logs for when I first saw this issue. I've checked the logs for today and cannot see |
Exactly same error log happening here as OP. Same Home Assistant OS setup but on 2024.1.2 (Same error has been around at least from 2023.10.1 or before) |
@glbailey Do you see the log entry I asked about? |
No sign at all of "Unsuccessful, please try again" in any of the logs, only the error message the OP showed. |
When this happens, what is the current position set to? By any chance is it set to Unknown? |
I've been having this a lot lately. First automation will run and then this error happens and I have to reboot the HA VM to get it to work again. Of note, this just happens randomly during the day (like today at noon) when no automation would run. I do sunrise and sunset routines.
|
Switched to the HA Green yesterday evening for fun. Same random issues. 9pm last night the issue happened on the Green. Last blind adjustment was 635pm. Seems like an issue just idly pinging the devices and then cascading into a problem where BT won't work when an automation calls later down the line. |
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. |
The problem
Had this error in the logs a numerous times over the last few days
What version of Home Assistant Core has the issue?
2024.1.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Bluetooth
Link to integration documentation on our website
https://www.home-assistant.io/integrations/bluetooth
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Logger: homeassistant.components.bluetooth.manager Source: components/bluetooth/manager.py:109 Integration: Bluetooth (documentation, issues) First occurred: 11:57:01 AM (1 occurrences) Last logged: 11:57:01 AM Error in bluetooth callback Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/bluetooth/manager.py", line 109, in _discover_service_info callback(service_info, BluetoothChange.ADVERTISEMENT) File "/usr/src/homeassistant/homeassistant/components/switchbot/coordinator.py", line 114, in _async_handle_bluetooth_event super()._async_handle_bluetooth_event(service_info, change) File "/usr/src/homeassistant/homeassistant/components/bluetooth/active_update_coordinator.py", line 163, in _async_handle_bluetooth_event super()._async_handle_bluetooth_event(service_info, change) File "/usr/src/homeassistant/homeassistant/components/bluetooth/passive_update_coordinator.py", line 89, in _async_handle_bluetooth_event self.async_update_listeners() File "/usr/src/homeassistant/homeassistant/components/bluetooth/passive_update_coordinator.py", line 51, in async_update_listeners update_callback() File "/usr/src/homeassistant/homeassistant/components/switchbot/cover.py", line 188, in _handle_coordinator_update self._attr_is_opening = self.parsed_data["motionDirection"]["opening"] ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ KeyError: 'motionDirection'
Additional information
No response
The text was updated successfully, but these errors were encountered: