cagnulein / switchbot_press

This is a simple project that manage the Switchbot ( https://amzn.to/3dnliBD ) that has only the "press" ability in Home Assistant.
GNU Lesser General Public License v3.0
14 stars 5 forks source link

Switchbot_press won't load with HA 2022.07 #12

Open Jucgshu opened 2 years ago

Jucgshu commented 2 years ago

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.

andytuinman3 commented 2 years ago

Same here.

cagnulein commented 2 years ago

I just updated the requirements file, try to reinstall it. I can't try this on my own right now Let me know

Jucgshu commented 2 years ago

So I did reinstall it, and the errors are gone from the HA logs. But I still can't seem to get the integration to work. Nothings happens when I try to trigger a toggle action on my switchbots.

I did find that not-so-useful error in my docker logs though:

/config/custom_components/switchbot_press/switch.py:64: RuntimeWarning: coroutine 'Switchbot.press' was never awaited
cagnulein commented 2 years ago

sorry but I don't have time to check this, if you can try to debug it and make a PR will be appreciated, thanks!

cagnulein commented 2 years ago

also did you put this component in debug mode?

Jucgshu commented 2 years ago

I did try to enable debug mode by adding this bit to my configuration.yaml with no luck. Any clue how I can enable it?

logger:
  default: info
  logs:
    custom_components.switchbot_press: debug

I wouldn't know where to start with submitting a PR as I'm not a dev :'(

cagnulein commented 2 years ago

I did try to enable debug mode by adding this bit to my configuration.yaml with no luck. Any clue how I can enable it?

yes you did it right

I wouldn't know where to start with submitting a PR as I'm not a dev :'(

i guess you should roll back to the previous HA version until I will fix it (me and my wife we are having a baby so I have other urgencies right now :D )

Jucgshu commented 2 years ago

No worries mate,I can wait no problem. Take care of your family ;-)

I-G-1-1 commented 2 years ago

Hi, I updated HomeAssistant to 2022.7.5 and switchbot_press was working good in version db5521b. I decided to update to dcf4cff and now switchbot_press doesn't work.

@cagnulein can you please for now revert the repository to db5521b untill you have the time to fix the compatibility issue. At least the integration was working in the previous version. Thanks EDIT2: don't mind I reverted the change in manifest.json to "requirements": ["PySwitchbot==0.8.0"] locally on my HA installation.

EDIT: I'm using Home Assistant Core 2022.7.5 with python 3.9. Probably switchbot_press was working for me as I still use 3.9

Jucgshu commented 2 years ago

Hi guys,

Just upgraded HA to 2022.08.2 and everything works out of the box... without the need for switchbot_press to be enabled. The new HA bluetooth feature is really cool.

Should we close the issue?

cagnulein commented 2 years ago

So this project is useless now? @Jucgshu

Write commented 2 years ago

How does the new system work ? I'm kinda afraid to upgrade now

Jucgshu commented 2 years ago

@cagnulein I'm afraid it is, yes. At least for me.

@Write Well, it's pretty much all automatic. Bluetooth has been auto detected by HA and my 2 switchbots as well. I just had to name them, choose a room for them et voilà!

cagnulein commented 2 years ago

@Jucgshu No problem, it's better :)

Write commented 2 years ago

Holy hell, you weren't lying the new Bluetooth soft from HA is fantastic

Screenshot du 2022-08-08 à 23 46 00

isn't that lovely

50494554524F commented 2 years ago

So this project is useless now? @Jucgshu

no, new native support in ha has a big delay in excuting commands...

Write commented 2 years ago

So this project is useless now? @Jucgshu

no, new native support in ha has a big delay in excuting commands...

Oops, i thought it was just me..

deCrysler commented 2 years ago

Hi guys,

Just upgraded HA to 2022.08.2 and everything works out of the box... without the need for switchbot_press to be enabled. The new HA bluetooth feature is really cool.

Should we close the issue?

Switchbot smart switch toggle is not supported, is it? Therefore, switchbot_press is still useful since it was working.

Write commented 2 years ago

Hi guys, Just upgraded HA to 2022.08.2 and everything works out of the box... without the need for switchbot_press to be enabled. The new HA bluetooth feature is really cool. Should we close the issue?

Switchbot smart switch toggle is not supported, is it? Therefore, switchbot_press is still useful since it was working.

It is supported

deCrysler commented 2 years ago

Hi guys, Just upgraded HA to 2022.08.2 and everything works out of the box... without the need for switchbot_press to be enabled. The new HA bluetooth feature is really cool. Should we close the issue?

