py-smart-gardena / hass-gardena-smart-system

Home Assistant custom component integration for Gardena Smart System
Apache License 2.0
212 stars 53 forks source link

[websocket] error from callback #78

Closed ccorderod closed 3 years ago

ccorderod commented 3 years ago

Hi there.

I am running HA 2021.06.6 with gardena.smart_system custom component 0.2.3. Device is a Sileno mower. This shows up on the log:

2021-07-03 10:00:32 DEBUG (MainThread) [custom_components.gardena_smart_system] Setting up Gardena Smart System component 2021-07-03 10:00:32 DEBUG (SyncWorker_11) [custom_components.gardena_smart_system] Starting GardenaSmartSystem 2021-07-03 10:00:33 DEBUG (SyncWorker_11) [custom_components.gardena_smart_system] Using location: My Garden (d956c97b-5676-4647-ad36-c8ee9cce420b) 2021-07-03 10:00:43 DEBUG (SyncWorker_11) [custom_components.gardena_smart_system] Starting GardenaSmartSystem websocket 2021-07-03 10:00:43 DEBUG (MainThread) [custom_components.gardena_smart_system] Gardena Smart System component setup finished 2021-07-03 10:00:44 DEBUG (MainThread) [custom_components.gardena_smart_system.sensor] Adding sensor as sensor [<Entity Cortacesped battery level: 100>] 2021-07-03 10:00:44 DEBUG (MainThread) [custom_components.gardena_smart_system.switch] Adding water control, power socket and smart irrigation control as switch: [] 2021-07-03 10:00:44 ERROR (Thread-5) [websocket] error from callback <bound method Client.on_open of <gardena.smart_system.Client object at 0x7f48a2037fa0>>: on_open() takes 1 positional argument but 2 were given 2021-07-03 10:00:44 DEBUG (MainThread) [custom_components.gardena_smart_system.vacuum] Adding mower as vacuums: [<Entity Cortacesped: None>] 2021-07-03 10:00:44 DEBUG (MainThread) [custom_components.gardena_smart_system.vacuum] Running Gardena update 2021-07-03 10:00:44 DEBUG (MainThread) [custom_components.gardena_smart_system.vacuum] Mower has state OK 2021-07-03 10:00:44 DEBUG (MainThread) [custom_components.gardena_smart_system.vacuum] Getting mower state 2021-07-03 10:00:44 DEBUG (MainThread) [custom_components.gardena_smart_system.vacuum] Mower has activity PARKED_TIMER 2021-07-03 10:00:53 ERROR (Thread-5) [websocket] error from callback <bound method Client.on_message of <gardena.smart_system.Client object at 0x7f48a2037fa0>>: on_message() takes 2 positional arguments but 3 were given 2021-07-03 10:00:53 ERROR (Thread-5) [websocket] error from callback <bound method Client.on_message of <gardena.smart_system.Client object at 0x7f48a2037fa0>>: on_message() takes 2 positional arguments but 3 were given 2021-07-03 10:00:53 ERROR (Thread-5) [websocket] error from callback <bound method Client.on_message of <gardena.smart_system.Client object at 0x7f48a2037fa0>>: on_message() takes 2 positional arguments but 3 were given 2021-07-03 10:00:53 ERROR (Thread-5) [websocket] error from callback <bound method Client.on_message of <gardena.smart_system.Client object at 0x7f48a2037fa0>>: on_message() takes 2 positional arguments but 3 were given Due to the websocket errors, the mower entity just got updated on HA startup but do not get any new update from there. I did check on the HA container for the py-smart-gardena lib, and it shows 0.7.10

I don't know where to look to try to fix this. Any advise will be greatly appreciated.

Thanks. Stay safe.

grm commented 3 years ago

Hello,

thanks for the feedback What kind of installation (docker, pip, other ?) are you using ?

There was a breaking change in the request library that changed the signature. Having this issue means you have a recent version (the one shipped with the docker image is the old one).

I am currently working a newer integration, but i have to rewrite a huge part of the underlying library and it takes some time ..

Jérémie

ccorderod commented 3 years ago

