Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thermostat unavailable after update #76040

Closed
HandHsince1920 opened this issue Aug 1, 2022 · 20 comments
Closed

thermostat unavailable after update #76040

HandHsince1920 opened this issue Aug 1, 2022 · 20 comments

Comments

@HandHsince1920
Copy link

The problem

After update to beta channel first one then after a reboot both thermostats unavailable. I believe this update also brought the bluetooth integration to my system, might be related

What version of Home Assistant Core has the issue?

2022.8.0b4

What was the last working version of Home Assistant Core?

2022.6.7

What type of installation are you running?

Home Assistant OS

Integration causing the issue

EQ3 Bluetooth Smart Thermostats

Link to integration documentation on our website

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

Diagnostics information

Logger: homeassistant.components.climate
Source: components/eq3btsmart/climate.py:219
Integration: Climate (documentation, issues)
First occurred: 15:32:13 (2 occurrences)
Last logged: 15:32:14

eq3btsmart: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 477, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 702, in async_device_update
await task
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/eq3btsmart/climate.py", line 219, in update
self._thermostat.update()
File "/usr/local/lib/python3.10/site-packages/eq3bt/eq3btsmart.py", line 217, in update
self._conn.make_request(PROP_WRITE_HANDLE, value)
File "/usr/local/lib/python3.10/site-packages/eq3bt/bleakconnection.py", line 106, in make_request
with self:
File "/usr/local/lib/python3.10/site-packages/eq3bt/bleakconnection.py", line 51, in enter
self._loop.run_until_complete(self._conn.connect())
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 107, in connect
device = await BleakScannerBlueZDBus.find_device_by_address(
File "/usr/local/lib/python3.10/site-packages/bleak/backends/scanner.py", line 221, in find_device_by_address
return await cls.find_device_by_filter(
File "/usr/local/lib/python3.10/site-packages/bleak/backends/scanner.py", line 250, in find_device_by_filter
async with cls(detection_callback=apply_filter, **kwargs):
File "/usr/local/lib/python3.10/site-packages/bleak/backends/scanner.py", line 96, in aenter
await self.start()
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/scanner.py", line 137, in start
self._stop = await manager.active_scan(
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 376, in active_scan
reply = await self._bus.call(
File "/usr/local/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 305, in call
await future
RuntimeError: Task <Task pending name='Task-1797' coro=<BleakClientBlueZDBus.connect() running at /usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py:107> cb=[_run_until_complete_cb() at /usr/local/lib/python3.10/asyncio/base_events.py:184]> got Future attached to a different loop

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@probot-home-assistant
Copy link

eq3btsmart documentation
eq3btsmart source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @rytilahti, mind taking a look at this issue as it has been labeled with an integration (eq3btsmart) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@rytilahti
Copy link
Member

Thanks for the report. I didn't have that problem with my local installation but I have seen that issue on python<3.10. rytilahti/python-eq3bt#58 is potential fix for this, but I'm unsure if it's the correct way to handle it.

@TechHummel
Copy link

I have the same issue 😄
Do you want me to try your potential fix?

@rytilahti
Copy link
Member

Alas, that fix is not likely enough due to how homeassistant os uses bleak, but if you know how to modify your local installation you could try and check it out.

The real solution to make these thermostats available is more involved than I hoped it would be, and therefore I'm not going to promise anything. For the time being you could use some of the available bt to mqtt gateways (e.g., https://github.com/zewelor/bt-mqtt-gateway uses python-eq3bt library to provide support for these devices). I'm terribly sorry for getting your hopes up :-(

@TechHummel
Copy link

TechHummel commented Aug 3, 2022

Just in case it is important: I am not using homeassistant os (I'm running homeassistant in a docker container on a debian on x86 hardware).

Thanks for your workaround suggestion, looks promising indeed.

@rytilahti
Copy link
Member

Okay, maybe a dockerized system works with that PR, feel free to test and report back at the PR :-)

@bvweerd
Copy link
Contributor

bvweerd commented Aug 4, 2022

Okay, maybe a dockerized system works with that PR, feel free to test and report back at the PR :-)

The PR did not help for me running in a docker container using HA 2022.8.0 unfortunately

@wjarka
Copy link

wjarka commented Aug 7, 2022

I just upgraded to the latest version of Hassio on HASS OS and I have had the same issue since the upgrade.

I am on:
Home Assistant 2022.8.1
Supervisor 2022.07.0
Operating System 8.4
Frontend 20220802.0

@HandHsince1920
Copy link
Author

Alas, that fix is not likely enough due to how homeassistant os uses bleak, but if you know how to modify your local installation you could try and check it out.

The real solution to make these thermostats available is more involved than I hoped it would be, and therefore I'm not going to promise anything. For the time being you could use some of the available bt to mqtt gateways (e.g., https://github.com/zewelor/bt-mqtt-gateway uses python-eq3bt library to provide support for these devices). I'm terribly sorry for getting your hopes up :-(

Oh no, does that mean you are generally giving up on updating the eq3 integration for the current Home Assistant version?

@rytilahti
Copy link
Member

Oh no, does that mean you are generally giving up on updating the eq3 integration for the current Home Assistant version?

So the backend library (nor the homeassistant integration) has not been maintained actively by myself for several years. As making it work with the newest release seemed straight-forward from the surface, I thought I'd do a favor and make that happen.

I'm not personally using these thermostats actively, I just have a single thermostat I have kept just in case I need to test something in case someone else contributes pull requests to the project. Unfortunately I don't currently have the time nor energy to work on this, but you can follow rytilahti/python-eq3bt#59 if some progress gets made later on.

@michapr
Copy link

michapr commented Aug 17, 2022

@rytilahti , can you check this please - same problem with eq3 integration, but maybe other issue?
#76888
Thanks!
Michael

=> EDIT: this is solved!

@r-jordan
Copy link
Contributor

@rytilahti , can you check this please - same problem with eq3 integration, but maybe other issue? #76888 Thanks! Michael

=> EDIT: this is solved!

How can we change docker-compose.yml in HA installed with HA Operating System?

@michapr
Copy link

michapr commented Sep 19, 2022

@r-jordan

How can we change docker-compose.yml in HA installed with HA Operating System?

This described issue was docker related.

But the instable connection/ work with thermostat like issues above and hbldh/bleak#946 is still present...

@wjarka
Copy link

wjarka commented Sep 20, 2022

Here is what I have in logs:

Logger: homeassistant.components.eq3btsmart.climate
Source: components/eq3btsmart/climate.py:191 
Integration: eq3btsmart (documentation, issues) 
First occurred: 1:13:09 PM (7 occurrences) 
Last logged: 1:15:48 PM

Updating the state failed: Exception on write using bleak
Updating the state failed: unable to connect to device using bleak

@r-jordan
Copy link
Contributor

r-jordan commented Sep 21, 2022

I have this in logs after updating HA OS to 9.0:

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:77
First occurred: 12:59:12 (1 occurrences)
Last logged: 12:59:12

Detected integration that attempted to call BleakClient with an address instead of a BLEDevice. Please report issue for eq3btsmart using this method at homeassistant/components/eq3btsmart/climate.py, line 189: self._thermostat.update()
Logger: homeassistant.helpers.entity
Source: components/eq3btsmart/climate.py:189
First occurred: 13:03:44 (2 occurrences)
Last logged: 13:05:44

Update for climate.eq3_salon1 fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 168, in connect
    reply = await self._bus.call(
  File "/usr/local/lib/python3.10/site-packages/dbus_fast/aio/message_bus.py", line 337, in call
    await future
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 515, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 718, in async_device_update
    await task
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/eq3btsmart/climate.py", line 189, in update
    self._thermostat.update()
  File "/usr/local/lib/python3.10/site-packages/eq3bt/eq3btsmart.py", line 217, in update
    self._conn.make_request(PROP_WRITE_HANDLE, value)
  File "/usr/local/lib/python3.10/site-packages/eq3bt/bleakconnection.py", line 106, in make_request
    with self:
  File "/usr/local/lib/python3.10/site-packages/eq3bt/bleakconnection.py", line 51, in __enter__
    self._loop.run_until_complete(self._conn.connect())
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 167, in connect
    async with async_timeout.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
Logger: homeassistant.components.eq3btsmart.climate
Source: components/eq3btsmart/climate.py:191
Integration: eq3btsmart ([documentation](https://www.home-assistant.io/integrations/eq3btsmart), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+eq3btsmart%22))
First occurred: 13:00:52 (20 occurrences)
Last logged: 13:23:07

Updating the state failed: Exception on write using bleak
Updating the state failed: unable to connect to device using bleak

@Pygmaee
Copy link

Pygmaee commented Sep 22, 2022

There is a very dirty workaround which kind of works for me. If I define a switch in configuration and send a command to set the temperature thats working for me:

switch: heating: command_on: "eq3cli --mac 00:1a:22:xx:xx:xx temp --target 22" command_off: "eq3cli --mac 00:1a:22:xx:xx:xx temp --target 15"

You a loose a lot of options at setting, logging and modifying temperature but at least you will have a basic turn on/off switch.

As far as I see it the eq3cli script is working however the problem is that the integration is calling bleak with the mac and not with the BLEDevice object. My programming skills are to bad to figure out how to fix that.
Maybe my workaround helps somebody.

@github-actions
Copy link

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.

@github-actions github-actions bot added the stale label Dec 23, 2022
@rytilahti
Copy link
Member

See rytilahti/python-eq3bt#70 for a custom component solution, which will hopefully replace the current implementation in the future.

@issue-triage-workflows
Copy link

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.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 9, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants