One of the Eqiva eQ3 valve now always results unavailable on Hassio while it works perfectly with other devices

I have two Eqiva eQ3 bluetooth thermostatic valves. I have been using them with Home Assistant and they always worked. Recently, I switched to Hass.io and they have been working the same as well.

However, since the last one or two weeks only one of the valves always results unavailable. This valve is actually in the same room of the raspberry pi 3b+ (using hassio 0.99.0 with integrated bluetooth) and very close to it.

My phone can always connect and interact with the valve which results unavailable on Hassio. I had a spared raspberry pi 3b and installed this script https://github.com/Heckie75/eQ-3-radiator-thermostat to see if I can connect and sync with the valve. And again there is no issue at all.

I have thus concluded that the raspberry pi with hassio just refuses to connect for some reason with the valve while before it has been working perfectly.

I re-checked many times the mac address and reset to factory settings the valve (and even replaced the batteries). Still the valve is always perfectly recognized by all my other devices at first glance but not by the raspberry with Hassio. What is weird to me is that the second eq3 valve, which is in another room, is always shown and can be controlled on Hassio. I would have expected to have more issues with that one being more distant.

The home assistant documentation ( https://www.home-assistant.io/components/eq3btsmart/ ) suggests to first test the connectivity with the valve. However, by connecting via ssh to Hassio I cannot give the command eq3cli --mac 00:11:22:33:44:55. Do you know another way to test connectivity on Hassio?

This was instead extracted from the log to give an idea of the errors (I masked the mac address of the valve):

2019-09-19 10:21:16 WARNING (MainThread) [homeassistant.components.climate] Setup of platform eq3btsmart is taking over 10 seconds.
2019-09-19 10:22:32 WARNING (SyncWorker_2) [homeassistant.components.eq3btsmart.climate] Updating the state failed: Failed to connect to peripheral XX:XX:XX:XX:XX:XX, addr type: public
2019-09-19 10:23:48 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.living_room is taking over 10 seconds

2 3

For me this was resolved via HA update… If I’m correct it was 0.98.2 or something like that…

Currently running 0.99.0 and working fine…

To me it’s frustrating that the valve is for sure functioning but it’s like now HA forever does not want to connect to the valve anymore.

Removing the code lines in the configuration.yaml does not seem to help to kind of having HA “forgetting” about the device. Another solution could be to have the valve with another mac address. But that is impossible I guess.

Maybe I just have to buy another valve and that will work but it’s scary it could happen again :frowning:

Do you have 1 or more BT valves?

Yes, I have in total 2 bluetooth eqiva valves.

The bedroom valve (in another room than the raspberry) is working perfectly, while the living room valve (in the same room in the raspberry) always results unavailable. You can see from the picture in my first post that the bedroom valve is showing correctly as “Off” while the living room one is “Unavailable”.

Did you try to clean cache of browser?

Other option, maybe the best one is to open new case in github…

I connect my eqiva cc-rt-ble-eq to my iPhone using ‘Calor BT’ and configure them.

Now I want to connect them to HASS but when I put them in PAIR mode and scan from my Pi4B with command:

sudo hcitool lescan

I cannot see them. Any other ideas how to find the MAC address. Now I’m searching a way to extract it from Colar BT application. I think that when devices are put in Pair mode they will show in the BT network.

Strange is that iPhone bluetooth also does not find them ( I know apple have their own bluetooth protocol and maybe that is the reason. )

UPDATE

I think that is the problem:
Notice: The device in question has to be disconnected from bluetoothd, since BTLE devices can only hold one connection at a time.

I will try to disconnect my devices from my Phone and then re-pari them with HASSIO

I found 2 which are close to my Pi4 ( kitchen and living ) but the bedroom is behind a solid wall and I think cannot reach it via bluetooth.

One of them is working for the other I have some issues.

I ran bluetooth scanner and after some time without putting them in PAIR mode they apper but I stop my phone bluetooth.

bash-5.0# eq3cli --mac 00:1A:22:11:3C:60
[00:1A:22:11:3C:60] Target 17.0 (mode: auto dst, away: no)
Locked: False
Batter low: False
Window open: False
Window open temp: 12.0
Window open time: 0:15:00
Boost: False
Current target temp: 17.0
Current comfort temp: 21.0
Current eco temp: 17.0
Current temp offset: 0.0
Current mode: auto dst
Valve: 0
bash-5.0# eq3cli --mac 00:1A:22:11:43:14
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/eq3bt/connection.py", line 36, in __enter__
    self._conn.connect(self._mac)
  File "/usr/local/lib/python3.7/site-packages/bluepy/btle.py", line 445, in connect
    self._connect(addr, addrType, iface)
  File "/usr/local/lib/python3.7/site-packages/bluepy/btle.py", line 439, in _connect
    raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral 00:1A:22:11:43:14, addr type: public

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/eq3cli", line 10, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1114, in invoke
    return Command.invoke(self, ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/eq3bt/eq3cli.py", line 34, in cli
    thermostat.update()
  File "/usr/local/lib/python3.7/site-packages/eq3bt/eq3btsmart.py", line 205, in update
    self._conn.make_request(PROP_WRITE_HANDLE, value)
  File "/usr/local/lib/python3.7/site-packages/eq3bt/connection.py", line 71, in make_request
    with self:
  File "/usr/local/lib/python3.7/site-packages/eq3bt/connection.py", line 40, in __enter__
    self._conn.connect(self._mac)
  File "/usr/local/lib/python3.7/site-packages/bluepy/btle.py", line 445, in connect
    self._connect(addr, addrType, iface)
  File "/usr/local/lib/python3.7/site-packages/bluepy/btle.py", line 439, in _connect
    raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral 00:1A:22:11:43:14, addr type: public

It seems bluetooth is not so good and my OS is getting out of memory. I will try BT to Zigbee but first i need to stop the Climate control to avoid Out of memory

2020-01-22 17:09:50 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.living fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/eq3btsmart/climate.py", line 197, in update
    self._thermostat.update()
  File "/usr/local/lib/python3.7/site-packages/eq3bt/eq3btsmart.py", line 205, in update
    self._conn.make_request(PROP_WRITE_HANDLE, value)
  File "/usr/local/lib/python3.7/site-packages/eq3bt/connection.py", line 71, in make_request
    with self:
  File "/usr/local/lib/python3.7/site-packages/eq3bt/connection.py", line 36, in __enter__
    self._conn.connect(self._mac)
  File "/usr/local/lib/python3.7/site-packages/bluepy/btle.py", line 445, in connect
    self._connect(addr, addrType, iface)
  File "/usr/local/lib/python3.7/site-packages/bluepy/btle.py", line 426, in _connect
    self._startHelper(iface)
  File "/usr/local/lib/python3.7/site-packages/bluepy/btle.py", line 284, in _startHelper
    preexec_fn = preexec_function)
  File "/usr/local/lib/python3.7/subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "/usr/local/lib/python3.7/subprocess.py", line 1482, in _execute_child
    restore_signals, start_new_session, preexec_fn)
OSError: [Errno 12] Out of memory