Hello @grm

Thank for the reply. You are very welcome. Here is the info for my setup:

System Health

version core-2021.7.0
installation_type Home Assistant OS
dev false
hassio true
docker true
virtualenv false
python_version 3.9.5
os_name Linux
os_version 5.10.45
arch x86_64
timezone Europe/Madrid
Home Assistant Community Store GitHub API | ok -- | -- Github API Calls Remaining | 4670 Installed Version | 1.13.2 Stage | running Available Repositories | 919 Installed Repositories | 52
AccuWeather can_reach_server | ok -- | -- remaining_requests | 42
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | July 10, 2021, 2:00 AM relayer_connected | true remote_enabled | true remote_connected | true alexa_enabled | true google_enabled | true can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 6.1 -- | -- update_channel | stable supervisor_version | supervisor-2021.06.8 docker_version | 20.10.6 disk_total | 916.2 GB disk_used | 225.9 GB healthy | true supported | true board | generic-x86-64 supervisor_api | ok version_api | ok installed_addons | Glances (0.12.2), MariaDB (2.4.0), Samba share (9.5.1), Check Home Assistant configuration (3.7.1), Terminal & SSH (9.1.3), Nginx Proxy Manager (0.11.0), Mosquitto broker (6.0.1), chrony (2.2.0), AdGuard Home (4.1.6), AppDaemon 4 (0.6.2), ESPHome (1.19.4), InfluxDB (4.1.1), Grafana (7.0.2), Network UPS Tools (0.7.1), Node-RED (9.2.0), phpMyAdmin (0.4.2), Portainer (1.5.1), File editor (5.3.1), Duck DNS (1.12.5), Folding@home (0.2.0), Let's Encrypt (4.11.0), rest980 Docker Image (20200205), php-nginx Docker Image (latest), roombapw Docker Image (1.0.0), A better presence (1.2.0), Syncthing (1.11.0), Grocy (0.14.0), Git pull (7.13.1)
Lovelace dashboards | 1 -- | -- resources | 26 views | 20 mode | yaml

Is there is any temporary workaround to fix my issue before you release the new integration?

Thank you. Stay safe. Carlos

grm commented 3 years ago

Ok, it should work now with version 0.8.* ! Can you confirm ? Jeremie

ccorderod commented 3 years ago

Nop. Still getting those errors with latest HA release:

`Logger: websocket Source: /usr/local/lib/python3.9/site-packages/websocket/_logging.py:67 First occurred: 7:51:48 AM (5 occurrences) Last logged: 7:51:49 AM

error from callback <bound method Client.on_open of <gardena.smart_system.Client object at 0x7f2a6e0f31f0>>: on_open() takes 1 positional argument but 2 were given error from callback <bound method Client.on_message of <gardena.smart_system.Client object at 0x7f2a6e0f31f0>>: on_message() takes 2 positional arguments but 3 were given `

ccorderod commented 3 years ago

@grm Do I have to update manually the component?

grm commented 3 years ago

Yes, or using hacs !

Jérémie

grm commented 3 years ago

@ccorderod how have you installed home assistant ? using PIP ?

If so, could you try to update the request package using pip, pipenv or whatever package managr you are using ?

Jérémie

ccorderod commented 3 years ago

@grm this is a supervised HA installation on an Intel Nuc. No PIP needed :). Through HACS I installed 2.5b2. Rebooted. Errors gone :). Thank you for the time & effort.

grm commented 3 years ago

glad it works !

Jérémie

ccorderod commented 3 years ago

@grm, the component does not update mower status, and this time I get a different error in the log: `Logger: websocket Source: /usr/local/lib/python3.9/site-packages/websocket/_logging.py:67 First occurred: July 11, 2021, 6:23:11 PM (1 occurrences) Last logged: July 11, 2021, 6:23:11 PM

error from callback <bound method Client.on_close of <gardena.smart_system.Client object at 0x7f1f0978dac0>>: on_close() takes 2 positional arguments but 4 were given`

ccorderod commented 3 years ago

@grm Release 0.2.5b3 fix the above issue. Gracias!. Stay safe.