Giter Site home page Giter Site logo

cagnulein / switchbot_press Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 5.0 17 KB

This is a simple project that manage the Switchbot ( https://amzn.to/3dnliBD ) that has only the "press" ability in Home Assistant.

License: GNU Lesser General Public License v3.0

Python 100.00%
homeassistant switchbot integration home-assistant python3

switchbot_press's People

Contributors

cagnulein avatar jetersen avatar smarthomefanatic avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

switchbot_press's Issues

SwitchDevice Deprecated

Logger: homeassistant.components.switch
Source: components/switch/init.py:123
Integration: Interruptor (documentation, issues)
First occurred: 10:34:01 (1 occurrences)
Last logged: 10:34:01

SwitchDevice is deprecated, modify SwitchBot_press to extend SwitchEntity

HA v2022.2.0 causes integration to fail to load

After upgrading Home Assistant to v2022.2.0, this integration is failing to load. Can you please fix this issue as soon as you can?

This error originated from a custom integration.

Logger: homeassistant.config
Source: custom_components/switchbot_press/switch.py:9
Integration: switchbot_press
First occurred: 12:28:20 (1 occurrences)
Last logged: 12:28:20

Platform error: switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config.py", line 877, in async_process_component_config
    platform = p_integration.get_platform(domain)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 566, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 583, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/custom_components/switchbot_press/switch.py", line 9, in <module>
    from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice
ImportError: cannot import name 'SwitchDevice' from 'homeassistant.components.switch' (/usr/src/homeassistant/homeassistant/components/switch/__init__.py)

SwitchDevice is deprecated

Hello!
In my HassIO log i see
"Logger: homeassistant.components.switch
Source: components/switch/init.py:130
Integration: Bryter (documentation, issues)
First occurred: 14:24:31 (1 occurrences)
Last logged: 14:24:31

SwitchDevice is deprecated, modify SwitchBot_press to extend SwitchEntity"

For your information :)
Capture

Switchbot_press won't load in HA

Hi there,

as I'm struggeling with the "old" switchbot integration I just found yours, but I cannot get it up and running.

My config looks like this:

switch:
#  - platform: switchbot
#    mac: 'C6:F9:E2:BE:1A:43'
#    name: 'Switchbot 1'
#  - platform: switchbot
#    mac: 'DE:F8:02:43:01:10'
#    name: 'Switchbot 2'
#  - platform: switchbot
#    mac: 'DB:C1:C0:FB:D6:4F'
#    name: 'Switchbot 3'
  - platform: switchbot_press
    mac: 'C6:F9:E2:BE:1A:43'
  - platform: switchbot_press
    mac: 'DE:F8:02:43:01:10'
  - platform: switchbot_press
    mac: 'DB:C1:C0:FB:D6:4F'
Logger: homeassistant.components.switch
Source: custom_components/switchbot_press/switch.py:52
Integration: Switch (documentation, issues)
First occurred: 12:23:25 PM (3 occurrences)
Last logged: 12:23:25 PM

Error while setting up switchbot_press platform for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/switchbot_press/switch.py", line 38, in setup_platform
    add_entities([SwitchBot_press(mac_addr, name, password)])
  File "/config/custom_components/switchbot_press/switch.py", line 52, in __init__
    self._device = switchbot.Switchbot(mac=mac, password=password)
  File "/usr/local/lib/python3.10/site-packages/switchbot/devices/bot.py", line 25, in __init__
    super().__init__(*args, **kwargs)
TypeError: SwitchbotDevice.__init__() missing 1 required positional argument: 'device'

Any idea of what is wrong?

Implements Device_state_attributes

After installing this and on a reboot I get the following warning:

Entity switch.switchbot_press (<class 'custom_components.switchbot_press.switch.SwitchBot_press'>) implements device_state_attributes. Please report it to the custom component author.
12:15:10 – (WARNING) helpers/entity.py

Expanded:

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:601
First occurred: 12:15:10 (1 occurrences)
Last logged: 12:15:10

Entity switch.switchbot_press (<class 'custom_components.switchbot_press.switch.SwitchBot_press'>) implements device_state_attributes. Please report it to the custom component author.

Please close is this is a false warning or anything but thought I would bring it to your attention.

Thank you very much.

Error talking to Switchbot

Hey,
I'm having the same problem through the official integration, I thought this custom component may solve it, but it's still the same, maybe you have an idea?

The bluetooth works fine because the device is found both on the official integration and on switchbot_press.
But when I try to toggle the switch, nothing happens and I get this errors on logs:

Cannot connect to Switchbot. Retrying (remaining: 3)...
02:38:07 – (WARNING) /usr/local/lib/python3.9/site-packages/switchbot/__init__.py
Error talking to Switchbot.
02:38:07 – (WARNING) /usr/local/lib/python3.9/site-packages/switchbot/__init__.py

Switchbot_press won't load with HA 2022.07

Switchbot_press seems to be broken as of HA 2022.07.

Logger: homeassistant.util.package
Source: util/package.py:99
Unable to install package PySwitchbot==0.8.0: error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [8 lines of output] /usr/local/lib/python3.10/site-packages/setuptools/dist.py:772: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running bdist_wheel running build running build_py Working dir is /tmp/pip-install-lgri3jqi/bluepy_ed2e737a81db4d5ca502c7ff21916854 execute make -C ./bluepy clean error: [Errno 2] No such file or directory: 'make' [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for bluepy error: subprocess-exited-with-error × Running setup.py install for bluepy did not run successfully. │ exit code: 1 ╰─> [10 lines of output] /usr/local/lib/python3.10/site-packages/setuptools/dist.py:772: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running install /usr/local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_py Working dir is /tmp/pip-install-lgri3jqi/bluepy_ed2e737a81db4d5ca502c7ff21916854 execute make -C ./bluepy clean error: [Errno 2] No such file or directory: 'make' [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure × Encountered error while trying to install package. ╰─> bluepy note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

[...]

Logger: homeassistant.config
Source: config.py:873
Platform error: switch - Requirements for switchbot_press not found: ['PySwitchbot==0.8.0'].

[...]

Logger: homeassistant.helpers.service
Source: helpers/service.py:130
Unable to find referenced entities switch.switchbot_tv or it is/they are currently not available

Thanks for the work on Switchbot_press.

SwitchBot documentation

Hi,
I have installed your component and HASSIO finds the entity no problem but "pressing" does nothing.

Does the setup require a SwitchBot hub?

Switchbot works fine via my iphone app but not via HASSIO.

Thanks

Alan

Multiple SwitchBots

Hello,

How Do I and more than one switchbot Devices? Can you please provide a sample configuration?

Best regards

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.