Switchbot smart switch toggle is not supported, is it? Therefore, switchbot_press is still useful since it was working.

Is it supported

True, after full reboot of the PI it is supported. Thanks!

50494554524F commented 2 years ago

after a year i upgraded the raspberry: os to 8.4 and core to 2022.6.7, started checking if all works... switcbot_press fails practically every time now (can't connect error from python 3.9 switchbot component); i have to use an external dongle (works perfectly).

anyone has this kind of problem?! is it a os, core, components incompatibility?!

Write commented 2 years ago

after a year i upgraded the raspberry: os to 8.4 and core to 2022.6.7, started checking if all works... switcbot_press fails practically every time now (can't connect error from python 3.9 switchbot component); i have to use an external dongle (works perfectly).

anyone has this kind of problem?! is it a os, core, components incompatibility?!

Couldn't you at least read the entire thread before posting ??!

50494554524F commented 2 years ago

Couldn't you at least read the entire thread before posting ??!

are you talking about your previous OT?!?

Write commented 2 years ago

Couldn't you at least read the entire thread before posting ??!

are you talking about your previous OT?!?

lol ok I'm sorry. Otherwise I just ditched this plug-in and there is no delay (5~ sec) at first I thought I had some but I used an extended cable and moved the dongle farther away. I always used an external dongle. I don't think it's worth to update this plug-in as HA Bluetooth integration work perfectly

50494554524F commented 2 years ago

lol ok I'm sorry. Otherwise I just ditched this plug-in and there is no delay (5~ sec) at first I thought I had some but I used an extended cable and moved the dongle farther away. I always used an external dongle. I don't think it's worth to update this plug-in as HA Bluetooth integration work perfectly

can you try the ha native plugin trying to send more (toggle?!) commands in sequence and/or with a small delay in the script?!

any delay?! if all works, can you tell me what dongle are you using (i have asus bt-400)?! thanks

Write commented 2 years ago

lol ok I'm sorry. Otherwise I just ditched this plug-in and there is no delay (5~ sec) at first I thought I had some but I used an extended cable and moved the dongle farther away. I always used an external dongle. I don't think it's worth to update this plug-in as HA Bluetooth integration work perfectly

can you try the ha native plugin trying to send more (toggle?!) commands in sequence and/or with a small delay in the script?!

any delay?! if all works, can you tell me what dongle are you using (i have asus bt-400)?! thanks

Well in fact I can only send in sequences.

And you can add delay between action with delay:

# ---- Automation ---- #
automation:
# 1st automation
- alias: 'Auto turn off cat feed'
  trigger:
    - platform: state
      entity_id: switch.nourrir_chat_fakeswitch
      to: 'on'
  action:
    - service: switch.turn_on
      entity_id: switch.switchbot_chat
    #- delay: 00:00:00
    - service: switch.turn_off
      entity_id: switch.nourrir_chat_fakeswitch
50494554524F commented 2 years ago

2022.8.5 native support improved a lot, there's still a little delay but it's worth to test in a real situation now...

50494554524F commented 2 years ago

2022.8.7 commands are instantly delivered to my bot...

(btw, i can't manage the bot with the raspberry bluetooth anymore... an upgrade messed up something)

50494554524F commented 1 year ago

after few days of use in a real situation the native integration remains totally unstable (development is still in progress) even if it is working for few minutes after rebooting... i'm reverting back to os 7.6 and core 2022.7.6 to use switchbot_press

cagnulein commented 1 year ago

yes @50494554524F same here. I updated to the 2022.8.7 and i'm using the native one since 1 1/2 week and it's mostly unusable. I will try to fix this repo for the new HASS version in these days!

50494554524F commented 1 year ago

thank you!

cagnulein commented 1 year ago

@50494554524F i didn't do anything yet, anyway i saw that in the last HomeAssistant update there is an update about pyswitchbot https://github.com/home-assistant/core/pull/78504

50494554524F commented 1 year ago

@50494554524F i didn't do anything yet, anyway i saw that in the last HomeAssistant update there is an update about pyswitchbot home-assistant/core#78504

i don't know if this update is in core 2022.9.5, if it is in it doesn't work...

cagnulein commented 1 year ago

Yes 2022.9.5

Argh :(

dfbg-eldertech commented 1 year ago

Im currently using the newest version of HA and the native switchbot integration. It works, but only with on/off entities, not with press entities. Do you experience the same? I just want a press button and not an on/off switch...

cagnulein commented 1 year ago

hi @dfbg-eldertech i'm sorry but i'm not using this button anymore :(