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
71.97k stars 30.17k forks source link

Switchbot BlindTilt Light Level Stuck #94742

Open fdabek1 opened 1 year ago

fdabek1 commented 1 year ago

The problem

I installed my first Switchbot BlindTilt two weeks ago and the Light Level has been stuck at 2 for the entirety of the time. The battery level is updating and my automation to open/close it is working just fine.

I have found in the logs some messages about it not being connected (see below), but otherwise everything else is still functional. The SwitchBot app also shows the light level just fine.

I also found this issue reported in not this repo: https://github.com/home-assistant/home-assistant.io/issues/27464

What version of Home Assistant Core has the issue?

core-2023.5.4

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

SwitchBot

Link to integration documentation on our website

https://www.home-assistant.io/integrations/switchbot/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2023-05-30 20:43:36.655 INFO (MainThread) [homeassistant.setup] Setting up switchbot
2023-05-30 20:43:36.655 INFO (MainThread) [homeassistant.setup] Setup of domain switchbot took 0.0 seconds
2023-05-30 20:43:36.794 INFO (MainThread) [homeassistant.components.cover] Setting up cover.switchbot
2023-05-30 20:43:36.799 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.switchbot
2023-05-30 20:43:36.801 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.switchbot
2023-05-30 20:43:36.809 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new cover.switchbot entity: cover.blind_tilt_6a07
2023-05-30 20:43:36.810 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.switchbot entity: binary_sensor.blind_tilt_6a07
2023-05-30 20:43:36.812 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.switchbot entity: sensor.blind_tilt_6a07_battery
2023-05-30 20:43:36.814 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.switchbot entity: sensor.blind_tilt_6a07_light_level
2023-05-30 20:43:36.816 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.switchbot entity: sensor.blind_tilt_6a07_bluetooth_signal
2023-05-30 20:43:37.435 WARNING (MainThread) [switchbot.devices.device] DB-CF-3B-C7-6A-07 (DB:CF:3B:C7:6A:07): Device unexpectedly disconnected; RSSI: -68
2023-06-09 13:39:13.749 ERROR (MainThread) [switchbot.devices.device] DB-CF-3B-C7-6A-07 (DB:CF:3B:C7:6A:07): device not found, no longer in range, or poor RSSI: -68
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 233, in connect
    await local_disconnect_monitor_event.wait()
  File "/usr/local/lib/python3.10/asyncio/locks.py", line 214, in wait
    await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 344, in establish_connection
    await client.connect(
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 272, in connect
    connected = await super().connect(**kwargs)
  File "/usr/local/lib/python3.10/site-packages/bleak/__init__.py", line 531, in connect
    return await self._backend.connect(**kwargs)
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 141, in connect
    async with async_timeout(timeout):
  File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 129, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 212, in _do_exit
    raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/switchbot/devices/device.py", line 180, in _send_command
    return await self._send_command_locked(key, command)
  File "/usr/local/lib/python3.10/site-packages/switchbot/devices/device.py", line 414, in _send_command_locked
    await self._ensure_connected()
  File "/usr/local/lib/python3.10/site-packages/switchbot/devices/device.py", line 274, in _ensure_connected
    client: BleakClientWithServiceCache = await establish_connection(
  File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 361, in establish_connection
    _raise_if_needed(name, device.address, exc)
  File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 310, in _raise_if_needed
    raise BleakNotFoundError(msg) from exc
bleak_retry_connector.BleakNotFoundError: WoBlindTilt (DB:CF:3B:C7:6A:07) - DB:CF:3B:C7:6A:07: Failed to connect: 
2023-06-09 13:39:13.760 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 233, in connect
    await local_disconnect_monitor_event.wait()
  File "/usr/local/lib/python3.10/asyncio/locks.py", line 214, in wait
    await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 344, in establish_connection
    await client.connect(
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 272, in connect
    connected = await super().connect(**kwargs)
  File "/usr/local/lib/python3.10/site-packages/bleak/__init__.py", line 531, in connect
    return await self._backend.connect(**kwargs)
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 141, in connect
    async with async_timeout(timeout):
  File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 129, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 212, in _do_exit
    raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/switchbot/devices/device.py", line 557, in update
    if info := await self.get_basic_info():
  File "/usr/local/lib/python3.10/site-packages/switchbot/devices/blind_tilt.py", line 79, in get_basic_info
    if not (_data := await self._get_basic_info()):
  File "/usr/local/lib/python3.10/site-packages/switchbot/devices/device.py", line 529, in _get_basic_info
    _data = await self._send_command(
  File "/usr/local/lib/python3.10/site-packages/switchbot/devices/device.py", line 180, in _send_command
    return await self._send_command_locked(key, command)
  File "/usr/local/lib/python3.10/site-packages/switchbot/devices/device.py", line 414, in _send_command_locked
    await self._ensure_connected()
  File "/usr/local/lib/python3.10/site-packages/switchbot/devices/device.py", line 274, in _ensure_connected
    client: BleakClientWithServiceCache = await establish_connection(
  File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 361, in establish_connection
    _raise_if_needed(name, device.address, exc)
  File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 310, in _raise_if_needed
    raise BleakNotFoundError(msg) from exc
bleak_retry_connector.BleakNotFoundError: WoBlindTilt (DB:CF:3B:C7:6A:07) - DB:CF:3B:C7:6A:07: Failed to connect: 


### Additional information

_No response_
home-assistant[bot] commented 1 year ago

Hey there @bdraco, @danielhiversen, @renierm26, @murtas, @eloston, @dsypniewski, mind taking a look at this issue as it has been labeled with an integration (switchbot) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `switchbot` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign switchbot` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


switchbot documentation switchbot source (message by IssueLinks)

Mr-HaleYa commented 1 year ago

Same here, I have 7 installed. 6 stuck at 2 and 1 that I saw at 1 when I first installed it, unfortunately, I disabled the light entity on it right after since it's useless, so I don't know if it would have got to 2 then stopped. All 7 running FW 2.0.0

pilonull commented 1 year ago

Thought I was the only one who noticed this but glad to see it's already a documented issue.

hanley-development commented 1 year ago

I am wondering if this is because of the latest firmware update....Is everything pulled from API or a Bluetooth connection?

Nismonx commented 1 year ago

If I remember correctly there use to be 2 lux sensors, one in the wand and another in the solar panel. The official app used to give us the option to use the internal or solar sensors. But soon after updates this option is gone. I've disconnected the solar panel in hope it would use the internal sensor and still getting a reading of 2 in HA but in the app I says panel disconnected and it will run the automation set in the app (if level falls below 2, close blind)

Another observation is the charging function in the app, it supposed to only charge when at level 6 or above. In my case I'm experiencing some of my devices will charge from level 4 and others only from 6 and above.

I genuinely think the firmware is a little clunky still or there's been hardware issues and switchbot is trying to fix things with gimmicks so kinda feel sorry for the devs here trying to make sense of it all.

I'm not getting any errors in the logs atm but hope any of the above is of any helpfulness.

Sawadee2u commented 10 months ago

Same issue here with 7 blind tilt units. Light level reporting by HA is 2 or 1. But in the Switchbot App it reports 1-10. This issue seems to be how the intergration is getting (or not getting) the light level information and reporting it. All batteries are charging when the sun is on solar panels. REF: same with Switchbot versions 2.0 and 2.1. Have the latest updates of if this date available in HA.

trossachs1 commented 10 months ago

Has anyone managed to resolve this issue. I've just installed one and the light level is randomly either a 1 or 2, even though switchbot app shoes between 0-10. Really annoying as want to use it to automate.

Sawadee2u commented 10 months ago

Yes. I have the same issue on 7 of 7 tilt units. Assume the API is not returning the correct value. Could be wrong but if so, only SwitchBot can fix this.

Sawadee2u commented 9 months ago

Same issue with 7 tilt units. Light level reports as 0 or 2 in “show more history”. All units show 2 when charging in HA but 9-10 in SwitchBot app.

dsb2611 commented 7 months ago

I have 16 Switchbot Blind Tilts and all of them only ever display level 2. It's fine in the Switchbot App but I'd like to be able to do finer control in HA based on light level.

issue-triage-workflows[bot] commented 4 months 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.

AwesomenessZ commented 4 months ago

This is still an issue

Sawadee2u commented 4 months ago

This is stale due to nothing being done. it is still an issue even after all the SwitchBot and HA updates.

jswalls110 commented 3 months ago

Definitely not working. In the Switchbot app it reads fine, in HA it's either 1 or 2.

klovatt commented 3 months ago

I would also really appreciate a fix for this. I was hoping HA would be able to provide some opportunity for advanced programming on these devices

amooz commented 3 months ago

Also experiencing the issue. Enabling the debug logging I found that 'lightLevel': 2, looks to be what the switchbot itself is returning, but the . Which makes me wonder if either the integration is not requesting the right value, or if the correct value is in a different part of the result data. In the mean time, I'll also try to reach out to Switchbot support and see if maybe this is an easy fix on their end.

Full debug message, lightlevel part in bold for easy scanning:

2024-07-01 10:53:45.775 DEBUG (MainThread) [switchbot.devices.device] None (redacted): update advertisement: SwitchBotAdvertisement(address='redacted', data={'rawAdvData': b'x\x00R', 'data': {'calibration': True, 'battery': 82, 'inMotion': False, 'tilt': 100, 'lightLevel': 2, 'sequence_number': 20}, 'model': 'x', 'isEncrypted': False, 'modelFriendlyName': 'Blind Tilt', 'modelName': <SwitchbotModel.BLIND_TILT: 'WoBlindTilt'>}, device=BLEDevice(redacted, None), rssi=-92, active=True) (seq before: None) (seq after: 20)

mikefrantz commented 3 weeks ago

I have the same issue with my SwitchBot blind tilt that has a solar panel hooked to it. Mine is stuck at one and does not matter how sunny or how cloudy it is the Light level is always set at one.