Coder Social home page Coder Social logo

ha-switchbot-curtain's People

Contributors

alextud avatar blackstardlb avatar eortiz-tracktik avatar niemyjski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ha-switchbot-curtain's Issues

Integration screwed up after March 2021

Hello there,

Unfortunately the integration is somehow broken after March 7 2021 - that's the last commit where the curtain's are working (at least for me, running on an NUC, but I've seen plenty of complaints where the integration went offline, bluetooth went offline, etc). I Don't know what changed there and then (I suspect it has something to do with the bluetooth stack.

Error messages after latest update

Last update drops the following error (though the curtain opens and closes):

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 316, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 524, in async_device_update
raise exc
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/switchbot-curtain/cover.py", line 164, in update
self._device.update()
File "/usr/local/lib/python3.8/site-packages/switchbot/init.py", line 189, in update
devices = bluepy.btle.Scanner().scan(scan_timeout)
File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 854, in scan
self.stop()
File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 803, in stop
self._mgmtCmd(self._cmd()+"end")
File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 312, in _mgmtCmd
raise BTLEManagementError("Failed to execute management command '%s'" % (cmd), rsp)
bluepy.btle.BTLEManagementError: Failed to execute management command 'scanend' (code: 11, error: Rejected)

bluepy.btle.BTLEManagementError: Management not available (permissions problem?)

Seeing these issues recently in the logs and it seems like the status cannot be captured; Google Assistant also mentions it cannot communicate although the curtain does work

2021-06-28 22:17:33 ERROR (MainThread) [homeassistant.helpers.entity] Update for cover.curtain fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 350, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 558, in async_device_update
    raise exc
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/switchbot-curtain/cover.py", line 164, in update
    self._device.update()
  File "/usr/local/lib/python3.8/site-packages/switchbot/__init__.py", line 189, in update
    devices = bluepy.btle.Scanner().scan(scan_timeout)
  File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 852, in scan
    self.start(passive=passive)
  File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 790, in start
    self._mgmtCmd("le on")
  File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 309, in _mgmtCmd
    rsp = self._waitResp('mgmt')
  File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 366, in _waitResp
    raise BTLEManagementError("Management not available (permissions problem?)", resp)
bluepy.btle.BTLEManagementError: Management not available (permissions problem?)

No version in manifest

Home assistant has started putting

No 'version' key in the manifest file for custom integration 'switchbot-curtain'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'switchbot-curtain'

In the log file. At some point it looks like it's going to stop working!

Fails to initialize

The cover fails to add to HA due to line 110. I changed locally to below to get it working

return True ##self.current_cover_position <= 0

Scenes In Home Assistant Not Reliably Moving Blinds

Hey there, thanks for making this integration!
I've got it working with my blinds showing up in home assistant, and controllable from the dashboard.

However, trying to get them working in a scene, I've found it very finnicky.

They don't show up as a device (not sure if that right there is the issue?) but I can add them as an entity.
I can set the blind positions through the entity listing, but when I trigger the scene, the blinds only actually move maybe 1/10 times.

No idea what could be causing this - anything you'd recommend trying?

Documentation very unclear: which MAC to add? How to add multiple?

Just got 4 switchbot curtains and a hub mini. How do I add this properly? The MAC-addresses of the curtains themselves are BLE (Bluetooth) devices and my HA-setup doesn't have BLE. The hub however has a WiFi MAC-address.

How to properly set this up? The documentation is very very sparse and unclear about this.

Battery percentage readings feature request

Hi this is working great so thank you. It would be really usefully to be able to see the battery % in Home Assistant of Switchbot curtains. Is there any way to add this?

switchbot-curtain platform not accepted

I have both manually added the repository and also downloaded using Hacs. The folder switchbot-curtain is now under the custom-components folder.

However, when adding the curtain entry to the configuration.yaml, it is not recognised:

cover:

  • platform: switchbot-curtain
    mac: XX:XX:XX:XX:XX:8C
    name: 'Living Room Curtains'

Value is not accepted. Valid values: "mqtt".yaml-schema: http://schemas.home-assistant.io/configuration(1)

I have restarted Home Assistant so its should have been applied correctly. Certainly looks ok in Hacs

Not sure what I need to do to get this recognised.

Sorry that the code is not formatted correctly above, including the hyphen changing to a bullet point, but the Insert Code option did not appear to format anything so had to stick with unformatted. The format in my yaml is correct, it is just the platform it does not recognise.

doesnt work after update

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/switchbot-curtain/cover.py", line 41, in setup_platform
add_entities([SwitchBotCurtain(mac_addr, name, password)])
File "/config/custom_components/switchbot-curtain/cover.py", line 56, in init
self._device = switchbot.SwitchbotCurtain(mac=mac, password=password)
AttributeError: module 'switchbot' has no attribute 'SwitchbotCurtain'

config:
cover:

  • platform: switchbot-curtain
    mac: C8:21:BE:8C:9E:xx

installed the integration via hacs

Crashes with traceback

Any idea what would cause this? Am I missing some dependency?

2021-05-24 21:16:45 ERROR (MainThread) [homeassistant.helpers.entity] Update for cover.switchbot_
curtain fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_sta
te
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update
    raise exc
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/switchbot-curtain/cover.py", line 164, in update
    self._device.update()
  File "/usr/local/lib/python3.8/site-packages/switchbot/__init__.py", line 189, in update
    devices = bluepy.btle.Scanner().scan(scan_timeout)
  File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 852, in scan
    self.start(passive=passive)
  File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 790, in start
    self._mgmtCmd("le on")
  File "/usr/local/lib/python3.8/site-packages/bluepy/btle.py", line 312, in _mgmtCmd
    raise BTLEManagementError("Failed to execute management command '%s'" % (cmd), rsp)
bluepy.btle.BTLEManagementError: Failed to execute management command 'le on' (code: 17, error: Invalid Index)

PySwitchbot should be updated to 0.12

Since Home Assistant SwitchBot default implementation in 2021.11 now has PySwitchbot updted to version 0.12, the curtain implementation cannot live side by side, and official SwitchBot implementation doesn't work.

Update for cover.switchbot_curtain fails

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 446, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 641, in async_device_update
raise exc
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/switchbot-curtain/cover.py", line 164, in update
self._device.update()
File "/usr/local/lib/python3.9/site-packages/switchbot/init.py", line 189, in update
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 853, in scan
self.process(timeout)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 840, in process
isNewData = dev._update(resp)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 696, in _update
raise BTLEInternalError("Address type changed during scan, for address %s" % self.addr)
bluepy.btle.BTLEInternalError: Address type changed during scan, for address xx:xx:xx:xx:xx:xx

Im new to HA please be gentle lol but i have a problem

I downloaded the files and copied them to the config directory but when i try and restart the server i get the error 'Integration 'switchbot-curtain' not found'
can anyone help please?

this is the ha log

Logger: homeassistant.components.websocket_api.http.connection
Source: components/hassio/init.py:562
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 19:24:18 (1 occurrences)
Last logged: 19:24:18

[139692267184864] The system cannot restart because the configuration is not valid: Platform error cover.switchbot-curtain - Integration 'switchbot-curtain' not found.
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1492, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1527, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/components/hassio/init.py", line 562, in async_handle_core_service
raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: The system cannot restart because the configuration is not valid: Platform error cover.switchbot-curtain - Integration 'switchbot-curtain' not found.

HomeKit broken after update

Since the last update in HACS to 896be86, the control works fine from Home Assistant directly, but not longer from HomeKit. The state is always reported as closed, and when tapping it to open, the loading circle appears and nothing happens.

When reverting back to f31b687, everything works fine again.

Noob question -How do I add a second switchbot curtain?

Used your code to get Switchbot Curtain working with HA. No problems, thank you 👍 . My question is how do I add a second, separate switchbot curtain controlling a different curtain. I've tried a few things, but my configuration.yaml keeps failing. Any suggestions much appreciated

Battery level being misreported

Hi. Another happy new user here. Thank you for your work to create support for this neat hardware solution in HA. I have run into one minor issue, though...

The integration has started reporting the bot's battery level to be 221% (having previously indicated the same value as the mobile app). The android app shows battery level to be 93%, so I think the hardware is reporting correctly and this seems more likely a software issue. Not a big deal, but will prevent my plan to integrate notifications to warn of low battery.

Capture

Switchbot integration working well in a freshly booted HA on an Intel NUC but failing later

Hello,
I'm a happy user of this integration. It works just fine right after HA has been started but when the system has been up for a while (I really can’t tell when that starts to happen), the integration fails to trigger my switchbots.

Scenario:

  • HA has been up for a while
  • I click on any of my switchbot curtains
  • My switchbot curtains won't react
  • I wait some time
  • Nothing happens
  • I then restart HA
  • Click on the very same switchbot integration
  • The switchbot integration woks and drapes are pulled correctly
  • After a while (I can't really tell when this happens) the integration will not work any more

And of course, as soon as restart the integration, it works again.

I'm just wondering if this is something which only happens on an intel NUC and the way it handles bluetooth. I would appreciate it if you could help me troubleshoot my system.

I'm using the Bluetooth tracking integration to track family members presence. Not sure if this could be problematic.

thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.